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

@@ -1,5 +1,5 @@
<?php
defined('VERSION_NUMBER') || define('VERSION_NUMBER', '1.8.5');
defined('VERSION_NUMBER') || define('VERSION_NUMBER', '1.8.6');
defined('RELEASE_DATE') || define('RELEASE_DATE', '2023-07-29');
defined('IN_TRACKER') || define('IN_TRACKER', false);
defined('PROJECTNAME') || define("PROJECTNAME","NexusPHP");

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();
}