Exemplo n.º 1
0
 public function logout()
 {
     Session::createSession();
     Session::destroySession();
     Session::unsetAll();
     $this->view->load('admin/login');
 }
Exemplo n.º 2
0
 public static function checkToken($token)
 {
     $tokenName = Session::getToken('tokenName');
     //var_dump($tokenName);
     if ($tokenName === $token) {
         Session::destroySession('tokenName');
         return true;
     }
     return false;
 }
Exemplo n.º 3
0
 public function execute(Request $request, Session $session, $view)
 {
     $this->addMeta('Content-Type', 'text/html; charset=UTF-8');
     // include css stylesheets
     $this->addCss('styles/styles.css');
     $this->addCss('styles/menu.css');
     $this->addCss('styles/table_style.css');
     $request->setParameter('controller', 'Login');
     $session->destroySession();
     return $view;
 }
Exemplo n.º 4
0
 public function loader()
 {
     /*         * * check the route ** */
     $this->getController();
     $this->getAction();
     $loggedin = $this->cek_session();
     if (!$loggedin && !$this->controller instanceof AuthController && $this->method != 'index') {
         Session::createSession();
         Session::destroySession();
         Session::unsetAll();
         $this->controller = new AuthController($this->registry);
         $this->method = 'index';
     }
     //echo $this->role.",".$this->url[0].",".$this->method;
     //var_dump($this->registry->auth->is_allowed($this->role,$this->url[0],$this->method));
     if (!$this->registry->auth->is_allowed($this->role, $this->url[0], $this->method) && $this->role != 'guest') {
         $this->controller = new Index($this->registry);
         $this->method = 'index';
     } else {
         if (!$this->registry->auth->is_allowed($this->role, $this->url[0], $this->method) && $this->role == 'guest') {
             $this->controller = new AuthController($this->registry);
             $this->method = 'index';
         }
     }
     /*         * * check if the action is callable ** */
     if (is_callable(array($this->controller, $this->method)) == false) {
         $action = 'index';
     } else {
         $action = $this->method;
     }
     /*         * * load arguments for action ** */
     $arguments = array();
     $i = 0;
     //        var_dump($this->url);
     foreach ($this->url as $key => $val) {
         if ($i > 1) {
             $arguments[] = $val;
             //                var_dump($arguments);
             //                $i++;
         }
         $i++;
     }
     Session::sessionUpdated();
     if ($i > 1) {
         call_user_func_array(array($this->controller, $action), $arguments);
     } else {
         call_user_func(array($this->controller, $action), $arguments);
     }
 }
Exemplo n.º 5
0
<?php

Session::destroySession();
Session::setSuccess('You have been successfully logged out.');
// Redirect to homepage
Session::redirect('/login');
<?php

require '../domain/Session.php';
$mysession = new Session();
$mysession->initSession();
//ANTI CSRF
if (isset($_GET["csrf"]) && $_GET["csrf"] == $_SESSION["token"]) {
    $_SESSION = array();
    $mysession->destroySession();
} else {
    $mysession->destroySession();
    header('location: ../../index.php?error=6');
    exit;
}
header('location: ../../index.php');
exit;
Exemplo n.º 7
0
 function logout()
 {
     Session::destroySession();
     redirectUrl(SP_WEBPATH . "/login.php");
 }
Exemplo n.º 8
0
 public function logout()
 {
     //$this->model->logout();
     //Session::unsetAll();
     Session::createSession();
     $log = new Log();
     $log->addLog(Session::get('user'), 'LOGOUT', '');
     unset($log);
     Session::destroySession();
     //session_destroy();
     header('location:' . URL . 'login');
     exit;
 }
Exemplo n.º 9
0
 /**
  * Function for user to Log-out.
  * @param \phpsec\User $userObj     The user object of the user that needs to log out
  */
 public static function logOut($userObj)
 {
     if ($userObj->checkRememberMe() === $userObj->getUserID()) {
         User::deleteAuthenticationToken();
         //delete the authentication token from the server and the user's browser
     }
     if (file_exists(__DIR__ . "/../session/session.php")) {
         require_once __DIR__ . "/../session/session.php";
         //If session library is present, then delete session from the server as well as user's browser
         $tempSession = new Session();
         $tempSession->existingSession();
         $tempSession->destroySession();
     }
 }
Exemplo n.º 10
0
 public function logoutUser()
 {
     Session::destroySession();
 }
Exemplo n.º 11
0
 public function LogOut()
 {
     Session::destroySession();
     Router::redirect(DEFAULT_PATH);
 }
Exemplo n.º 12
0
<?php

include 'classes/Session.php';
$session = new Session();
$session->destroySession();
?>
<!DOCTYPE html>
<html lang="en-us">
<meta charset="utf-8" />
<head>
<title>Accurity Valuation</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/png" sizes="16x16" href="css/images/favicon-32x32.png">
<link rel="stylesheet" href="css/login.css">
</head>
<body>

<div class="msg">
<?php 
if (isset($_SESSION['login-error'])) {
    echo $_SESSION['login-error'];
    unset($_SESSION['login-error']);
}
?>
<div class="success message" <?php 
if (!isset($_REQUEST['msg'])) {
    ?>
style="display:none;"<?php 
}
?>
>