fix not working auth_type=(fallback|fallbackmail2sql) as Auth::backend() calls __construct(null, null)

This commit is contained in:
ralf 2023-07-27 14:09:17 +02:00
parent 0f692fbb74
commit f56c0749b3
2 changed files with 5 additions and 7 deletions

View File

@ -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);
}
/**

View File

@ -24,6 +24,6 @@ class Fallbackmail2sql extends Fallback
*/
function __construct($primary='mail', $fallback='sql')
{
parent::__construct($primary, $fallback);
parent::__construct($primary ?: 'mail', $fallback ?: 'sql');
}
}