You are here

function prlp_admin_settings in Password Reset Landing Page (PRLP) 6

Same name and namespace in other branches
  1. 7 prlp.admin.inc \prlp_admin_settings()

Form builder function for PRLP config settings.

1 string reference to 'prlp_admin_settings'
prlp_menu in ./prlp.module
Implements hook_menu().

File

./prlp.admin.inc, line 11
Password Reset Landing Page admin pages.

Code

function prlp_admin_settings() {
  $form['prlp'] = array(
    '#type' => 'fieldset',
    '#title' => t('PRLP'),
    '#tree' => FALSE,
  );
  $form['prlp']['prlp_password_required'] = array(
    '#type' => 'checkbox',
    '#title' => t('Password Entry Required'),
    '#description' => t('If set, users will be required to enter a new password when they use a password reset link to login'),
    '#default_value' => variable_get('prlp_password_required', 1),
  );
  $form['prlp']['prlp_destination'] = array(
    '#type' => 'textfield',
    '#title' => t('Login Destination'),
    '#description' => t('User will be taken to this path after they log in with the password reset link. Token %uid can be used in the path, and will be replaced with the uid of the current user. Use %front for site front-page.', array(
      '%uid' => '%uid',
      '%front' => '<front>',
    )),
    '#default_value' => variable_get('prlp_destination', PRLP_DESTINATION_DEFAULT),
  );
  $form['prlp']['prlp_hidden_fields'] = array(
    '#type' => 'textarea',
    '#title' => t('Fields Hidden'),
    '#description' => t('List of form keys that should be hidden on password reset landing page. Put one per line.'),
    '#default_value' => variable_get('prlp_hidden_fields', PRLP_HIDDEN_FIELDS_DEFAULT),
  );
  $form['prlp']['prlp_hidden_account_fields'] = array(
    '#type' => 'textarea',
    '#title' => t('Account Fields Hidden'),
    '#description' => t("List of form sub-keys under 'account' key (e.g. 'mail', 'name' etc.) that should be hidden on password reset landing page. Put one per line."),
    '#default_value' => variable_get('prlp_hidden_account_fields', PRLP_HIDDEN_ACCOUNT_FIELDS_DEFAULT),
  );

  // Confirmation Message For New Users.
  $form['prlp']['prlp_confirmation_message_new_users'] = array(
    '#type' => 'textfield',
    '#title' => t('Confirmation Message For New Users'),
    '#description' => t('Confirmation message that will be shown to new users after they set their password.'),
    '#default_value' => variable_get('prlp_confirmation_message_new_users', t('Thank you for setting your password, the registration process has completed.')),
  );

  // Confirmation Message For Existing Users.
  $form['prlp']['prlp_confirmation_message_existing_users'] = array(
    '#type' => 'textfield',
    '#title' => t('Confirmation Message For Existing Users'),
    '#description' => t('Confirmation message that will be shown to existing users after they changed their password.'),
    '#default_value' => variable_get('prlp_confirmation_message_existing_users', t('Your new password has been saved.')),
  );
  $form = system_settings_form($form);
  $form['buttons']['reset'] = array(
    '#type' => 'submit',
    '#value' => t('Reset to defaults'),
    '#description' => t('Delete all configuration and reset to hard-coded default settings'),
    '#submit' => array(
      'prlp_admin_settings_reset',
    ),
  );
  return $form;
}