public static checkAuthentication ( ) : true | ||
return | true | when the user is authenticated, false when a previous gateway login failed or the function will not return if the user is redirected to the cas server for a gateway login attempt |
public static function checkAuthentication()
{
phpCAS::traceBegin();
phpCAS::_validateClientExists();
$auth = self::$_PHPCAS_CLIENT->checkAuthentication();
// store where the authentication has been checked and the result
self::$_PHPCAS_CLIENT->markAuthenticationCall($auth);
phpCAS::traceEnd($auth);
return $auth;
}
/** * Logs the user out / destroys the CAS session */ public function index() { if (\phpCAS::checkAuthentication()) { \phpCAS::logout(); } session_destroy(); header("Location: /landing"); return; }