forked from leftypol/leftypol
auth.php: pass context to mod_login
This commit is contained in:
parent
7ef2d42bb0
commit
4197b5a376
1 changed files with 4 additions and 3 deletions
|
@ -4,6 +4,7 @@
|
|||
* Copyright (c) 2010-2013 Tinyboard Development Group
|
||||
*/
|
||||
|
||||
use Vichan\Context;
|
||||
use Vichan\Functions\Net;
|
||||
|
||||
defined('TINYBOARD') or exit;
|
||||
|
@ -177,7 +178,7 @@ function make_secure_link_token($uri) {
|
|||
return substr(sha1($config['cookies']['salt'] . '-' . $uri . '-' . $mod['id']), 0, 8);
|
||||
}
|
||||
|
||||
function check_login($prompt = false) {
|
||||
function check_login(Context $ctx, $prompt = false) {
|
||||
global $config, $mod;
|
||||
|
||||
// Validate session
|
||||
|
@ -187,7 +188,7 @@ function check_login($prompt = false) {
|
|||
if (count($cookie) != 3) {
|
||||
// Malformed cookies
|
||||
destroyCookies();
|
||||
if ($prompt) mod_login();
|
||||
if ($prompt) mod_login($ctx);
|
||||
exit;
|
||||
}
|
||||
|
||||
|
@ -200,7 +201,7 @@ function check_login($prompt = false) {
|
|||
if ($cookie[1] !== mkhash($cookie[0], $user['password'], $cookie[2])) {
|
||||
// Malformed cookies
|
||||
destroyCookies();
|
||||
if ($prompt) mod_login();
|
||||
if ($prompt) mod_login($ctx);
|
||||
exit;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue