Index: user.module =================================================================== RCS file: /cvs/drupal/drupal/modules/user.module,v retrieving revision 1.621 diff -u -u -F^f -r1.621 user.module --- user.module 12 May 2006 18:14:50 -0000 1.621 +++ user.module 12 May 2006 18:53:58 -0000 @@ -711,7 +711,7 @@ function user_menu($may_cache) { $items[] = array('path' => 'user/register', 'title' => t('register'), 'callback' => 'user_register', 'access' => $user->uid == 0 && variable_get('user_register', 1), 'type' => MENU_LOCAL_TASK); $items[] = array('path' => 'user/password', 'title' => t('request new password'), - 'callback' => 'user_pass', 'access' => $user->uid == 0, 'type' => MENU_LOCAL_TASK); + 'callback' => 'user_pass', 'access' => $user->uid == 0 && variable_get('user_change_password',1), 'type' => MENU_LOCAL_TASK); $items[] = array('path' => 'user/reset', 'title' => t('reset password'), 'callback' => 'user_pass_reset', 'access' => TRUE, 'type' => MENU_CALLBACK); $items[] = array('path' => 'user/help', 'title' => t('help'), @@ -1297,10 +1297,12 @@ function user_edit_form($uid, $edit) { '#description' => t('Insert a valid e-mail address. All e-mails from the system will be sent to this address. The e-mail address is not made public and will only be used if you wish to receive a new password or wish to receive certain news or notifications by e-mail.'), '#required' => TRUE, ); - $form['account']['pass'] = array('#type' => 'password_confirm', - '#title' => t('Password'), - '#description' => t('To change the current user password, enter the new password in both fields.'), - ); + if(variable_get('user_change_password',1)) { + $form['account']['pass'] = array('#type' => 'password_confirm', + '#title' => t('Password'), + '#description' => t('To change the current user password, enter the new password in both fields.'), + ); + } if (user_access('administer users')) { $form['account']['status'] = array('#type' => 'radios', '#title' => t('Status'), '#default_value' => $edit['status'], '#options' => array(t('Blocked'), t('Active'))); } @@ -1935,6 +1937,7 @@ function user_configure() { // User registration settings. $form['registration'] = array('#type' => 'fieldset', '#title' => t('User registration settings')); $form['registration']['user_register'] = array('#type' => 'radios', '#title' => t('Public registrations'), '#default_value' => variable_get('user_register', 1), '#options' => array(t('Only site administrators can create new user accounts.'), t('Visitors can create accounts and no administrator approval is required.'), t('Visitors can create accounts but administrator approval is required.'))); + $form['registration']['user_change_password'] = array('#type' => 'checkbox', '#title' => t('Allow user to change password'), '#default_value' => variable_get('user_change_password',1), '#description' => t('Unchecking this option will prevent users from being able to change their passwords and hides all corresponding menu options.')); $form['registration']['user_registration_help'] = array('#type' => 'textarea', '#title' => t('User registration guidelines'), '#default_value' => variable_get('user_registration_help', ''), '#description' => t('This text is displayed at the top of the user registration form. It\'s useful for helping or instructing your users.')); // User e-mail settings.