summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/user.module6
-rw-r--r--modules/user/user.module6
2 files changed, 8 insertions, 4 deletions
diff --git a/modules/user.module b/modules/user.module
index db35fd027..86e63e43e 100644
--- a/modules/user.module
+++ b/modules/user.module
@@ -1530,17 +1530,19 @@ function _user_admin_access_form($edit) {
'#default_value' => 0,
'#options' => array('1' => t('Allow'), '0' => t('Deny')),
);
+ $type_options = array('user' => t('Username'), 'mail' => t('E-mail'), 'host' => t('Host'));
$form['type'] = array(
'#type' => 'radios',
'#title' => t('Rule type'),
- '#default_value' => 'user',
- '#options' => array('user' => t('Username'), 'mail' => t('E-mail'), 'host' => t('Host')),
+ '#default_value' => (isset($type_options[$edit['type']]) ? $edit['type'] : 'user'),
+ '#options' => $type_options,
);
$form['mask'] = array(
'#type' => 'textfield',
'#title' => t('Mask'),
'#size' => 30,
'#maxlength' => 64,
+ '#default_value' => $edit['mask'],
'#description' => '%: '. t('Matches any number of characters, even zero characters') .'.<br />_: '. t('Matches exactly one character.'),
'#required' => TRUE,
);
diff --git a/modules/user/user.module b/modules/user/user.module
index db35fd027..86e63e43e 100644
--- a/modules/user/user.module
+++ b/modules/user/user.module
@@ -1530,17 +1530,19 @@ function _user_admin_access_form($edit) {
'#default_value' => 0,
'#options' => array('1' => t('Allow'), '0' => t('Deny')),
);
+ $type_options = array('user' => t('Username'), 'mail' => t('E-mail'), 'host' => t('Host'));
$form['type'] = array(
'#type' => 'radios',
'#title' => t('Rule type'),
- '#default_value' => 'user',
- '#options' => array('user' => t('Username'), 'mail' => t('E-mail'), 'host' => t('Host')),
+ '#default_value' => (isset($type_options[$edit['type']]) ? $edit['type'] : 'user'),
+ '#options' => $type_options,
);
$form['mask'] = array(
'#type' => 'textfield',
'#title' => t('Mask'),
'#size' => 30,
'#maxlength' => 64,
+ '#default_value' => $edit['mask'],
'#description' => '%: '. t('Matches any number of characters, even zero characters') .'.<br />_: '. t('Matches exactly one character.'),
'#required' => TRUE,
);