diff --git a/lib/mvcfronk/mfRouter/mfRouter.php b/lib/mvcfronk/mfRouter/mfRouter.php index 889a6b251..471796025 100644 --- a/lib/mvcfronk/mfRouter/mfRouter.php +++ b/lib/mvcfronk/mfRouter/mfRouter.php @@ -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);