From 5661e32b1ce977d4fe98b73f468bdf5695464c56 Mon Sep 17 00:00:00 2001 From: Michael Save Date: Wed, 30 Jan 2013 04:45:38 +1100 Subject: [PATCH] Instead of showing $config['error']['malformed'] on corrupt session, just go straight to the login form --- inc/mod/auth.php | 7 +++++-- mod.php | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/inc/mod/auth.php b/inc/mod/auth.php index 8fb01ecb..b3b23553 100644 --- a/inc/mod/auth.php +++ b/inc/mod/auth.php @@ -98,8 +98,10 @@ if (isset($_COOKIE[$config['cookies']['mod']])) { // Should be username:hash:salt $cookie = explode(':', $_COOKIE[$config['cookies']['mod']]); if (count($cookie) != 3) { + // Malformed cookies destroyCookies(); - error($config['error']['malformed']); + // error($config['error']['malformed']); + mod_login(); } $query = prepare("SELECT `id`, `type`, `boards`, `password` FROM `mods` WHERE `username` = :username LIMIT 1"); @@ -111,7 +113,8 @@ if (isset($_COOKIE[$config['cookies']['mod']])) { if ($cookie[1] !== mkhash($cookie[0], $user['password'], $cookie[2])) { // Malformed cookies destroyCookies(); - error($config['error']['malformed']); + // error($config['error']['malformed']); + mod_login(); } $mod = array( diff --git a/mod.php b/mod.php index a51f4bcd..8045cf47 100644 --- a/mod.php +++ b/mod.php @@ -5,8 +5,8 @@ */ require 'inc/functions.php'; -require 'inc/mod/auth.php'; require 'inc/mod/pages.php'; +require 'inc/mod/auth.php'; // Fix for magic quotes if (get_magic_quotes_gpc()) {