Index: modules/user/user.module =================================================================== RCS file: /cvs/drupal/drupal/modules/user/user.module,v retrieving revision 1.703 diff -u -r1.703 user.module --- modules/user/user.module 28 Oct 2006 15:13:41 -0000 1.703 +++ modules/user/user.module 3 Nov 2006 15:32:36 -0000 @@ -809,7 +809,7 @@ 'callback' => 'drupal_get_form', 'callback arguments' => array('user_edit'), 'access' => $admin_access || $user->uid == arg(1), 'type' => MENU_LOCAL_TASK); $items[] = array('path' => 'user/'. arg(1) .'/delete', 'title' => t('Delete'), - 'callback' => 'user_edit', 'access' => $admin_access, + 'callback' => 'user_edit', 'access' => $admin_access && arg(1) != 1, 'type' => MENU_CALLBACK); if (arg(2) == 'edit') { @@ -1278,8 +1278,10 @@ } function user_edit_form($uid, $edit, $register = FALSE) { + global $user; $admin = user_access('administer users'); - + $account = user_load(array('uid' => $uid)); + // Account information: $form['account'] = array('#type' => 'fieldset', '#title' => t('Account information'), @@ -1312,7 +1314,7 @@ '#required' => TRUE, ); } - if ($admin) { + if ($admin && $account->uid != $user->uid) { $form['account']['status'] = array('#type' => 'radios', '#title' => t('Status'), '#default_value' => isset($edit['status']) ? $edit['status'] : 1, '#options' => array(t('Blocked'), t('Active'))); } if (user_access('administer access control')) { @@ -1417,7 +1419,7 @@ $form['_category'] = array('#type' => 'value', '#value' => $category); $form['_account'] = array('#type' => 'value', '#value' => $account); $form['submit'] = array('#type' => 'submit', '#value' => t('Submit'), '#weight' => 30); - if (user_access('administer users')) { + if (user_access('administer users') && $account->uid != 1) { $form['delete'] = array('#type' => 'submit', '#value' => t('Delete'), '#weight' => 31); } $form['#attributes']['enctype'] = 'multipart/form-data';