You are here

function securesite_form_system_site_information_settings_alter in Secure Site 8

Same name and namespace in other branches
  1. 7.2 securesite.module \securesite_form_system_site_information_settings_alter()

Implements hook_form_FORM_ID_alter().

File

./securesite.module, line 82
Enables HTTP authentication or an HTML form to restrict site access.

Code

function securesite_form_system_site_information_settings_alter(&$form, $form_state) {
  if (\Drupal::config('securesite.settings')
    ->get('securesite_enabled') == SECURESITE_403) {
    $form['error_page']['securesite_403'] = $form['error_page']['site_403'];
    $form['error_page']['securesite_403']['#default_value'] = \Drupal::config('securesite.settings')
      ->get('securesite_403');
    $form['error_page']['securesite_403']['#weight'] = 0;
    unset($form['error_page']['site_403']);
  }
}