wpdirauth_filterquery

wpdirauth_filterquery

Description

Fires right before the user look-up occurs and allows you to alter the LDAP search filter.

Parameters

$strCurrentFilter
(string) The currently constructed search filter
Default: ($strFilter=$strUserName) expanded

$strFilter
(string)  LDAP attribute to search against username as defined in wpDirAuth settings
Default: samAccountName

$strUserName
(string) User account name we’re searching for in LDAP.
Default: LDAP-authenticated username we’re attempting to add, or LDAP-authenticated user name that is attempting to authenticate.

Returns

Your callback function needs to return a valid, complete LDAP search filter.

Example

[php]
/**
*
*/
add_filter(‘wpdirauth_filterquery’,function($strCurrentFilter,$strFilter,$strUserName){
return ‘(&’.$strCurrentFilter.'(ou=Marketing))’;
},10,3);
[/php]