Commit c6328111 authored by Dries's avatar Dries
Browse files

- Patch #48242 by markus: add/edit form in user access rules is broken.

parent b67cce5a
......@@ -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,
);
......
......@@ -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,
);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment