Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save hanamizuki/4329269 to your computer and use it in GitHub Desktop.
Save hanamizuki/4329269 to your computer and use it in GitHub Desktop.
Step 1, Print the FBCONNECT Button, anywhere you want
<?php
print fboauth_action_display();
?>
Step 2, Add this to your CUSTOM_MODULE
<?php
/**
* Implements hook_fboauth_actions_alter(): Customise redirect path
*
* @see hook_fboauth_actions_alter();
*/
function CUSTOM_MODULE_fboauth_actions_alter(&$actions) {
$actions['connect']['callback'] = '_bh_user_fboauth_action_connect';
}
/**
* Callback for CUSTOM_MODULE_fboauth_actions_alter(): Customise redirect path
*
* @see hook_fboauth_actions_alter();
*/
function _CUSTOM_MODULE_fboauth_action_connect($app_id, $access_token) {
// Call the default action first
fboauth_action_connect($app_id, $access_token);
global $user; //dpm($user);
if($user->uid && $user->created == $user->login){
drupal_goto("user/$user->uid/edit");
}
drupal_goto('<front>');
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment