Created
December 18, 2012 16:04
-
-
Save hanamizuki/4329269 to your computer and use it in GitHub Desktop.
See the discussion here: http://drupal.org/node/1761954#comment-6857202
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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