mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-20 11:48:27 -06:00
23 lines
528 B
PHP
23 lines
528 B
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
namespace FireflyIII\Scopes;
|
|
|
|
use Adldap\Query\Builder;
|
|
use Adldap\Laravel\Scopes\ScopeInterface;
|
|
|
|
class LdapFilterScope implements ScopeInterface {
|
|
/**
|
|
* If the ADLDAP_AUTH_FILTER is provided, apply the filter to the LDAP query.
|
|
* @param Builder $query
|
|
* @return void
|
|
*/
|
|
public function apply(Builder $query)
|
|
{
|
|
$filter = (string) config('ldap_auth.custom_filter');
|
|
if ( '' !== $filter ) {
|
|
$query->rawFilter($filter);
|
|
}
|
|
}
|
|
}
|