mirror of https://github.com/jacekkow/uphpCAS

Jacek Kowalski
2015-08-20 fc49b895ef2e38bbc820b3eda503a8afdbaabe44
Add isAuthenticated() method to check whether user is already logged in
1 files modified
6 ■■■■ changed files
uphpCAS.php 6 ●●●● patch | view | raw | blame | history
uphpCAS.php
@@ -71,9 +71,13 @@
        die();
    }
    
    public function isAuthenticated() {
        return isset($_SESSION['uphpCAS-user']);
    }
    public function authenticate() {
        session_start();
        if(isset($_SESSION['uphpCAS-user'])) {
        if($this->isAuthenticated()) {
            return $_SESSION['uphpCAS-user'];
        } elseif(isset($_REQUEST['ticket'])) {
            $user = $this->verifyTicket($_REQUEST['ticket']);