diff --git a/modules/user/user.module b/modules/user/user.module index d1b562c7eacf4513de0845ca81ade3e7c8eb3815..08b94e3cd3b0b08b80bc9e0084580918adbb438e 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, + ); } }