Including security review as a submodule - with patched for Yaffs.
[yaffs-website] / web / modules / contrib / security_review / src / CheckSettings / TrustedHostSettings.php
1 <?php
2
3 /**
4  * @file
5  * Contains \Drupal\security_review\CheckSettings\TrustedHostSettings.
6  */
7
8 namespace Drupal\security_review\CheckSettings;
9
10 use Drupal\security_review\CheckSettings;
11
12 /**
13  * Provides the settings form for the TrustedHosts check.
14  */
15 class TrustedHostSettings extends CheckSettings {
16
17   /**
18    * {@inheritdoc}
19    */
20   public function buildForm() {
21     $form = [];
22     $form['method'] = [
23       '#type' => 'radios',
24       '#title' => t('Check method'),
25       '#description' => t('Detecting the $base_url in settings.php can be done via PHP tokenization (recommended) or including the file. Note that if you have custom functionality in your settings.php it will be executed if the file is included. Including the file can result in a more accurate $base_url check if you wrap the setting in conditional statements.'),
26       '#options' => [
27         'token' => t('Tokenize settings.php (recommended)'),
28         'include' => t('Include settings.php'),
29       ],
30       '#default_value' => $this->get('method', 'token'),
31     ];
32
33     return $form;
34   }
35
36   /**
37    * {@inheritdoc}
38    */
39   public function submitForm(array &$form, array $values) {
40     $this->set('method', $values['method']);
41   }
42
43 }