diff --git a/api/src/Auth/Fallback.php b/api/src/Auth/Fallback.php index 09462b19aa..8ac54f0084 100644 --- a/api/src/Auth/Fallback.php +++ b/api/src/Auth/Fallback.php @@ -15,9 +15,7 @@ namespace EGroupware\Api\Auth; use EGroupware\Api; /** - * Authentication agains a LDAP Server with fallback to SQL - * - * For other fallback types, simply change auth backends in constructor call + * Authentication against an LDAP Server (or other authentication type) with fallback to SQL */ class Fallback implements Backend { @@ -44,9 +42,9 @@ class Fallback implements Backend function __construct($primary='ldap',$fallback='sql') { // do NOT save our backends in session, as we want "fallback" to be saved - $this->primary_backend = Api\Auth::backend(str_replace('auth_', '', $primary), false); + $this->primary_backend = Api\Auth::backend(str_replace('auth_', '', $primary ?: 'ldap'), false); - $this->fallback_backend = Api\Auth::backend(str_replace('auth_', '', $fallback), false); + $this->fallback_backend = Api\Auth::backend(str_replace('auth_', '', $fallback ?: 'sql'), false); } /** diff --git a/api/src/Auth/Fallbackmail2sql.php b/api/src/Auth/Fallbackmail2sql.php index ee54db709e..8e7101174e 100644 --- a/api/src/Auth/Fallbackmail2sql.php +++ b/api/src/Auth/Fallbackmail2sql.php @@ -24,6 +24,6 @@ class Fallbackmail2sql extends Fallback */ function __construct($primary='mail', $fallback='sql') { - parent::__construct($primary, $fallback); + parent::__construct($primary ?: 'mail', $fallback ?: 'sql'); } -} +} \ No newline at end of file