You are here

public function SecuresiteManager::getFakeRealm in Secure Site 8

Opera and Internet Explorer save credentials indefinitely and will keep attempting to use them even when they have failed multiple times. We add a random string to the realm to allow users to log out.

2 calls to SecuresiteManager::getFakeRealm()
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 553
Contains \Drupal\securesite\SecuresiteManager.

Class

SecuresiteManager

Namespace

Drupal\securesite

Code

public function getFakeRealm() {
  $realm = \Drupal::config('securesite.settings')
    ->get('securesite_realm');
  $user_agent = drupal_strtolower($this->request->server
    ->get('HTTP_USER_AGENT', ''));
  if ($user_agent != str_replace(array(
    'msie',
    'opera',
  ), '', $user_agent)) {
    $realm .= ' - ' . mt_rand(10, 999);
  }
  return $realm;
}