Same name and namespace in other branches
  1. 4.7.x modules/user.module \user_edit_form()
  2. 5.x modules/user/user.module \user_edit_form()
  3. 6.x modules/user/user.module \user_edit_form()
1 call to user_edit_form()
user_user in modules/user.module
Implementation of hook_user().

File

modules/user.module, line 1057
Enables the user registration and login system.

Code

function user_edit_form($uid, $edit) {

  // Account information:
  $group = form_textfield(t('Username'), 'name', $edit['name'], 30, 55, t('Your full name or your preferred username: only letters, numbers and spaces are allowed.'), NULL, TRUE);
  $group .= form_textfield(t('E-mail address'), 'mail', $edit['mail'], 30, 55, 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.'), NULL, TRUE);
  $group .= form_item(t('Password'), '<input type="password" class="form-password" name="edit[pass1]" size="12" maxlength="24" /> <input type="password" class="form-password" name="edit[pass2]" size="12" maxlength="24" />', t('Enter your new password twice if you want to change your current password, or leave it blank if you are happy with your current password.'), NULL, TRUE);
  if (user_access('administer users')) {
    $group .= form_radios(t('Status'), 'status', $edit['status'], array(
      t('Blocked'),
      t('Active'),
    ));
    $group .= form_checkboxes(t('Roles'), 'roles', array_keys($edit['roles']), user_roles(1), t('Select at least one role.  The user receives the combined permissions of all of the selected roles.'), NULL, TRUE);
  }
  $data[] = array(
    'title' => t('Account information'),
    'data' => $group,
    'weight' => 0,
  );

  // Picture/avatar:
  if (variable_get('user_pictures', 0)) {
    $group = '';
    if ($edit['picture'] && ($picture = theme('user_picture', array2object($edit)))) {
      $group .= $picture;
      $group .= form_checkbox(t('Delete picture'), 'picture_delete', 1, 0, t('Check this box to delete your current picture.'));
    }
    $group .= form_file(t('Upload picture'), 'picture', 48, t('Your virtual face or picture.  Maximum dimensions are %dimensions and the maximum size is %size kB.', array(
      '%dimensions' => variable_get('user_picture_dimensions', '85x85'),
      '%size' => variable_get('user_picture_file_size', '30'),
    )) . ' ' . variable_get('user_picture_guidelines', ''));
    $data[] = array(
      'title' => t('Picture'),
      'data' => $group,
      'weight' => 1,
    );
  }
  return $data;
}