Changeset 1853
- Timestamp:
- 12/16/09 16:04:54 (14 years ago)
- Location:
- trunk/jabberit_messenger/inc
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/jabberit_messenger/inc/class.contacts_im.inc.php
r1840 r1853 138 138 { 139 139 $group = explode(":",$tmp); 140 $array_uids = array_merge($array_uids, $this->ldap->getGroupsMemberUid($group[0], $this->serverLdap )); 140 $array_result = $this->ldap->getGroupsMemberUid($group[0], $this->serverLdap ); 141 array_shift($array_result[0]['memberuid']); 142 $array_uids = array_merge($array_uids, $array_result[0]['memberuid']); 143 unset($array_result); 141 144 } 142 145 } 146 143 147 } 144 148 … … 201 205 { 202 206 $group = explode(":",$tmpExt); 203 $array_uids_external = @array_merge($array_uids_external, $this->ldap->getGroupsMemberUid( $group[0], $key )); 207 $array_result = $this->ldap->getGroupsMemberUid($group[0], $group[0], $key ); 208 array_shift($array_result[0]['memberuid']); 209 $array_uids_external = array_merge($array_uids_external, $array_result[0]['memberuid']); 210 unset($array_result); 211 //$array_uids_external = @array_merge($array_uids_external, $this->ldap->getGroupsMemberUid( $group[0], $key )); 204 212 } 205 213 … … 263 271 public final function verifyAddNewContact($pUid) 264 272 { 265 $groupsLocked =explode(";",$_SESSION['phpgw_info']['jabberit_messenger']['groups_locked']);266 $gidNumbers 267 $uid 268 $uid_User 269 $uid_User 270 273 $groupsLocked = explode(";",$_SESSION['phpgw_info']['jabberit_messenger']['groups_locked']); 274 $gidNumbers = array(); 275 $uid = $pUid['uid']; 276 $uid_User = substr($this->dn_User, 0, strpos($this->dn_User, ",")); 277 $uid_User = substr($uid_User, 4); 278 271 279 foreach($groupsLocked as $tmp) 272 280 { … … 274 282 $gidNumbers[] = $groups[1]; 275 283 } 276 284 277 285 $filter_gid = implode(")(gidnumber=",$gidNumbers); 278 286 $filter_gid = "(gidnumber=". $filter_gid. ")"; 279 280 $result = $this->ldap->getGroupsMemberUid( $filter_gid);281 287 288 $result = $this->ldap->getGroupsMemberUid( $filter_gid, "localhost" ); 289 282 290 if( $result && is_array($result) ) 283 291 { -
trunk/jabberit_messenger/inc/class.ldap_im.inc.php
r1843 r1853 175 175 if( $this->ldap ) 176 176 { 177 $filter = "(&(objectclass=posixgroup)(cn=".$pGroup."))"; 178 $justthese = array("memberuid","gidnumber"); 179 $search = ldap_search($this->ldap,$this->ldap_context,$filter, $justthese); 177 $filter = "(&(objectclass=posixgroup)(|".$pGroup."))"; 178 if( strpos($pGroup, "gidnumber") === false ) 179 $filter = "(&(objectclass=posixgroup)(cn=".$pGroup."))"; 180 181 $justthese = array("dn","memberuid","gidnumber"); 182 $search = ldap_search($this->ldap, $this->ldap_context, $filter, $justthese); 180 183 $result = ldap_get_entries($this->ldap,$search); 181 184 } … … 203 206 { 204 207 $filter = "(&(objectclass=posixgroup)(cn=".$pGroup."))"; 205 $justthese = array(" memberuid","gidnumber");208 $justthese = array("dn","memberuid","gidnumber"); 206 209 $search = ldap_search($this->ldap,$this->ldap_context,$filter, $justthese); 207 210 $result = ldap_get_entries($this->ldap,$search); … … 212 215 213 216 if( $result['count'] > 0 ) 217 return $result; 218 219 /* 220 if( $result['count'] > 0 ) 214 221 { 215 222 array_shift($result[0]['memberuid']); 216 223 return $result[0]['memberuid']; 217 224 } 218 225 */ 226 219 227 return false; 220 228 }
Note: See TracChangeset
for help on using the changeset viewer.