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(); session_start();
} }
/*$user = new User(); // 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(); $user->loadMe();
if($user->twofactor < 1 && $classname != "mfLoginController" && $classname != "UserProfileController" && $this->action != "logout" && $this->action != "Logout") { if($user->twofactor < 1 && $classname != "mfLoginController" && $classname != "UserProfileController" && $this->action != "logout" && $this->action != "Logout") {
//$this->mod = "UserProfile"; // redirect to UserProfile
//$this->action = "Index";
if(MFUSEFANCYURLS) { if(MFUSEFANCYURLS) {
header("Location: $baseurl/UserProfile"); header("Location: $baseurl/UserProfile");
exit;
} else { } else {
header("Location: $baseurl?Mod=UserProfile"); header("Location: $baseurl?Mod=UserProfile");
}
exit; exit;
} }
}*/ }
} }
$request['mod'] = ucfirst($this->mod); $request['mod'] = ucfirst($this->mod);