You are here

function simple_ldap_sso_detect_sid in Simple LDAP 7.2

Same name and namespace in other branches
  1. 7 simple_ldap_sso/simple_ldap_sso.inc \simple_ldap_sso_detect_sid()

Detects an existing session from another site.

1 call to simple_ldap_sso_detect_sid()
simple_ldap_sso.session.inc in simple_ldap_sso/simple_ldap_sso.session.inc

File

simple_ldap_sso/simple_ldap_sso.inc, line 81
Simple LDAP SSO API functions.

Code

function simple_ldap_sso_detect_sid() {

  // First, check that the module is configured.
  if (simple_ldap_sso_configured() && isset($_COOKIE[session_name()]) && isset($_COOKIE[SIMPLE_LDAP_SSO_COOKIE]) && !simple_ldap_sso_session_exists()) {

    // Then attempt to populate the session based on the SSO Cookie. If this
    // fails, delete the cookie.
    if (!simple_ldap_sso_populate_session()) {
      simple_ldap_sso_delete_cookie();
      $message = 'Possible break-in attempt detected.';
      $t_args = array();
      watchdog(__FUNCTION__, $message, $t_args, WATCHDOG_ALERT);
    }
  }
}