You are here

function user_admin_access_form in Drupal 5

Same name and namespace in other branches
  1. 6 modules/user/user.admin.inc \user_admin_access_form()
1 string reference to 'user_admin_access_form'
user_forms in modules/user/user.module

File

modules/user/user.module, line 1718
Enables the user registration and login system.

Code

function user_admin_access_form($edit, $submit) {
  $form = array();
  $form['aid'] = array(
    '#type' => 'value',
    '#value' => $edit['aid'],
  );
  $form['status'] = array(
    '#type' => 'radios',
    '#title' => t('Access type'),
    '#default_value' => $edit['status'],
    '#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' => 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,
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => $submit,
  );
  $form['#base'] = 'user_admin_access_form';
  return $form;
}