From: Philipp Schüle
Date: Tue, 18 Jul 2017 16:28:07 +0000 (+0200)
Subject: only look for valid second factor in session if we have a session
X-Git-Tag: 2017.08.1~30^2~66
X-Git-Url: http://git.tine20.org/?p=tine20;a=commitdiff_plain;h=33b43f24295e4be22826e37513a5b7647e6d3553;ds=sidebyside
only look for valid second factor in session if we have a session
Change-Id: I6ea2f49149696a22e5bb80442b62fade13b3ec2b
Reviewed-on: http://gerrit.tine20.com/customers/5245
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle
---
diff --git a/tine20/Tinebase/Auth/SecondFactor/Abstract.php b/tine20/Tinebase/Auth/SecondFactor/Abstract.php
index 7fdb67e..8868f11 100644
--- a/tine20/Tinebase/Auth/SecondFactor/Abstract.php
+++ b/tine20/Tinebase/Auth/SecondFactor/Abstract.php
@@ -44,6 +44,11 @@ abstract class Tinebase_Auth_SecondFactor_Abstract
*/
public static function hasValidSecondFactor()
{
+ if (! Tinebase_Session::isStarted()) {
+ if (Tinebase_Core::isLogLevel(Zend_Log::INFO)) Tinebase_Core::getLogger()->info(__METHOD__ . '::' . __LINE__
+ . ' No session started to check second factor in session');
+ return true;
+ }
$currentValidUntil = Tinebase_Session::getSessionNamespace()->secondFactorValidUntil;
if ($currentValidUntil) {
$validUntil = new Tinebase_DateTime($currentValidUntil);