/**
* This method is called to check if the user is already authenticated
* locally or has a global cas session. A already existing cas session is
* determined by a cas gateway call.(cas login call without any interactive
* prompt)
*
* @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;
}