phpCAS::isSessionAuthenticated PHP Méthode

isSessionAuthenticated() public static méthode

Checks whether authenticated based on $_SESSION. Useful to avoid server calls.
Since: 0.4.22 by Brendan Arnold
public static isSessionAuthenticated ( ) : boolean
Résultat boolean true if authenticated, false otherwise.
    public static function isSessionAuthenticated()
    {
        phpCAS::_validateClientExists();
        return self::$_PHPCAS_CLIENT->isSessionAuthenticated();
    }

Usage Example

Exemple #1
0
function authCAS($config)
{
    require_once dirname(__FILE__) . '/CAS/CAS.php';
    // get module configuration
    $cas_validate = true;
    $cas_version = CAS_VERSION_2_0;
    $cas_language = 'english';
    //    phpCAS::setDebug();
    phpCAS::client($cas_version, $config->cashostname, (int) $config->casport, $config->casbaseuri, false);
    phpCAS::setLang($cas_language);
    error_log("CAS: Entering");
    $check = phpCAS::isSessionAuthenticated();
    phpCAS::forceAuthentication();
    $NetUsername = phpCAS::getUser();
    //this stores their network user id
    error_log("CAS: Exiting {$NetUsername}");
    return $NetUsername;
}
All Usage Examples Of phpCAS::isSessionAuthenticated