You are here

public function LdapTestFunctions::addLDAPUserToLDAPArraysFromAttributes in Lightweight Directory Access Protocol (LDAP) 8.2

Same name and namespace in other branches
  1. 7.2 ldap_test/LdapTestFunctions.class.php \LdapTestFunctions::addLDAPUserToLDAPArraysFromAttributes()
1 call to LdapTestFunctions::addLDAPUserToLDAPArraysFromAttributes()
LdapTestFunctions::populateFakeLdapServerData in ldap_test/LdapTestFunctions.class.php
set variable with fake test data

File

ldap_test/LdapTestFunctions.class.php, line 338

Class

LdapTestFunctions

Code

public function addLDAPUserToLDAPArraysFromAttributes($user, $sid, $dn, $attributes, $ldap_type, $user_attr) {
  if ($ldap_type == 'activedirectory') {
    $attributes[$user_attr] = array(
      0 => $user['cn'],
      'count' => 1,
    );
    $attributes['distinguishedname'] = array(
      0 => $dn,
      'count' => 1,
    );
  }
  elseif ($ldap_type == 'openldap') {
  }
  $this->data['ldap_servers'][$sid]['users'][$dn]['attr'] = $attributes;
  $this->data['ldap_servers_by_guid'][$sid][$user['guid']]['attr'] = $attributes;
  $this->data['ldap_servers_by_guid'][$sid][$user['guid']]['dn'] = $dn;
  $this->ldapData['ldap_servers'][$sid][$dn] = $attributes;
  $this->ldapData['ldap_servers'][$sid][$dn]['count'] = count($attributes);
}