commit 073452115e6d11b8abd08f053fdc89fa5c7fc17e
parent eb1d7675c4ea40f5f9800cd58c4983f6f9643a40
Author: Jan Dankert <develop@jandankert.de>
Date: Thu, 29 Aug 2019 23:19:50 +0200
Ignoring exceptions in auth modules.
Diffstat:
1 file changed, 14 insertions(+), 7 deletions(-)
diff --git a/modules/cms-ui/action/IndexAction.class.php b/modules/cms-ui/action/IndexAction.class.php
@@ -814,25 +814,32 @@ class IndexAction extends Action
private function tryAutoLogin()
{
- $modules = explode(',',config('security','modules','autologin'));
+ $modules = explode(',',config('security','modules','autologin'));
+ $username = null;
- $username = '';
foreach( $modules as $module)
{
- Logger::debug('Auto-Login module: '.$module);
+ Logger::debug( 'Auto-Login module: '.$module );
$moduleClass = $module.'Auth';
$auth = new $moduleClass;
/* @type $auth Auth */
- $username = $auth->username();
+ try {
- if ( !empty($username) )
+ $username = $auth->username();
+ }
+ catch( Exception $e ) {
+ Logger::warn( 'Error in auth-module '.$module.":\n".$e->__toString() );
+ // Ignore this and continue with next module.
+ }
+
+ if ( $username )
{
- Logger::debug('Auto-Login for User '.$username);
+ Logger::debug('Auto-Login for User '.$username.' with auth-module '.$module);
break; // Benutzername gefunden.
}
}
- if ( !empty( $username ) )
+ if ( $username )
{
try
{