Marcin Łabanowski 11 years ago
parent
commit
b4efebae55
  1. 2
      inc/mod/auth.php
  2. 5
      inc/mod/pages.php
  3. 2
      mod.php

2
inc/mod/auth.php

@ -108,7 +108,7 @@ if (isset($_COOKIE[$config['cookies']['mod']])) {
$user = $query->fetch();
// validate password hash
if ($cookie[1] != mkhash($cookie[0], $user['password'], $cookie[2])) {
if ($cookie[1] !== mkhash($cookie[0], $user['password'], $cookie[2])) {
// Malformed cookies
destroyCookies();
error($config['error']['malformed']);

5
inc/mod/pages.php

@ -28,7 +28,7 @@ function mod_page($title, $template, $args, $subtitle = false) {
);
}
function mod_login() {
function mod_login($redirect = false) {
global $config;
$args = array();
@ -49,6 +49,9 @@ function mod_login() {
// Set cookies
setCookies();
if ($redirect)
header('Location: ?' . $redirect, true, $config['redirect_http']);
else
header('Location: ?/', true, $config['redirect_http']);
}
}

2
mod.php

@ -91,7 +91,7 @@ $pages = array(
if (!$mod) {
$pages = array('!!' => 'login');
$pages = array('!^(.+)?$!' => 'login');
} elseif (isset($_GET['status'], $_GET['r'])) {
header('Location: ' . $_GET['r'], true, (int)$_GET['status']);
exit;

Loading…
Cancel
Save