diff --git a/modules/user.module b/modules/user.module index db35fd027bf869dc85618bdc2bfebd05688c76c0..86e63e43e478ef96aaa079868fb7fcaad13a4ebe 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 db35fd027bf869dc85618bdc2bfebd05688c76c0..86e63e43e478ef96aaa079868fb7fcaad13a4ebe 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, );