File
- modules/user/user.module, line 1441
- Enables the user registration and login system.
Code
function user_edit($category = 'account') {
global $user;
$account = user_load(array('uid' => arg(1)));
if ($account === FALSE) {
drupal_set_message(t('The account does not exist or has already been deleted.'));
drupal_goto('admin/user/user');
}
$edit = $_POST['op'] ? $_POST : (array) $account;
if (arg(2) == 'delete') {
return drupal_get_form('user_confirm_delete', $account->name, $account->uid);
}
else if ($_POST['op'] == t('Delete')) {
if ($_REQUEST['destination']) {
$destination = drupal_get_destination();
unset($_REQUEST['destination']);
}
drupal_goto("user/$account->uid/delete", $destination);
}
$form = _user_forms($edit, $account, $category);
$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')) {
$form['delete'] = array(
'#type' => 'submit',
'#value' => t('Delete'),
'#weight' => 31,
);
}
$form['#attributes']['enctype'] = 'multipart/form-data';
drupal_set_title(check_plain($account->name));
return $form;
}
Login or
register to post comments