From: Mischa POSLAWSKY Date: Sun, 5 Jan 2020 19:56:37 +0000 (+0100) Subject: login/post: require user to access X-Git-Tag: v4.3~3 X-Git-Url: http://git.shiar.net/minimedit.git/commitdiff_plain/42a4b445cf00c094dfa97b8679901588371188e6 login/post: require user to access Redirect to login to avoid incomprehensible error message. Reported-by: Heleen Terlouw --- diff --git a/login/post/index.php b/login/post/index.php index 9578d3c..747683f 100644 --- a/login/post/index.php +++ b/login/post/index.php @@ -1,5 +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"); }