You are here

function securelogin_admin in Secure Login 5

Same name and namespace in other branches
  1. 6 securelogin.module \securelogin_admin()
  2. 7 securelogin.admin.inc \securelogin_admin()

Admin form

1 string reference to 'securelogin_admin'
securelogin_menu in ./securelogin.module
Menus

File

./securelogin.module, line 45

Code

function securelogin_admin() {
  global $base_url;
  $form['securelogin_baseurl'] = array(
    '#type' => 'textfield',
    '#title' => t("Base URL for secure pages"),
    '#default_value' => variable_get('securelogin_baseurl', preg_replace('@^http://@', 'https://', $base_url)),
    '#description' => t("The base URL for secure pages.  For example, <code>" . preg_replace('@^http://@', 'https://', $base_url) . "</code>.  Note that in order for cookies to work, the hostnames in the secure base URL and the unsecure base URL must be in the same domain as per the appropriate setting in <code>settings.php</code>, which you may need to modify."),
  );
  $form['securelogin_redirect'] = array(
    '#type' => 'checkbox',
    '#title' => t("Redirect to original location"),
    '#default_value' => variable_get('securelogin_redirect', TRUE),
    '#description' => t("Users that log in from an address other than the secure URL specified above will be redirected to the original site after logging in when this option is enabled.  Note that an eror will be produced if this is enabled and the hostname above does not match the original hostname."),
  );
  $form['securelogin_original_baseurl'] = array(
    '#type' => 'textfield',
    '#title' => t("Base URL for insecure secure pages"),
    '#default_value' => variable_get('securelogin_original_baseurl', preg_replace('@^https://@', 'http://', $base_url)),
    '#description' => t("The base URL for insecure pages.  For example, <code>" . preg_replace('@^https://@', 'http://', $base_url) . "</code>.  Note that in order for cookies to work, the hostnames in the secure base URL and the unsecure base URL must be in the same domain as per the appropriate setting in <code>settings.php</code>, which you may need to modify."),
  );
  $form['securelogin_secure_forms'] = array(
    '#type' => 'checkbox',
    '#title' => 'Secure form pages',
    '#default_value' => variable_get('securelogin_secure_forms', FALSE),
    '#description' => t("If enabled, form pages will also be secured.  This is mostly for cosmetic effect, to reassure users that the form they are about to submit is secure."),
  );
  $form['securelogin_loginform'] = array(
    '#type' => 'checkbox',
    '#title' => t("Secure login form"),
    '#default_value' => variable_get('securelogin_loginform', TRUE),
    '#description' => t("Whether or not to secure the login forms."),
  );
  $form['securelogin_editform'] = array(
    '#type' => 'checkbox',
    '#title' => t("Secure user edit form"),
    '#default_value' => variable_get('securelogin_editform', TRUE),
    '#description' => t("Whether or not to secure the user edit form."),
  );
  $form['securelogin_registerform'] = array(
    '#type' => 'checkbox',
    '#title' => t("Secure user registration form"),
    '#default_value' => variable_get('securelogin_registerform', TRUE),
    '#description' => t("Whether or not to secure the new user registration form.  You may want to turn this off if new users get their passwords by email, but this will mean that creating users as an administrator will be insecure."),
  );
  return system_settings_form($form);
}