function paranoia_form_user_profile_form_alter in Paranoia 7
Implements hook_form_FORM_ID_alter().
File
- ./
paranoia.module, line 122 - Paranoia module file. Provides various extra security features.
Code
function paranoia_form_user_profile_form_alter(&$form, &$form_state) {
if ($form_state['user']->uid === '1') {
global $user;
// Allow user/1 to edit own details.
if ($user->uid != 1) {
drupal_set_message(t('You must login as this user (user/1) to modify the name, email address, and password for this account.'), 'warning');
$form['account']['name']['#access'] = FALSE;
$form['account']['mail']['#access'] = FALSE;
$form['account']['pass']['#access'] = FALSE;
$form['account']['current_pass']['#access'] = FALSE;
}
}
}