Instead of showing $config['error']['malformed'] on corrupt session, just go straight to the login form

This commit is contained in:
Michael Save 2013-01-30 04:45:38 +11:00
parent 45f9b51ad8
commit 5661e32b1c
2 changed files with 6 additions and 3 deletions

View File

@ -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(

View File

@ -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()) {