X-Git-Url: http://git.shiar.net/minimedit.git/blobdiff_plain/f38864d3eacdb90d0fd0d2aa7a8bd88ca9974ff1..bc04734cdf01d9b2ac8a9b9558c4782e61086821:/login/post/index.php diff --git a/login/post/index.php b/login/post/index.php index e491e35..747683f 100644 --- a/login/post/index.php +++ b/login/post/index.php @@ -1,7 +1,11 @@ admin('user') and $username = @$_REQUEST['login']) { +if (!$User) { + http_response_code(303); + $target = urlencode($_SERVER['REQUEST_URI']); + header("Location: /login?goto=$target"); + exit; +} +elseif ($User->admin('user') and $username = @$_REQUEST['login']) { try { $user = new User("profile/$username"); } @@ -28,4 +32,3 @@ else { } print ''."\n"; -print $body;