Fixed sometimes failing redirect to UserProfile in Router
This commit is contained in:
@@ -168,6 +168,8 @@ class mfRouter {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$baseurl = preg_replace('@/$@', '', $baseurl);
|
||||
define("MFFANCYBASEURL",$baseurl);
|
||||
}
|
||||
|
||||
@@ -215,15 +217,10 @@ class mfRouter {
|
||||
if(defined("MFUSELOGIN") && MFUSELOGIN && defined("TT_WORKER_FORCE_2FA") && TT_WORKER_FORCE_2FA && mfLoginController::isLoggedIn()) {
|
||||
$user = new User();
|
||||
$user->loadMe();
|
||||
|
||||
|
||||
if($user->twofactorrequired && $user->twofactor < 1 && $classname != "mfLoginController" && $classname != "UserProfileController" && $this->action != "logout" && $this->action != "Logout") {
|
||||
// redirect to UserProfile
|
||||
if(MFUSEFANCYURLS) {
|
||||
header("Location: $baseurl/UserProfile");
|
||||
} else {
|
||||
header("Location: $baseurl?Mod=UserProfile");
|
||||
}
|
||||
exit;
|
||||
mfBaseController::redirect("UserProfile");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user