function domain_registration_admin_form in Restrict Domain Registration 7
Administration form for domain registration.
1 string reference to 'domain_registration_admin_form'
- domain_registration_menu in ./
domain_registration.module - Implements hook_menu().
File
- ./
domain_registration.module, line 56 - Domain Registration module file.
Code
function domain_registration_admin_form($form, &$form_state) {
$options = array(
DOMAIN_REGISTRATION_ALLOW => t('Allow only domains listed below to register'),
DOMAIN_REGISTRATION_DENY => t('Prevent domains listed below from registering'),
);
$form['domain_registration_method'] = array(
'#type' => 'radios',
'#required' => TRUE,
'#options' => $options,
'#title' => t('Restriction Type'),
'#default_value' => variable_get('domain_registration_method', DOMAIN_REGISTRATION_ALLOW),
'#description' => t('Choose which method you would like the domains list to operate. Only allow domains listed to register, or prevent domains listed from registering.'),
);
$form['domain_registration'] = array(
'#type' => 'textarea',
'#required' => TRUE,
'#title' => t('Email domains'),
'#default_value' => variable_get('domain_registration'),
'#description' => t('Enter the domains you wish to restrict registration. One entry per line in the format (e.g. something.com). Wildcards are also supported (e.g. *.something.com) to match any subdomain.'),
);
$form['domain_registration_message'] = array(
'#type' => 'textfield',
'#required' => TRUE,
'#title' => t('Error message'),
'#maxlength' => 512,
'#size' => 120,
'#default_value' => variable_get('domain_registration_message', t('You are not allowed to register for this site.')),
'#description' => t('Enter the error message you want the user to see if the email address does not validate.'),
);
return system_settings_form($form);
}