summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--inc/mod/pages.php7
-rw-r--r--mod.php2
2 files changed, 6 insertions, 3 deletions
diff --git a/inc/mod/pages.php b/inc/mod/pages.php
index cf06e7d9..0ea97fe8 100644
--- a/inc/mod/pages.php
+++ b/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,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']);
}
}
diff --git a/mod.php b/mod.php
index 9de2c15b..a51f4bcd 100644
--- a/mod.php
+++ b/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;