function logintoboggan_form_user_admin_account_alter in LoginToboggan 7
Implement hook_form_user_admin_account_alter().
Related topics
File
- ./
logintoboggan.module, line 276 - LoginToboggan module
Code
function logintoboggan_form_user_admin_account_alter(&$form, &$form_state) {
// Unset the ability to add the pre-auth role in the user admin interface.
$id = logintoboggan_validating_id();
// Test here for a valid pre-auth -- we only remove this role if one exists.
$pre_auth = !variable_get('user_email_verification', TRUE) && $id != DRUPAL_AUTHENTICATED_RID;
$add = t('Add a role to the selected users');
if ($pre_auth && isset($form['options']['operation']['#options'][$add]["add_role-{$id}"])) {
unset($form['options']['operation']['#options'][$add]["add_role-{$id}"]);
}
}