Beispiel #1
0
    .feedback.info { 
        color: #00529B; 
        background-color: #BDE5F8; 
    } 
</style> 
<?php 
use WebSupportDK\PHPSecurity\Session;
// echo out positive messages
if (Session::exists('SUCCESS')) {
    foreach ((array) Session::flash('SUCCESS') as $feedback) {
        echo '<div  class="feedback success">' . $feedback . '</div>';
    }
}
// echo out negative messages
if (Session::exists('ERRORS')) {
    foreach ((array) Session::flash('ERRORS') as $feedback) {
        echo '<div class="feedback error">' . $feedback . '</div>';
    }
}
// echo out warning messages
if (Session::exists('WARNINGS')) {
    foreach ((array) Session::flash('WARNINGS') as $feedback) {
        echo '<div class="feedback warning">' . $feedback . '</div>';
    }
}
// echo out info messages
if (Session::exists('INFO')) {
    foreach ((array) Session::flash('INFO') as $feedback) {
        echo '<div class="feedback info">' . $feedback . '</div>';
    }
}
 private function checkSession()
 {
     if (Session::exists($this->sessionName)) {
         $user_timeout = Session::getKey($this->sessionName, 'Timeout');
         if (time() - $user_timeout > $this->timeout) {
             if ($this->search(Session::getKey($this->sessionName, 'ID'))) {
                 $this->updateTimeout();
                 $this->isLoggedIn = true;
                 return true;
             } else {
                 $this->logout();
                 return false;
             }
         }
         $this->isLoggedIn = true;
         return true;
     }
 }