You are here

function _hybridauth_encode_authname in HybridAuth Social Login 7

Creates an authname that will remain unique across providers

4 calls to _hybridauth_encode_authname()
hybridauth_form_user_register_form_alter in ./hybridauth.module
Implements hook_form_FORM_ID_alter().
hybridauth_user_insert in ./hybridauth.module
Implements hook_user_insert().
_hybridauth_popup_process_auth in ./hybridauth.pages.inc
A helper function that takes a successful HA authentication and handles the Drupal side of things.
_hybridauth_popup_process_auth_addexisting in ./hybridauth.pages.inc
A helper function that takes a successful HA authentication and handles the Drupal side of things.

File

./hybridauth.module, line 640

Code

function _hybridauth_encode_authname($provider_id, $identifier) {
  switch ($provider_id) {
    case 'Facebook':
      if (is_numeric($identifier)) {
        return 'http://www.facebook.com/profile.php?id=' . $identifier;
      }
      return $identifier;
    case 'Twitter':
      if (is_numeric($identifier)) {
        return 'http://twitter.com/account/profile?user_id=' . $identifier;
      }
      return $identifier;
    case 'Google':
      if (is_numeric($identifier)) {
        return 'https://www.google.com/profiles/' . $identifier;
      }
      return $identifier;
    default:
      return $identifier;
  }
}