You are here

function hook_simple_fb_connect_redirect_url in Simple FB Connect 7.2

This hook allows other modules to modify the post login URL.

Parameters

$path: Path for the subsequent drupal_goto() call.

$options: Options for the subsequent drupal_goto() call.

$drupal_user: Drupal user that was logged in via Simple FB Connect.

Return value

A two element array, with the possibly modified $path and $options.

See also

https://api.drupal.org/api/drupal/includes%21common.inc/function/url/7.x

1 invocation of hook_simple_fb_connect_redirect_url()
simple_fb_connect_go_to_redirect_url in ./simple_fb_connect.module
Redirects user after Facebook login to the desired Drupal path.

File

./simple_fb_connect.api.php, line 160
Hooks provided by the Simple FB Connect module.

Code

function hook_simple_fb_connect_redirect_url($path, $options, $drupal_user) {

  // This example hook implementation shows how to switch the language according
  // to user's language preference.
  global $language;
  $user_language = $drupal_user->language;
  if (isset($user_language) && isset($language->language) && $user_language != $language->language) {

    // Verify user language exists and is enabled.
    $languages = language_list();
    if (isset($languages[$user_language]) && $languages[$user_language]->enabled) {
      $options['language'] = $languages[$user_language];
    }
  }
  return [
    $path,
    $options,
  ];
}