do not enforce 2facto auth for guest and when secret is set

This commit is contained in:
Uwe Steinmann 2018-03-27 13:43:56 +02:00
parent 5506c0ed69
commit aa416f90ec

View File

@ -166,8 +166,8 @@ if (!$user->isAdmin() && $origuser == null) {
* if secret is not set and 2-factor authentication is turned on. Also check if
* already on the page Setup2Factor.php and no user substiation has occured.
*/
if($settings->_enable2FactorAuthentication && $origuser == null && $user->getSecret() == '') {
if(basename($_SERVER['SCRIPT_NAME']) != 'out.Setup2Factor.php') {
if($settings->_enable2FactorAuthentication && $settings->_guestID != $user->getID() && $settings->_autoLoginUser != $user->getID() && $origuser == null && $user->getSecret() == '') {
if(basename($_SERVER['SCRIPT_NAME']) != 'out.Setup2Factor.php' && basename($_SERVER['SCRIPT_NAME']) != 'op.Setup2Factor.php') {
header("Location: ../out/out.Setup2Factor.php");
exit;
}