You are here

public function SecuresiteManager::dialogPage in Secure Site 8

Display fall-back HTML for HTTP authentication dialogs. Safari will not load this. Opera will not load this after log-out unless the page has been reloaded and the authentication dialog has been displayed twice.

2 calls to SecuresiteManager::dialogPage()
SecuresiteManager::denied in src/SecuresiteManager.php
Deny access to users who are not authorized to access secured pages.
SecuresiteManager::showDialog in src/SecuresiteManager.php

File

src/SecuresiteManager.php, line 504
Contains \Drupal\securesite\SecuresiteManager.

Class

SecuresiteManager

Namespace

Drupal\securesite

Code

public function dialogPage() {
  $formBuilder = \Drupal::formBuilder();
  $reset = \Drupal::config('securesite.settings')
    ->get('securesite_reset_form');
  if (in_array(SECURESITE_FORM, \Drupal::config('securesite.settings')
    ->get('securesite_type'))) {
    $user_login = $formBuilder
      ->getForm('Drupal\\securesite\\Form\\SecuresiteLoginForm');
    $output = render($user_login);
    if (!empty($reset)) {
      $user_pass = $formBuilder
        ->getForm('Drupal\\user\\Form\\UserPasswordForm');
      $output .= "<hr />\n" . render($user_pass);
    }
  }
  else {
    if (!empty($reset)) {
      $user_pass = $formBuilder
        ->getForm('securesite_user_pass');
      $output = render($user_pass);
    }
    else {
      $output = '<p>' . t('Reload the page to try logging in again.') . '</p>';
    }
  }
  $output = SafeMarkup::set($output);
  return $output;
}