class TrustedHostSettings in Security Review 8
Provides the settings form for the TrustedHosts check.
Hierarchy
- class \Drupal\security_review\CheckSettings implements CheckSettingsInterface
- class \Drupal\security_review\CheckSettings\TrustedHostSettings
Expanded class hierarchy of TrustedHostSettings
1 file declares its use of TrustedHostSettings
- TrustedHosts.php in src/
Checks/ TrustedHosts.php
File
- src/
CheckSettings/ TrustedHostSettings.php, line 10
Namespace
Drupal\security_review\CheckSettingsView source
class TrustedHostSettings extends CheckSettings {
/**
* {@inheritdoc}
*/
public function buildForm() {
$form = [];
$form['method'] = [
'#type' => 'radios',
'#title' => t('Check method'),
'#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.'),
'#options' => [
'token' => t('Tokenize settings.php (recommended)'),
'include' => t('Include settings.php'),
],
'#default_value' => $this
->get('method', 'token'),
];
return $form;
}
/**
* {@inheritdoc}
*/
public function submitForm(array &$form, array $values) {
$this
->set('method', $values['method']);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CheckSettings:: |
protected | property | The parent check. | |
CheckSettings:: |
protected | property | The configuration storage of the parent Check. | |
CheckSettings:: |
public | function |
Gets a check-specific setting value identified by $key. Overrides CheckSettingsInterface:: |
|
CheckSettings:: |
public | function |
Sets a check-specific setting value identified by $key. Overrides CheckSettingsInterface:: |
|
CheckSettings:: |
public | function |
Form validation handler. Overrides CheckSettingsInterface:: |
|
CheckSettings:: |
public | function | Creates a CheckSettings instance. | |
TrustedHostSettings:: |
public | function |
Form constructor. Overrides CheckSettings:: |
|
TrustedHostSettings:: |
public | function |
Form submission handler. Overrides CheckSettings:: |