mirror of
https://github.com/vichan-devel/vichan.git
synced 2024-11-29 01:34:31 +01:00
Merge branch 'master' of https://github.com/savetheinternet/Tinyboard
This commit is contained in:
commit
6c431d2dae
@ -49,7 +49,7 @@ function login($username, $password, $makehash=true) {
|
||||
'username' => $username,
|
||||
'hash' => mkhash($username, $password),
|
||||
'boards' => explode(',', $user['boards'])
|
||||
);
|
||||
);
|
||||
} else return false;
|
||||
}
|
||||
|
||||
@ -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']);
|
||||
|
@ -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,7 +49,10 @@ function mod_login() {
|
||||
// Set cookies
|
||||
setCookies();
|
||||
|
||||
header('Location: ?/', true, $config['redirect_http']);
|
||||
if ($redirect)
|
||||
header('Location: ?' . $redirect, true, $config['redirect_http']);
|
||||
else
|
||||
header('Location: ?/', true, $config['redirect_http']);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user