From 09cbba9ac61d43a4a80eb4d52c5ba2f59c5966b2 Mon Sep 17 00:00:00 2001 From: flashwave Date: Fri, 17 Apr 2015 22:51:53 +0000 Subject: [PATCH] Electric Boogaloo 2: Logout update --- _sakura/components/Sessions.php | 4 +- _sakura/components/Users.php | 2 +- _sakura/sakura.php | 2 +- _sakura/templates/yuuno/global/header.tpl | 8 +- main/.htaccess | 2 +- main/authenticate.php | 123 +++++++++++++++------- 6 files changed, 96 insertions(+), 45 deletions(-) diff --git a/_sakura/components/Sessions.php b/_sakura/components/Sessions.php index 0798257..f10a7b3 100644 --- a/_sakura/components/Sessions.php +++ b/_sakura/components/Sessions.php @@ -38,7 +38,7 @@ class Session { 'skey' => $session, 'started' => time(), 'expire' => time() + 604800, - 'remember' => $remember + 'remember' => $remember ? '1' : '0' ]); // Return the session key @@ -86,7 +86,7 @@ class Session { return false; // Run the query - Database::delete('sessions', [($key ? 'skey' : 'id'), [$sessionId, '=']]); + Database::delete('sessions', [($key ? 'skey' : 'id') => [$sessionId, '=']]); // Return true if key was found and deleted return true; diff --git a/_sakura/components/Users.php b/_sakura/components/Users.php index 6b4b527..d6df503 100644 --- a/_sakura/components/Users.php +++ b/_sakura/components/Users.php @@ -126,7 +126,7 @@ class Users { return false; // Remove the active session from the database - if(!Session::deleteSession($id, true)) + if(!Session::deleteSession(Session::$sessionId, true)) return false; // Set cookies diff --git a/_sakura/sakura.php b/_sakura/sakura.php index 7a5b02a..70ba4ae 100644 --- a/_sakura/sakura.php +++ b/_sakura/sakura.php @@ -54,7 +54,7 @@ $renderData = array( 'version' => SAKURA_VERSION, 'urls' => Configuration::getLocalConfig('urls'), 'charset' => Configuration::getConfig('charset'), - 'currentpage' => $_SERVER['PHP_SELF'], + 'currentpage' => '//'. $_SERVER['SERVER_NAME'] . $_SERVER['PHP_SELF'], 'recaptcha_public' => Configuration::getConfig('recaptcha_public'), 'resources' => '//'. Configuration::getLocalConfig('urls')['content'] .'/data/'. strtolower(Templates::$_TPL) ], diff --git a/_sakura/templates/yuuno/global/header.tpl b/_sakura/templates/yuuno/global/header.tpl index d784648..064d67d 100644 --- a/_sakura/templates/yuuno/global/header.tpl +++ b/_sakura/templates/yuuno/global/header.tpl @@ -55,8 +55,12 @@