--- drupal-4.7.0/modules/user.module Sun Apr 30 01:27:53 2006 +++ stuff/modules/user.module Fri May 19 09:55:25 2006 @@ -431,7 +431,7 @@ * Implementation of hook_perm(). */ function user_perm() { - return array('administer access control', 'administer users', 'access user profiles', 'change own username'); + return array('administer access control', 'administer users', 'access user profiles', 'change own username','change own email','change own password'); } /** @@ -550,7 +550,9 @@ if (variable_get('user_register', 1)) { $items[] = l(t('Create new account'), 'user/register', array('title' => t('Create a new user account.'))); } - $items[] = l(t('Request new password'), 'user/password', array('title' => t('Request new password via e-mail.'))); + if ( variable_get('user_request_password',1 ) == 1 ) { + $items[] = l(t('Request new password'), 'user/password', array('title' => t('Request new password via e-mail.'))); + } $form['links'] = array('#value' => theme('item_list', $items)); $block['subject'] = t('User login'); @@ -1289,6 +1291,7 @@ '#required' => TRUE, ); } +if ( user_access('change own email') ) { $form['account']['mail'] = array('#type' => 'textfield', '#title' => t('E-mail address'), '#default_value' => $edit['mail'], @@ -1296,10 +1299,13 @@ '#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, ); +} +if ( user_access('change own password' )) { $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'))); }