Merge branch 'fronkdev' into 'master'

2FA can now be forced for logged-in users

See merge request fronk/thetool!211
This commit is contained in:
Frank Schubert
2024-02-03 20:46:09 +00:00

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