Skip to content

Commit

Permalink
fix not working auth_type=(fallback|fallbackmail2sql) as Auth::backen…
Browse files Browse the repository at this point in the history
…d() calls __construct(null, null)
  • Loading branch information
ralfbecker committed Jul 27, 2023
1 parent ae76eea commit eeec71f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
8 changes: 3 additions & 5 deletions api/src/Auth/Fallback.php
Expand Up @@ -15,9 +15,7 @@
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
{
Expand All @@ -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);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions api/src/Auth/Fallbackmail2sql.php
Expand Up @@ -24,6 +24,6 @@ class Fallbackmail2sql extends Fallback
*/
function __construct($primary='mail', $fallback='sql')
{
parent::__construct($primary, $fallback);
parent::__construct($primary ?: 'mail', $fallback ?: 'sql');
}
}
}

0 comments on commit eeec71f

Please sign in to comment.