Exemplo n.º 1
0
function logout()
{
    session_destroy();
    session_start();
    $_SESSION['auth'] = array("logged" => False, "login_utc" => "", "cas_url" => Cas::getUrl());
    return is_logged();
}
Exemplo n.º 2
0
function register_login()
{
    global $_CONFIG;
    // Déclaration de la variable étant globale
    session_destroy();
    session_start();
    if (!isset($_GET["ticket"])) {
        header('Location: ' . $_CONFIG['cas_url'] . 'login?service=' . $_CONFIG['service']);
    } else {
        $ticket = $_GET["ticket"];
        $service = $_CONFIG['service'];
        $login = Cas::authenticate($ticket, $service);
        if ($login == -1) {
            $_SESSION['auth'] = array("logged" => False, "login_utc" => "", "cas_url" => Cas::getUrl());
            echo $_CONFIG['cas_url'] . 'login?service=' . $_CONFIG['service'];
        } else {
            $_SESSION['auth'] = array("logged" => True, "login_utc" => $login, "cas_url" => Cas::getUrl());
        }
    }
}