| Versions | |
|---|---|
| 4.7 – 6 | user_admin_access_check() |
Menu callback: check an access rule
modules/
<?php
function user_admin_access_check() {
$form['user'] = array(
'#type' => 'fieldset',
'#title' => t('Username'),
);
$form['user']['test'] = array(
'#type' => 'textfield',
'#title' => '',
'#description' => t('Enter a username to check if it will be denied or allowed.'),
'#size' => 30,
'#maxlength' => 64,
);
$form['user']['type'] = array(
'#type' => 'hidden',
'#value' => 'user',
);
$form['user']['submit'] = array(
'#type' => 'submit',
'#value' => t('Check username'),
);
$output .= drupal_get_form('check_user', $form, 'user_admin_access_check');
unset($form); // prevent endless loop?
$form['mail'] = array(
'#type' => 'fieldset',
'#title' => t('E-mail'),
);
$form['mail']['test'] = array(
'#type' => 'textfield',
'#title' => '',
'#description' => t('Enter an e-mail address to check if it will be denied or allowed.'),
'#size' => 30,
'#maxlength' => 64,
);
$form['mail']['type'] = array(
'#type' => 'hidden',
'#value' => 'mail',
);
$form['mail']['submit'] = array(
'#type' => 'submit',
'#value' => t('Check e-mail'),
);
$output .= drupal_get_form('check_mail', $form, 'user_admin_access_check');
unset($form); // prevent endless loop?
$form['host'] = array(
'#type' => 'fieldset',
'#title' => t('Hostname'),
);
$form['host']['test'] = array(
'#type' => 'textfield',
'#title' => '',
'#description' => t('Enter a hostname or IP address to check if it will be denied or allowed.'),
'#size' => 30,
'#maxlength' => 64,
);
$form['host']['type'] = array(
'#type' => 'hidden',
'#value' => 'host',
);
$form['host']['submit'] = array(
'#type' => 'submit',
'#value' => t('Check hostname'),
);
$output .= drupal_get_form('check_host', $form, 'user_admin_access_check');
unset($form); // prevent endless loop?
return $output;
}
?>