Don't always redirect to dashboard on login

This commit is contained in:
Michael Save 2013-01-29 22:11:33 +11:00
parent 1ad71b33e2
commit e5bf2a91fc
2 changed files with 6 additions and 3 deletions

View File

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

View File

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