public function groupAddMember($group_dn, $user) {

    $user_ldap_entry = $this->userUserToExistingLdapEntry($user);
    $result = FALSE;
    if ($user_ldap_entry && $this->groupGroupEntryMembershipsConfigured) {
      $add = array();
      $add[$this->groupMembershipsAttr] = $user_ldap_entry['dn'];
      $this->connectAndBindIfNotAlready();
      $result = @ldap_mod_add($this->connection, $group_dn, $add);
    }

    return $result;
  }
public function groupAddMember($group_dn, $user) {

    $user_ldap_entry = $this->userUserToExistingLdapEntry($user);
    $result = FALSE;
    if ($user_ldap_entry && $this->groupGroupEntryMembershipsConfigured) {
      $add = array();
      $add[$this->groupMembershipsAttr] = $user_ldap_entry['dn'];
      $this->connectAndBindIfNotAlready();
      $result = @ldap_mod_add($this->connection, $group_dn, $add);
    }

    return $result;
  }
public function groupAddMember ( $ group_dn , $ user ) { $ user_ldap_entry = $ this -> userUserToExistingLdapEntry ( $ user ) ; $ result = FALSE ; if ( $ user_ldap_entry && $ this -> groupGroupEntryMembershipsConfigured ) { $ add = array ( ) ; $ add [ $ this -> groupMembershipsAttr ] = $ user_ldap_entry [ 'dn' ] ; $ this -> connectAndBindIfNotAlready ( ) ; $ result = @ ldap_mod_add ( $ this -> connection , $ group_dn , $ add ) ; } return $ result ; }
NOT TESTED
add a member to a group

@param string $ldap_user_dn as ldap dn
@param mixed $user
- drupal user object (stdClass Object)
- ldap entry of user (array) (with top level keys of 'dn', 'mail', 'sid' and 'attr' )
- ldap dn of user (array)
- drupal username of user (string)
NOT TESTED add a member to a group