Hi,
Right now what I have is once I click the facebook connect button, it will ask either one of these 2:
1. Don't have a account? Create an account now
2. I already have an account, I'd like to use Facebook Connect features.
How can i change the flow to:
1. click the facebook connect button
2. automatically logged in (just like how http://www.drupalforfacebook.org/ is doing it)
Is there some kind of settings that I don't know about?
Thanks.
Teguh
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | Untitled-1.jpg | 4.31 KB | hankpalan.com |
Comments
Comment #1
tobiasr commentedThis would involve custom development.
Instead of calling fbconnect_render_button, you have to display your own FbConnect button, like this:
. On your page, have a JS like this:
FB.init('$FB_API_KEY', "xd_receiver.php");
if(FB.Connect != null)
FB.Connect.ifUserConnected(check_user);
Then have a JS function check_user that redirects to a page or loads a page via Ajax to create the user directly without asking the questions you referred to. For example, we use this PHP function that is called via Ajax to directly create the user if necessary:
$fbuid = fbconnect_get_fbuid();
$fb_return = facebook_client()->api_client->users_getInfo($fbuid, array('proxied_email','first_name','last_name', 'name'));
if(!_is_fbconnect_user($fbuid))
{
$udata = array(
'name' => business_sanitize_word(fbconnect_get_fbname($fbuid)),
'mail' => $fb_return[0]['proxied_email'],
'init' => $fb_return[0]['proxied_email'],
'status' => 1,
'login' => time(),
'pass' => user_password(),
);
fbconnect_register_user($udata);
if(variable_get('fbconnect_fast_reg_import_anyway', false))
{
$options = array_values(variable_get('fbconnect_profile_fields', NULL));
$options = array_filter($options, 'fbconnect_import_filter');
fbconnect_profile_insert_user_info($user->uid, $options);
}
$drupal_uid = _is_fbconnect_user($fbuid);
$fb_return[0]['uid'] = $drupal_uid['uid'];
}
print(drupal_to_js($fb_return[0]));
Comment #2
Geekpulp commentedAny chance of this feature being added to the module? I was thinking this was the whole point of the module.
Comment #3
tobiasr commentedThere should be an option for it maybe. The current implementation does make sense (because the user might already be registered at the site), and it it is suggested like that by Facebook. However, I think many sites will want a one click login and user creation (us included).
Comment #4
buddaShould the 1 click auto login be enabled by default in this module instead of the current behavior?
Comment #5
lotusflwr commentedI agree with #2, I had thought part of the point of this module was to also to allow easier login and tighter integration with Facebook.
My site is specifically for a specific group of Facebook users so being able to register using fbconnect, integrating bits of your profile and posting notifications is key, but either being logged in to my site when you're logged into Facebook or being able to click a "login using my facebook credentials" type thing would really make this module complete.
It is really misleading because the Connect to Facebook button appears on the Log in tab at user/login... but it's really to register. There is no connect button on user/register however. Kind of backwards!
Comment #6
eli03 commentedI agree with #2, facebook connect module should not function as the current behavior. If I have a current drupal account why would I login using my FB account if I know I can login faster using my drupal account? Fb connect is created to make the login faster just like OPEN ID.
Comment #7
hankpalan.com commentedYou know I was rather confused with this step also however, I can see where it could be useful for people wanting to link their fb account with their drupal site account, not for easier login, but to post stories and such to their fb account.
Just like the twitter module adds the capability to twitter from posting stories, I think this is a necessary step. But from a UI point of view, its not done right, its confusing.
It could be less confusing if it were reworded and/or themed correctly. See attached pic.
Additionally if somebody were already loged in, they should be able to link their account from their My Account.
Comment #8
drupal3008 commented@mteguh re:
1. Don't have a account? Create an account now
2. I already have an account, I'd like to use Facebook Connect features.
How can i change the flow to:
1. click the facebook connect button
2. automatically logged in (just like how http://www.drupalforfacebook.org/ is doing it)
* * * * * *
It is necessary to keep it this current way because in order for the fbconnect to work, it needs to be tied into an account in the drupal user system (i.e. FB account needs to associate with a Drupal account).
The first steps are what happens when you attempt to log in with fbconnect and it doesn't detect a current association in the drupal user system (i.e. current fb user doesn't match an existing drupal account). That is why it asks you to either create a new account if you are a new user, or to link it with an existing drupal account.
The flow you propose occurs when you already have an account in the drupal system. When you click on the front-page fb connect button, it automatically logs you in.
Comment #9
gobinathmClosing the issue. It was inactive for a long time & it's related to a Drupal Version which is not supported anymore