You are here

public static function SimpleLdapRole::filter in Simple LDAP 7.2

Same name and namespace in other branches
  1. 7 simple_ldap_role/SimpleLdapRole.class.php \SimpleLdapRole::filter()

Return the LDAP search filter, as set by the module configuration.

Return value

string The LDAP search filter to satisfy the module configuration options.

4 calls to SimpleLdapRole::filter()
SimpleLdapRole::__construct in simple_ldap_role/SimpleLdapRole.class.php
Constructor.
simple_ldap_role_cron in simple_ldap_role/simple_ldap_role.module
Implements hook_cron().
simple_ldap_role_sync_user_to_drupal in simple_ldap_role/simple_ldap_role.module
Synchronize LDAP groups to Drupal roles.
simple_ldap_role_sync_user_to_ldap in simple_ldap_role/simple_ldap_role.module
Implements hook_sync_user_to_ldap().

File

simple_ldap_role/SimpleLdapRole.class.php, line 356
SimpleLdapRole class file.

Class

SimpleLdapRole
@file SimpleLdapRole class file.

Code

public static function filter() {

  // Get the LDAP configuration.
  $objectclass = simple_ldap_role_variable_get('simple_ldap_role_objectclass');
  $extrafilter = simple_ldap_role_variable_get('simple_ldap_role_filter');

  // Construct the filter.
  $filter = '(&(objectclass=' . implode(')(objectclass=', $objectclass) . '))';
  if (!empty($extrafilter)) {
    $filter = '(&' . $filter . '(' . $extrafilter . '))';
  }
  return $filter;
}