function password_policy_admin_settings in Password Policy 5
Same name and namespace in other branches
- 6 password_policy.admin.inc \password_policy_admin_settings()
- 7.2 password_policy.module \password_policy_admin_settings()
- 7 password_policy.admin.inc \password_policy_admin_settings()
1 string reference to 'password_policy_admin_settings'
- password_policy_menu in ./
password_policy.module - Implementation of hook_menu().
File
- ./
password_policy.module, line 726
Code
function password_policy_admin_settings() {
$form = array();
$form['expiration'] = array(
'#type' => 'fieldset',
'#title' => t('Expiration Settings'),
'#collapsible' => TRUE,
'#collapsed' => FALSE,
);
$form['expiration']['password_policy_admin'] = array(
'#type' => 'checkbox',
'#title' => t('Admin (UID=1) password expires.'),
'#default_value' => variable_get('password_policy_admin', false),
'#description' => t('Admin account password will obey expiration policy.'),
);
$form['expiration']['password_policy_begin'] = array(
'#type' => 'radios',
'#title' => t('Beginning of password expirations'),
'#default_value' => variable_get('password_policy_begin', 0),
'#options' => array(
'0' => t('After expiration time from setting a default policy (all passwords are valid during the expiration time from setting the default policy, and after that older than expiration time passwords expire).'),
'1' => t('Setting a default policy (passwords older than expiration time expire after setting the default policy, retroactive behaviour).'),
),
);
$form['expiration']['password_policy_block'] = array(
'#type' => 'radios',
'#title' => t('Blocking expired accounts'),
'#default_value' => variable_get('password_policy_block', 0),
'#options' => array(
'0' => t('Expired accounts are blocked. Only administrators can unblock them.'),
'1' => t('The user with expired account is not blocked, but sent to a change password page. If the password is not changed, the account is blocked and the user cannot login again.'),
),
);
// E-mail notification settings.
$form['email'] = array(
'#type' => 'fieldset',
'#title' => t('E-mail notification settings'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$form['email']['password_policy_mail_warning_subject'] = array(
'#type' => 'textfield',
'#title' => t('Subject of warning e-mail'),
'#default_value' => _password_policy_mail_text('warning_subject'),
'#maxlength' => 180,
'#description' => t('Customize the subject of the warning e-mail message, which is sent to remind of password expiration.') . ' ' . t('Available variables are:') . ' %username, %site, %uri, %uri_brief, %mailto, %date, %login_uri, %edit_uri, %days.',
);
$form['email']['password_policy_mail_warning_body'] = array(
'#type' => 'textarea',
'#title' => t('Body of warning e-mail'),
'#default_value' => _password_policy_mail_text('warning_body'),
'#rows' => 15,
'#description' => t('Customize the body of the warning e-mail message, which is sent to remind of password expiration.') . ' ' . t('Available variables are:') . ' %username, %site, %uri, %uri_brief, %mailto, %date, %login_uri, %edit_uri, %days.',
);
return system_settings_form($form);
}