You are here

public function HttpAuthSettings::submitForm in HTTP Auth 8

Implements FormBuilder::submitForm().

Save the HTTP Auth Details to to the Drupal's config Table.

Overrides ConfigFormBase::submitForm

File

src/Form/HttpAuthSettings.php, line 104

Class

HttpAuthSettings
Provide settings page for applying Http Auth on your site.

Namespace

Drupal\http_auth\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $values = $form_state
    ->getValues();
  $this
    ->configFactory()
    ->getEditable('http_auth.settings')
    ->set('username', $values['username'])
    ->set('password', $values['password'])
    ->set('message', $values['message'])
    ->set('applicable', $values['applicable'])
    ->set('activate', $values['activate'])
    ->save();
  drupal_set_message($this
    ->t('Your Settings have been saved.'), 'status');
}