Skip to content
Snippets Groups Projects
Commit 8bca400b authored by Peter Rotich's avatar Peter Rotich
Browse files

Drop global signal idea for a simple life, man!

No need to execute signal connect for each request!
parent 80a12099
No related branches found
No related tags found
No related merge requests found
......@@ -48,20 +48,6 @@ class Bootstrap {
$_SERVER['REMOTE_ADDR'] = '';
}
/*
* Glue to global signals we're interested in
*/
static function signals() {
//Clear upgrader session on logout.
Signal::connect('auth.logout', function ($user, $data=null) {
if (!$user) return;
if ($user instanceof Staff)
$_SESSION['ost_upgrader'] = null;
});
}
function https() {
return
(isset($_SERVER['HTTPS'])
......
......@@ -26,7 +26,6 @@ Bootstrap::defineTables(TABLE_PREFIX);
Bootstrap::i18n_prep();
Bootstrap::loadCode();
Bootstrap::connect();
Bootstrap::signals();
if(!($ost=osTicket::start()) || !($cfg = $ost->getConfig()))
Bootstrap::croak('Unable to load config info from DB. Get tech support.');
......
......@@ -15,11 +15,15 @@
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');
?>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment