case 'user_profile_form': // Prevent modifying user/1
if ($form['#uid'] === '1') {
global $user;
// Allow user/1 to edit own details.
if ($user->uid != 1) {
drupal_set_message('You must login as this user (user/1) to modify the email address and password for this account.');
$form['account']['mail']['#access'] = FALSE;
$form['account']['pass']['#access'] = FALSE;
}
}
break;
Comments
Comment #1
killes@www.drop.org commentedI actually don't know why I did this...
Comment #2
gregglesSeems better?
The alternative is that we should provide some documentation to say "use drush to change uid1 password" (since it does passwords now).
Comment #3
coltraneIn 6.x UID 1 can change his/her password: