Exemple #1
0
 function ru_logout()
 {
     // Allow plugins to handle logout events
     Observer::notify('logout_requested');
     $username = AuthUser::getUserName();
     AuthUser::logout();
     Observer::notify('admin_after_logout', $username);
     redirect(get_url());
 }
 function logoutAction()
 {
     AuthUser::logout();
     header('location:index.php');
 }
 /**
  * Allows a user to logout.
  */
 function logout()
 {
     // CSRF checks
     if (isset($_GET['csrf_token'])) {
         $csrf_token = $_GET['csrf_token'];
         if (!SecureToken::validateToken($csrf_token, BASE_URL . 'login/logout')) {
             Flash::set('error', __('Invalid CSRF token found!'));
             redirect(get_url());
         }
     } else {
         Flash::set('error', __('No CSRF token found!'));
         redirect(get_url());
     }
     // Allow plugins to handle logout events
     Observer::notify('logout_requested');
     $username = AuthUser::getUserName();
     AuthUser::logout();
     // Also eat cookies that were set by JS for backend gui
     setcookie("expanded_rows", "", time() - 3600);
     setcookie("meta_tab", "", time() - 3600);
     setcookie("page_tab", "", time() - 3600);
     Observer::notify('admin_after_logout', $username);
     redirect(get_url());
 }
 public function logout($force = false)
 {
     if ($force === false) {
         $force = $this->isLoggedIn();
     }
     if ($force) {
         AuthUser::logout();
         $this->currentID = false;
         $this->currentUser = false;
         $this->currentRoles = false;
         return true;
     }
     $this->_error(__("The Logout function does only work for logged-in users!"));
     return false;
 }
Exemple #5
0
 /**
  * Allows a user to logout.
  */
 function logout()
 {
     $username = AuthUser::getUserName();
     AuthUser::logout();
     Observer::notify('admin_after_logout', $username);
     redirect(get_url());
 }
Exemple #6
0
 /**
  * Allows a user to logout.
  */
 function logout()
 {
     // CSRF checks
     if (isset($_GET['csrf_token'])) {
         $csrf_token = $_GET['csrf_token'];
         if (!SecureToken::validateToken($csrf_token, BASE_URL . 'login/logout')) {
             Flash::set('error', __('Invalid CSRF token found!'));
             redirect(get_url());
         }
     } else {
         Flash::set('error', __('No CSRF token found!'));
         redirect(get_url());
     }
     // Allow plugins to handle logout events
     Observer::notify('logout_requested');
     $username = AuthUser::getUserName();
     AuthUser::logout();
     Observer::notify('admin_after_logout', $username);
     redirect(get_url());
 }
Exemple #7
0
$_task = isset($_REQUEST['task']) ? $_REQUEST['task'] : '';
$login = isset($_REQUEST['login']) ? $_REQUEST['login'] : false;
$passwd = isset($_REQUEST['passwd']) ? $_REQUEST['passwd'] : false;
$action = isset($_REQUEST['login']) ? $_REQUEST['login'] : false;
if (!$auth->isLoggedIn()) {
    $auth->login($login, $passwd);
}
$utils = new Utils();
switch ($_action) {
    case 'submit':
        if ($auth->isLoggedIn()) {
            $utils->cosRedirect('index2.php');
        } else {
            $utils->cosRedirect('index.php', NO_LOGIN);
        }
        break;
    case 'login':
        if ($auth->isLoggedIn()) {
            $utils->cosRedirect('index2.php');
        } else {
            $smarty->assign('msg', $msg);
            $smarty->display('loginForm.tpl');
        }
        break;
    case 'logout':
        $auth->logout();
        $msg = "Sesión cerrada.";
        $smarty->assign('msg', $msg);
        $smarty->display('loginForm.tpl');
        break;
}
Exemple #8
0
<?php

/**
 * Created by PhpStorm.
 * User: Admin
 * Date: 23.02.2015
 * Time: 18:31
 */
session_start();
require_once __DIR__ . '/../models/AuthUser.php';
$UserObj = new AuthUser();
$UserObj->logout();
header('Location: ../index.php');
 function logout()
 {
     AuthUser::logout();
     redirect(get_url());
 }