Changeset 7769 for trunk/expressoAdmin1_2/inc
- Timestamp:
- 01/18/13 16:47:21 (12 years ago)
- Location:
- trunk/expressoAdmin1_2/inc
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoAdmin1_2/inc/class.db_functions.inc.php
r7673 r7769 625 625 $sql = "INSERT INTO phpgw_expressoadmin_log (date, manager, action, userinfo) " 626 626 . "VALUES('now','" . $_SESSION['phpgw_info']['expresso']['user']['account_lid'] . "','" . strtolower($action) . "','" . strtolower($about) . "')"; 627 628 627 if (!$this->db->query($sql)) 629 628 { -
trunk/expressoAdmin1_2/inc/class.functions.inc.php
r7681 r7769 39 39 $this->current_config = $c->config_data; 40 40 } 41 42 function write_log($action, $about) 43 { 44 return $this->db_functions->write_log($action, $about); 45 } 41 46 42 47 // Account and type of access. Return: Have access ? (true/false) -
trunk/expressoAdmin1_2/inc/class.imap_functions.inc.php
r7552 r7769 321 321 $result['msg'] = $this->functions->lang('Error on function') . ' imap_functions->setaclfrombox: imap_setacl'; 322 322 $result['msg'] .= "\n" . $this->functions->lang('Server return') . ': ' . imap_last_error(); 323 break;323 // break; 324 324 } 325 325 } … … 384 384 return $result; 385 385 } 386 387 if(count($owners_to_remove) > 0) 388 { 389 foreach($owners_to_remove as $user => $acl) 390 { 391 $this->functions->write_log("User removed from the shared account",'USER: '.$user.' - SHARED ACCOUNT: '.$params['uid']); 392 } 393 } 394 if(count($owners_to_add) > 0) 395 { 396 foreach($owners_to_add as $user => $acl) 397 { 398 $this->functions->write_log("User added from the shared account",'USER: '.$user.' - SHARED ACCOUNT: '.$params['uid']); 399 } 400 } 401 386 402 //file_put_contents("/tmp/saida", "old ".print_r($owners_acl_old, true)."remove ".print_r($owners_to_remove, true)."add ".print_r($owners_to_add, true)."update ".print_r($owners_to_update, true)); 387 403 if( is_array($owners_acl_new)){ … … 442 458 require_once('class.ldap_functions.inc.php'); 443 459 444 if( !$ldap )445 {460 // if( !$ldap ) 461 // { 446 462 $ldap = new ldap_functions(); 447 }463 // } 448 464 449 465 $to = $ldap->uid2mailforwardingaddress( $user ); … … 468 484 $keys = array_keys( $tpls ); 469 485 470 if( !array_diff_key( $tpl , array_keys( $keys ) ) )486 if( !array_diff_key( $tpls, array_keys( $keys ) ) ) 471 487 { 472 488 $newTpls = array(); -
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 } -
trunk/expressoAdmin1_2/inc/class.shared_accounts.inc.php
r7655 r7769 50 50 $result &= $this->db_functions->save_calendar_acls($this->ldap_functions->uid2uidnumber($user),$acl,$owner); 51 51 } 52 $this->db_functions->write_log('Create Shared account',$params['uid']); 53 } 52 54 53 } 55 54 56 return $return; 55 57 } … … 62 64 $result = $this->ldap_functions->save_shared_accounts($params); 63 65 64 65 if( $result['status']){ 66 $result = $this->imap_functions->save_shared_account($params); 67 66 if( $result['status']){ 67 $result = $this->imap_functions->save_shared_account($params); 68 68 $owners_calendar_acl_new = unserialize($params['owners_calendar_acl']); 69 69 … … 72 72 $this->db_functions->save_calendar_acls($this->ldap_functions->uid2uidnumber($user),$acl,$owner); 73 73 } 74 75 $this->db_functions->write_log('Update Shared account','Old UID:'.$params['old_uid'].' New UID '.$params['uid']); 74 76 } 75 77 … … 161 163 function delete($params){ 162 164 $result = $this->ldap_functions->delete_shared_account_data($params); 163 if( $result['status'] ) $result = $this->imap_functions->delete_mailbox($params['uid']); 165 if( $result['status'] ) 166 { 167 $result = $this->imap_functions->delete_mailbox($params['uid']); 168 $this->db_functions->write_log('Removed Shared account',$params['uid']); 169 } 164 170 return $result; 165 171 }
Note: See TracChangeset
for help on using the changeset viewer.