AHWEBDEV
Forum Replies Created
-
Hi, I fixed the login button with good values and names.
the file to replace is in plugins/facebook-awd/inc/admin/forms/login_bitton.php
This will repair the login button redirect url.
Dowload the file here and replace the old one.
https://gist.github.com/3724003However, I noticed that it does change the logout button generated by your plugin.
The button name is now the “after logout url” I entered in plugin settings (before it was just the word “Logout”).
The button code is now:
<a href="https://www.facebook.com/logout.php?next=https://mytestdomain.com/facebook-awd/logout?redirect_to=https://mytestdomain.com/users/?action=login&_wpnonce=b69d42fb25&access_token=AAAEvn...">https://mytestdomain.com/my-board</a>
Please notice that redirect_to has value I entered in “Url after login” in plugin settings. And the anchor tag content is: https://mytestdomain.com/my-board which is url which I entered “Url after logout” plugin settings.
OK i note that to fix it. i must verify the name of variable beteween url after logout and url after login.
Hi,
If I’m logged out from WP it signs me back in after I sign in to Facebook. Is this desired behavior?
Yes as you already authorized the app
You re right, the is_user_logged_in_facebook() is broken. however, using the /me api call will increase the page loading on each page.
For the bug I mentioned before (log out redirect url used as a label and log in url used in log out redirection) I’ll create another thread.
thank you, i will follow that.
Forum: Plugins
In reply to: [Facebook AWD All in one] [Plugin: Facebook AWD All in one] V1.4 issuesOk i see what’s wrong, I will fix it, and send you testing code. thanks for report and help.
OK so i decoded the url and that give that:
https://www.facebook.com/logout.php?next=https://mytestdomain.com/facebook-awd/logout?redirect_to=index.php&_wpnonce=b69d42fb25&access_token=AAAEvnD4aoZAgBAGZCRiuSxKHxrrmuAZBZAN8GUm4PGAm28WZBxpEAdoXL0esv1ZCrkZC2y6my8en6xB6IJlaJXAOzdNySFc2AnxcezoO2or9wZDZDthe strange thing is that redirect_to=index.php normaly, this should redirect to an url on your site.
I explain:
When you logout, first we redirect you on facebook to clear facebook session, then facebook redirect you to an special url on your site to clear WP session, then it will redirect you to the url after logout.
Did you set an url for redirect after login ? It seems this is the problem, as this url is set to “index.php” it’s not a good url
Can you give me the url to logout on your site when your are FB connected ?
Forum: Plugins
In reply to: [Facebook AWD All in one] [Plugin: Facebook AWD All in one] V1.4 issuesOk and the folder of the 1.4.1 is named “facebook-awd” ? this is important…
So after activation did you see difference ?
What is your browser ? i need an url to test, as i can’t reproduce the bug.
Forum: Plugins
In reply to: [Facebook AWD All in one] [Plugin: Facebook AWD All in one] V1.4 issuesCan you try to download the version from gitHub ? i update some line of code…
https://github.com/AHWEBDEV/Facebook-AWDCan you give me more info ? i need to know where this error happens ?
Wich line of code can you paste the full error report here ? thanksForum: Plugins
In reply to: [Facebook AWD All in one] [Plugin: Facebook AWD All in one] V1.4 issuesAre you both using html5 or xfbml buttons ?
So this one !
function force_fb_login() { //access to the Facebook AWD object global $AWD_facebook; //define the app url and the redirect after login $redirect_uri = 'https://apps.facebook.com/'.$AWD_facebook->options['app_infos']['namespace'].'/?redirect_to=' . $AWD_facebook->get_current_url(); $scope = $AWD_facebook->options["perms"]; $login_options = array( 'scope' => $scope, 'redirect_uri' => $redirect_uri ); //Check if the user is logged in with Facebook, if no, redirect him to the Facebook login page. if (!is_user_logged_in()) { echo '<script>top.location.href="'.$AWD_facebook->fcbk->getLoginUrl($login_options).'";</script>'; exit(); } } add_action('wp_head', 'force_fb_login');
Ok, i know why, when the file functions.php is read, the $AWD_facebook is not yet an object.
However i saw that in the code the redirect url of this function after the login will be your website url, not the fb app url.So I wrote a little hack, in wait of a new version of the plugin.
function force_fb_login() { //access to the Facebook AWD object global $AWD_facebook; //define the app url and the redirect after login $redirect_uri = $AWD_facebook->options['app_infos']['link'] . (get_option('permalink_structure') != '' ? '?' : '&') . 'redirect_to=' . $AWD_facebook->get_current_url(); $scope = $AWD_facebook->options["perms"]; $login_options = array( 'scope' => $scope, 'redirect_uri' => $redirect_uri ); //Check if the user is logged in with Facebook, if no, redirect him to the Facebook login page. if (!is_user_logged_in()) { echo '<script>top.location.href="'.$AWD_facebook->fcbk->getLoginUrl($login_options).'";</script>'; exit(); } } add_action('wp_head', 'force_fb_login');
I tested it, and it works great in app canvas !
Forum: Plugins
In reply to: [Facebook AWD All in one] [Plugin: Facebook AWD All in one] V1.4 issuesReference issue
Can’t find variable: FB”You get that only on the login page no ? in admin too ?
Social plugin should works. look here https://www.ahwebdev.fr it uses the 1.4 and fb plugins are working.If it works, you can use write it with less code…
global $AWD_facebook; add_action('init', array($AWD_facebook, 'login_required');
In fact i am not sure this will work, because the redirect is set to the current url. but in an app canvas the current url is the app page, but for the plugin the current url is the WP url.
Try it, and tell me.