2FA can now be forced for logged-in users

This commit is contained in:
Frank Schubert
2024-02-03 21:45:24 +01:00
parent 3ec626e02e
commit 4e278e6c61

View File

@@ -211,21 +211,21 @@ class mfRouter {
session_start();
}
/*$user = new User();
$user->loadMe();
if($user->twofactor < 1 && $classname != "mfLoginController" && $classname != "UserProfileController" && $this->action != "logout" && $this->action != "Logout") {
//$this->mod = "UserProfile";
//$this->action = "Index";
if(MFUSEFANCYURLS) {
header("Location: $baseurl/UserProfile");
exit;
} else {
header("Location: $baseurl?Mod=UserProfile");
// check for enabled 2FA if authentication is enabled and 2FA is forced
if(defined("MFUSELOGIN") && MFUSELOGIN && defined("TT_WORKER_FORCE_2FA") && TT_WORKER_FORCE_2FA && mfLoginController::isLoggedIn()) {
$user = new User();
$user->loadMe();
if($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;
}
}*/
}
}
$request['mod'] = ucfirst($this->mod);