do not set user for controller, because it is not set at that time

This commit is contained in:
Uwe Steinmann 2018-03-27 13:44:48 +02:00
parent aa416f90ec
commit ab3475f512

View File

@ -39,7 +39,7 @@ function _printMessage($heading, $message) { /* {{{ */
} /* }}} */
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
$controller = Controller::factory($tmp[1], array('dms'=>$dms, 'user'=>$user));
$controller = Controller::factory($tmp[1], array('dms'=>$dms));
if (isset($_REQUEST["sesstheme"]) && strlen($_REQUEST["sesstheme"])>0 && is_numeric(array_search($_REQUEST["sesstheme"],UI::getStyles())) ) {
$theme = $_REQUEST["sesstheme"];
@ -131,10 +131,10 @@ if ($user->isAdmin() && ($_SERVER['REMOTE_ADDR'] != $settings->_adminIP ) && ( $
}
if($settings->_enable2FactorAuthentication) {
if($secret = $user->getSecret()) {
if($user->getSecret()) {
require "vendor/autoload.php";
$tfa = new \RobThree\Auth\TwoFactorAuth('SeedDMS');
if($tfa->verifyCode($secret, $_POST['twofactauth']) !== true) {
if($tfa->verifyCode($user->getSecret(), $_POST['twofactauth']) !== true) {
_printMessage(getMLText("login_error_title"), getMLText("login_error_text"));
exit;
}