Ad Widget

Collapse

Better LDAP search filter in auth

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • limo
    Senior Member
    • Dec 2004
    • 192

    #1

    Better LDAP search filter in auth

    Hi to all,

    it would be great if we can use some more sofisticated search filter. LDAP implementations can vary too much and it should be possible to change default settings:

    loginattr - attribute used for login names. Can vary (cn,uid,samaccountname,...)
    advancedfilter - Advanced filter for tuning searches. Can be used for testing LDAP group membership etc..

    Search could be done like:
    Code:
    (&($loginattr=$login)$advancedfilter)
    Example filter:
    Code:
    (objectclass=person)(employeetype=Stud)
    Thanx!
  • kaneo GmbH
    Junior Member
    • Oct 2016
    • 1

    #2
    this issue was closed, but not solved. https://support.zabbix.com/browse/ZBX-687

    you can make some core modifications to accomplish this:

    include/classes/ldap/CLdap.php

    PHP Code:
    public function __construct($arg = []) {
                    ...
                    
    $this->cnf = [
                            ...
                            
    'userfilter' => '(&(%{attr}=%{user})(objectclass=person))',
                           ...
                    ];
                    ...
            } 
    change userfilter to what you want.

    Comment

    Working...