CAS_Client::markAuthenticationCall PHP Метод

markAuthenticationCall() публичный Метод

Mark the caller of authentication. This will help client integraters determine problems with their code flow if they call a function such as getUser() before authentication has occurred.
public markAuthenticationCall ( boolean $auth ) : null
$auth boolean True if authentication was successful, false otherwise.
Результат null
    public function markAuthenticationCall($auth)
    {
        // store where the authentication has been checked and the result
        $dbg = debug_backtrace();
        $this->_authentication_caller = array('file' => $dbg[1]['file'], 'line' => $dbg[1]['line'], 'method' => $dbg[1]['class'] . '::' . $dbg[1]['function'], 'result' => (bool) $auth);
    }

Usage Example

Пример #1
0
 /**
  * This method is called to check if the user is authenticated (previously or by
  * tickets given in the URL).
  *
  * @return true when the user is authenticated.
  */
 public static function isAuthenticated()
 {
     phpCAS::traceBegin();
     phpCAS::_validateClientExists();
     // call the isAuthenticated method of the $_PHPCAS_CLIENT object
     $auth = self::$_PHPCAS_CLIENT->isAuthenticated();
     // store where the authentication has been checked and the result
     self::$_PHPCAS_CLIENT->markAuthenticationCall($auth);
     phpCAS::traceEnd($auth);
     return $auth;
 }
CAS_Client