summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGábor Hojtsy <gabor@hojtsy.hu>2008-01-22 07:51:56 +0000
committerGábor Hojtsy <gabor@hojtsy.hu>2008-01-22 07:51:56 +0000
commitba5468e508877767affb6c517b0d0555c0904c74 (patch)
treedeaa8f9dc41d3340b7492490efe83f21fb425913
parentf5a85afc2e3dd0f6dc5fc04760bd5a34ee9ecd0e (diff)
downloadbrdo-ba5468e508877767affb6c517b0d0555c0904c74.tar.gz
brdo-ba5468e508877767affb6c517b0d0555c0904c74.tar.bz2
#119038 by ximo, Pancho: user role editing usability: include disabled checkbox for authenticated role
-rw-r--r--modules/user/user.module28
1 files changed, 26 insertions, 2 deletions
diff --git a/modules/user/user.module b/modules/user/user.module
index d1b562c7e..08b94e3cd 100644
--- a/modules/user/user.module
+++ b/modules/user/user.module
@@ -1422,14 +1422,38 @@ function user_edit_form(&$form_state, $uid, $edit, $register = FALSE) {
);
}
if ($admin) {
- $form['account']['status'] = array('#type' => 'radios', '#title' => t('Status'), '#default_value' => isset($edit['status']) ? $edit['status'] : 1, '#options' => array(t('Blocked'), t('Active')));
+ $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 permissions')) {
$roles = user_roles(TRUE);
+
+ // The disabled checkbox subelement for the 'authenticated user' role
+ // must be generated separately and added to the checkboxes element,
+ // because of a limitation in D6 FormAPI not supporting a single disabled
+ // checkbox within a set of checkboxes.
+ // TODO: This should be solved more elegantly. See issue #119038.
+ $checkbox_authenticated = array(
+ '#type' => 'checkbox',
+ '#title' => $roles[DRUPAL_AUTHENTICATED_RID],
+ '#default_value' => TRUE,
+ '#disabled' => TRUE,
+ );
+
unset($roles[DRUPAL_AUTHENTICATED_RID]);
if ($roles) {
$default = empty($edit['roles']) ? array() : array_keys($edit['roles']);
- $form['account']['roles'] = array('#type' => 'checkboxes', '#title' => t('Roles'), '#default_value' => $default, '#options' => $roles, '#description' => t('The user receives the combined permissions of the %au role, and all roles selected here.', array('%au' => t('authenticated user'))));
+ $form['account']['roles'] = array(
+ '#type' => 'checkboxes',
+ '#title' => t('Roles'),
+ '#default_value' => $default,
+ '#options' => $roles,
+ DRUPAL_AUTHENTICATED_RID => $checkbox_authenticated,
+ );
}
}