Changeset 7769 for trunk/expressoAdmin1_2/inc/class.ldap_functions.inc.php
- Timestamp:
- 01/18/13 16:47:21 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoAdmin1_2/inc/class.ldap_functions.inc.php
r7681 r7769 242 242 } 243 243 244 $institutional_accounts = ldap_search($this->ldap, $GLOBALS['phpgw_info']['server']['ldap_context'], ('('.substr($params['anchor'], 0 , strpos($params['anchor'],','))).')'); 245 $old = ldap_get_entries($this->ldap, $institutional_accounts); 246 $oldOwners = array(); 247 248 249 foreach($old[0]['mailforwardingaddress'] as $mailP) 250 { 251 $tmp = $this->mailforwardingaddress2uidnumber($mailP); 252 $oldOwners[$tmp['uidnumber']] = true; 253 } 254 255 if (!empty($params['owners'])) 256 { 257 foreach($params['owners'] as $index => $uidnumber) 258 { 259 if(array_key_exists($uidnumber, $oldOwners)) 260 unset( $oldOwners[$uidnumber] ); 261 else 262 $this->functions->write_log("User added from the institutional account",'USER: '.$uidnumber.' - SHARED ACCOUNT: '.$params['anchor']); 263 } 264 } 265 266 if(count($oldOwners) > 0) 267 foreach($oldOwners as $i=>$v ) 268 { 269 $this->functions->write_log("User removed from the institutional account",'USER: '.$i.' - SHARED ACCOUNT: '.$params['anchor']); 270 } 271 272 273 244 274 $uid = 'institutional_account_' . $params['mail']; 245 275 $dn = strtolower("uid=$uid," . $params['context']); … … 295 325 if (!empty($params['owners'])) 296 326 { 297 foreach($params['owners'] as $index =>$uidnumber)327 foreach($params['owners'] as $index => $uidnumber) 298 328 { 299 329 $mailForwardingAddress = $this->uidnumber2mail($uidnumber); … … 311 341 $result['msg'] .= "\n" . $this->functions->lang('Server return') . ': ' . ldap_error($this->ldap); 312 342 } 343 344 345 $this->functions->write_log('Update institutional account','Old DN:'.$params['anchor'].' New DN '.$dn); 313 346 314 347 return $result; … … 2852 2885 return $return; 2853 2886 } 2854 2887 2888 $this->db_functions->write_log('Removed institutional account',$dn); 2889 2855 2890 return $return; 2856 2891 }
Note: See TracChangeset
for help on using the changeset viewer.