You are here

function securepages_settings in Secure Pages 6

Same name and namespace in other branches
  1. 8 securepages.admin.inc \securepages_settings()
  2. 5 securepages.module \securepages_settings()
  3. 6.2 securepages.admin.inc \securepages_settings()
  4. 7 securepages.admin.inc \securepages_settings()

Implementation of hook_settings().

1 string reference to 'securepages_settings'
securepages_menu in ./securepages.module
Implementation of hook_menu().

File

./securepages.admin.inc, line 11
Provide all the administration pages

Code

function securepages_settings() {
  $form = array();
  $form['securepages_enable'] = array(
    '#type' => 'radios',
    '#title' => t('Enable Secure Pages'),
    '#default_value' => variable_get('securepages_enable', 0),
    '#options' => array(
      t('Disabled'),
      t('Enabled'),
    ),
    '#disabled' => !securepages_test(),
    '#description' => t('To start using secure pages this setting must be enabled. This setting will only be able to changed when the web server has been configured for SSL.<br />If this test has failed then go <a href="!url">here</a>', array(
      '!url' => preg_replace(';^http://;i', 'https://', url($_GET['q'], array(
        'absolute' => TRUE,
      ))),
    )),
  );
  $form['securepages_switch'] = array(
    '#type' => 'checkbox',
    '#title' => t('Switch back to http pages when there are no matches'),
    '#return_value' => TRUE,
    '#default_value' => variable_get('securepages_switch', FALSE),
  );
  $form['securepages_basepath'] = array(
    '#type' => 'textfield',
    '#title' => t('Non-secure Base URL'),
    '#default_value' => variable_get('securepages_basepath', ''),
  );
  $form['securepages_basepath_ssl'] = array(
    '#type' => 'textfield',
    '#title' => t('Secure Base URL'),
    '#default_value' => variable_get('securepages_basepath_ssl', ''),
  );
  $form['securepages_secure'] = array(
    '#type' => 'radios',
    '#title' => t('Pages which will be be secure'),
    '#default_value' => variable_get('securepages_secure', 1),
    '#options' => array(
      t('Make secure every page except the listed pages.'),
      t('Make secure only the listed pages.'),
    ),
  );
  $form['securepages_pages'] = array(
    '#type' => 'textarea',
    '#title' => t('Pages'),
    '#default_value' => variable_get('securepages_pages', "node/add*\nnode/*/edit\nuser\nuser/*\nadmin\nadmin/*"),
    '#cols' => 40,
    '#rows' => 5,
    '#description' => t("Enter one page per line as Drupal paths. The '*' character is a wildcard. Example paths are '<em>blog</em>' for the main blog page and '<em>blog/*</em>' for every personal blog. '<em>&lt;front&gt;</em>' is the front page."),
    '#wysiwyg' => FALSE,
  );
  $form['securepages_ignore'] = array(
    '#type' => 'textarea',
    '#title' => t('Ignore pages'),
    '#default_value' => variable_get('securepages_ignore', ''),
    '#cols' => 40,
    '#rows' => 5,
    '#description' => t("The pages listed here will be ignored and be either returned in http or https. Enter one page per line as Drupal paths. The '*' character is a wildcard. Example paths are '<em>blog</em>' for the blog page and '<em>blog/*</em>' for every personal blog. '<em>&lt;front&gt;</em>' is the front page."),
    '#wysiwyg' => FALSE,
  );
  return system_settings_form($form);
}