function _ga_login_username in Google Authenticator login 7
Same name and namespace in other branches
- 6 ga_login.module \_ga_login_username()
Create a site specific username.
6 calls to _ga_login_username()
- ga_login_create_form_submit in ./
ga_login.pages.inc - Submit handler to create a new code.
- ga_login_create_form_validate in ./
ga_login.pages.inc - Validation handler to create a new code.
- ga_login_delete_code in ./
ga_login.module - Removes the GA login code associated with an account.
- ga_login_user_login_validate in ./
ga_login.module - Validate callback for login form.
- ga_login_validate_gacode in ./
ga_login.module - Form element validation handler for gacode field.
File
- ./
ga_login.module, line 391 - Main ga_login module.
Code
function _ga_login_username($account, $encode = TRUE) {
$realm = variable_get('ga_login_textname', variable_get('site_name', 'Drupal'));
$suffix = variable_get('ga_login_textid', '');
$username = format_string('!account@!realm!suffix', array(
'!account' => $account->name,
'!realm' => $realm,
'!suffix' => $suffix,
));
return $encode ? rawurlencode($username) : $username;
}