From 4858b75385eaf390ac8600f8b49230869f9e855e Mon Sep 17 00:00:00 2001 From: Peter Rotich <peter@osticket.com> Date: Tue, 4 Feb 2014 00:05:33 +0000 Subject: [PATCH] Clear ticket locks on logout Remove any ticket locks staff has on logout. --- scp/logout.php | 62 +++++++++++++++++++++++++++----------------------- 1 file changed, 33 insertions(+), 29 deletions(-) diff --git a/scp/logout.php b/scp/logout.php index 4cf519d35..806e0afb1 100644 --- a/scp/logout.php +++ b/scp/logout.php @@ -1,29 +1,33 @@ -<?php -/********************************************************************* - logout.php - - Log out staff - Destroy the session and redirect to login.php - - Peter Rotich <peter@osticket.com> - Copyright (c) 2006-2013 osTicket - http://www.osticket.com - - Released under the GNU General Public License WITHOUT ANY WARRANTY. - See LICENSE.TXT for details. - - vim: expandtab sw=4 ts=4 sts=4: -**********************************************************************/ -require('staff.inc.php'); - -//Check token: Make sure the user actually clicked on the link to logout. -if(!$_GET['auth'] || !$ost->validateLinkToken($_GET['auth'])) - @header('Location: index.php'); - -$thisstaff->logOut(); -//Clear upgrader session on logout. -$_SESSION['ost_upgrader'] = null; - -@header('Location: login.php'); -require('login.php'); -?> +<?php +/********************************************************************* + logout.php + + Log out staff + Destroy the session and redirect to login.php + + Peter Rotich <peter@osticket.com> + Copyright (c) 2006-2013 osTicket + http://www.osticket.com + + Released under the GNU General Public License WITHOUT ANY WARRANTY. + See LICENSE.TXT for details. + + vim: expandtab sw=4 ts=4 sts=4: +**********************************************************************/ +require('staff.inc.php'); + +//Check token: Make sure the user actually clicked on the link to logout. +if(!$_GET['auth'] || !$ost->validateLinkToken($_GET['auth'])) + @header('Location: index.php'); + +$thisstaff->logOut(); + +//Clear any ticket locks the staff has. +TicketLock::removeStaffLocks($thisstaff->getId()); + +//Clear upgrader session on logout. +$_SESSION['ost_upgrader'] = null; + +@header('Location: login.php'); +require('login.php'); +?> -- GitLab