loggedinorreturn use nexus_redirect()

This commit is contained in:
xiaomlove
2023-07-29 23:53:04 +08:00
parent 83d30668a6
commit 68896196ea
2 changed files with 5 additions and 5 deletions

View File

@@ -3100,12 +3100,12 @@ function loggedinorreturn($mainpage = false) {
if (nexus()->getScript() == 'ajax') {
exit(fail('Not login!', $_POST));
}
if ($mainpage)
header("Location: " . get_protocol_prefix() . "$BASEURL/login.php");
else {
if ($mainpage) {
nexus_redirect("login.php");
} else {
$to = $_SERVER["REQUEST_URI"];
$to = basename($to);
header("Location: " . get_protocol_prefix() . "$BASEURL/login.php?returnto=" . rawurlencode($to));
nexus_redirect("login.php?returnto=" . rawurlencode($to));
}
exit();
}