diff --git a/application/logindefault.class.inc.php b/application/logindefault.class.inc.php index 9ef5d1329..001e27db4 100644 --- a/application/logindefault.class.inc.php +++ b/application/logindefault.class.inc.php @@ -85,6 +85,16 @@ class LoginDefaultAfter extends AbstractLoginFSMExtension implements iLogoutExte return LoginWebPage::LOGIN_FSM_RETURN_CONTINUE; } + protected function OnCheckCredentials(&$iErrorCode) + { + if (!isset($_SESSION['login_mode'])) + { + LoginWebPage::ResetSession(); + exit(); + } + return LoginWebPage::LOGIN_FSM_RETURN_CONTINUE; + } + /** * Execute all actions to log out properly */ diff --git a/application/utils.inc.php b/application/utils.inc.php index 322d2424e..b4bea9bf9 100644 --- a/application/utils.inc.php +++ b/application/utils.inc.php @@ -2042,4 +2042,27 @@ class utils return $sMimeType; } + + /** + * helper to test if a string starts with another + * @param $haystack + * @param $needle + * + * @return bool + */ + public final static function StartsWith($haystack, $needle) + { + return substr_compare($haystack, $needle, 0, strlen($needle)) === 0; + } + + /** + * helper to test if a string ends with another + * @param $haystack + * @param $needle + * + * @return bool + */ + public final static function EndsWith($haystack, $needle) { + return substr_compare($haystack, $needle, -strlen($needle)) === 0; + } }