mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-05 04:03:26 +00:00
Merge branch 'develop' of github.com:firefly-iii/firefly-iii into develop
This commit is contained in:
21
app/Scopes/LdapFilterScope.php
Normal file
21
app/Scopes/LdapFilterScope.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user