function _securesite_fake_realm in Secure Site 7.2
Same name and namespace in other branches
- 6.2 securesite.inc \_securesite_fake_realm()
 
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.
6 calls to _securesite_fake_realm()
- SecureSiteFunctionFakeRealmUnitTest::setUp in ./
securesite.test  - Sets up a Drupal site for running functional and integration tests.
 - SecureSiteFunctionFakeRealmUnitTest::testSecureSiteFunctionFakeRealmMSIE in ./
securesite.test  - Check realm with Internet Explorer.
 - SecureSiteFunctionFakeRealmUnitTest::testSecureSiteFunctionFakeRealmNormal in ./
securesite.test  - Check realm with normal browser.
 - SecureSiteFunctionFakeRealmUnitTest::testSecureSiteFunctionFakeRealmOpera in ./
securesite.test  - Check realm with Opera.
 - _securesite_denied in ./
securesite.inc  - Deny access to users who are not authorized to access secured pages.
 
File
- ./
securesite.inc, line 431  - Secure Site log-in functions.
 
Code
function _securesite_fake_realm() {
  $realm = variable_get('securesite_realm', variable_get('site_name', 'Drupal'));
  $user_agent = isset($_SERVER['HTTP_USER_AGENT']) ? drupal_strtolower($_SERVER['HTTP_USER_AGENT']) : '';
  if ($user_agent != str_replace(array(
    'msie',
    'opera',
  ), '', $user_agent)) {
    $realm .= ' - ' . mt_rand(10, 999);
  }
  return $realm;
}