page: api attribute indicate index requests
[minimedit.git] / login / index.php
index 0f428ca48f95e8d70bda44ccb11eb31b4013e4a3..38b7c234465006445ac2d89491b9c3cc7c60cc7b 100644 (file)
@@ -1,5 +1,5 @@
 <?php
-if (!$User) return;
+if ($Page->api) return;
 $message = NULL;
 
 if (isset($_POST['mail'])) {
@@ -59,9 +59,7 @@ if (!$User or !$User->login) {
 
 if (isset($_REQUEST['goto'])) {
        $target = ltrim($_REQUEST['goto'], '/');
-       header("Location: /$target");
-       http_response_code(302);
-       exit;
+       abort("/$target", 302);
 }
 
 if (isset($Page->raw)) {