Changeset 355 for trunk/expressoAdmin1_2/inc/class.user.inc.php
- Timestamp:
- 07/18/08 11:36:30 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoAdmin1_2/inc/class.user.inc.php
r317 r355 266 266 } 267 267 268 $this->db_functions->write_log( 'criado usuario','',$dn,'','');268 $this->db_functions->write_log("criado usuario $dn",'','','',''); 269 269 } 270 270 … … 288 288 print_r($new_values); 289 289 echo '<br>'; 290 exit; 290 291 */ 291 292 … … 310 311 if ($diff['context']) 311 312 { 312 $newrdn = 'uid=' . $new_values['uid']; 313 $newparent = $new_values['context']; 314 $result = $this->ldap_functions->change_user_context($dn, $newrdn, $newparent); 315 if (!$result['status']) 316 { 317 $return['status'] = false; 318 $return['msg'] .= $result['msg']; 319 } 320 else 321 { 322 $dn = $newrdn . ',' . $newparent; 323 $this->db_functions->write_log('alterado contexto do usuario','',$dn,'',''); 313 if (strcasecmp($old_values['context'], $new_values['context']) != 0) 314 { 315 $newrdn = 'uid=' . $new_values['uid']; 316 $newparent = $new_values['context']; 317 $result = $this->ldap_functions->change_user_context($dn, $newrdn, $newparent); 318 if (!$result['status']) 319 { 320 $return['status'] = false; 321 $return['msg'] .= $result['msg']; 322 } 323 else 324 { 325 $dn = $newrdn . ',' . $newparent; 326 $this->db_functions->write_log('alterado contexto do usuario' . $new_values['uid'] . ' de: ' . $old_values['context'] . ' para: ' . $new_values['context'],'',$dn,'',''); 327 } 324 328 } 325 329 } … … 331 335 $ldap_mod_replace['givenname'] = $new_values['givenname']; 332 336 $ldap_mod_replace['cn'] = $new_values['givenname'] . ' ' . $new_values['sn']; 333 $this->db_functions->write_log("alterado givenname do usuario ",'',$dn,'','');337 $this->db_functions->write_log("alterado givenname do usuario $dn de ".$old_values['givenname']." para ".$new_values['givenname'],'','','',''); 334 338 } 335 339 if ($diff['sn']) … … 337 341 $ldap_mod_replace['sn'] = $new_values['sn']; 338 342 $ldap_mod_replace['cn'] = $new_values['givenname'] . ' ' . $new_values['sn']; 339 $this->db_functions->write_log("altera $ldap_mod_do sn do usuario",'',$dn,'','');343 $this->db_functions->write_log("altera sn do usuario de ".$old_values['sn']." para ".$new_values['sn'],'','','',''); 340 344 } 341 345 if ($diff['mail']) … … 344 348 $this->ldap_functions->replace_user2maillists($new_values['mail'], $old_values['mail']); 345 349 $this->ldap_functions->replace_mail_from_institutional_account($new_values['mail'], $old_values['mail']); 346 $this->db_functions->write_log("alterado mail do usuario ",'',$dn,'','');350 $this->db_functions->write_log("alterado mail do usuario $dn de " . $old_values['mail'] . " para " . $new_values['mail'],'','','',''); 347 351 } 348 352 /* … … 363 367 { 364 368 $ldap_mod_replace['phpgwlastpasswdchange'] = '0'; 365 $this->db_functions->write_log("Expirado senha do usuário ",'',$dn,'','');369 $this->db_functions->write_log("Expirado senha do usuário $dn",'','','',''); 366 370 } 367 371 } … … 395 399 } 396 400 397 $this->db_functions->write_log("alterado password do usuario ",'',$dn,'','');401 $this->db_functions->write_log("alterado password do usuario $dn",'','','',''); 398 402 } 399 403 } … … 405 409 { 406 410 $ldap_mod_replace['telephonenumber'] = $new_values['telephonenumber']; 407 $this->db_functions->write_log("alterado telephonenumber do usuario ",'',$dn,'','');411 $this->db_functions->write_log("alterado telephonenumber do usuario $dn de ".$old_values['telephonenumber']." para ".$new_values['telephonenumber'],'','','',''); 408 412 } 409 413 } … … 426 430 $ldap_atribute = str_replace("corporative_information_", "", $atribute); 427 431 $ldap_mod_replace[$ldap_atribute] = $new_values[$atribute]; 428 $this->db_functions->write_log("alterado $ldap_atribute do usuario ",'',$dn,'','');432 $this->db_functions->write_log("alterado $ldap_atribute do usuario $dn de ".$old_values[$atribute]." para ".$new_values[$atribute],'','','',''); 429 433 } 430 434 //ADD ATTRS OF CORPORATIVE … … 432 436 { 433 437 $ldap_add[$ldap_atribute] = $new_values[$atribute]; 434 $this->db_functions->write_log("adicionado $ldap_atribute ao usuario ",'',$dn,'','');438 $this->db_functions->write_log("adicionado $ldap_atribute ao usuario $dn de ".$old_values[$atribute]." para ".$new_values[$atribute],'','','',''); 435 439 } 436 440 //REMOVE ATTRS OF CORPORATIVE … … 438 442 { 439 443 $ldap_remove[$ldap_atribute] = array(); 440 $this->db_functions->write_log("removido $ldap_atribute do usuario ",'',$dn,'','');444 $this->db_functions->write_log("removido $ldap_atribute do usuario $dn de ".$old_values[$atribute]." para ".$new_values[$atribute],'','','',''); 441 445 } 442 446 } … … 448 452 ($this->functions->check_acl($_SESSION['phpgw_session']['session_lid'], 'edit_sambausers_attributes')) ) 449 453 { 454 455 if ($diff['gidnumber']) 456 { 457 $ldap_mod_replace['gidnumber'] = $new_values['gidnumber']; 458 $this->db_functions->write_log("alterado gidnumber do usuario $dn. De:".$old_values['gidnumber']." Para:".$new_values['gidnumber'],'','','',''); 459 } 460 450 461 if (($this->current_config['expressoAdmin_samba_support'] == 'true') && ($new_values['userSamba']) && ($new_values['use_attrs_samba'] == 'on')) 451 462 { 463 if ($diff['gidnumber']) 464 { 465 $ldap_mod_replace['sambaPrimaryGroupSID'] = $this->current_config['expressoAdmin_sambaSID'] . '-' . ((2 * $new_values['gidnumber'])+1001); 466 $this->db_functions->write_log("alterado sambaPrimaryGroupSID do usuario $dn.",'','','',''); 467 } 468 452 469 if ($diff['sambaacctflags']) 453 470 { 454 471 $ldap_mod_replace['sambaacctflags'] = $new_values['sambaacctflags']; 455 $this->db_functions->write_log("alterado sambaacctflags do usuario ",'',$dn,'','');472 $this->db_functions->write_log("alterado sambaacctflags do usuario $dn",'','','',''); 456 473 } 457 474 if ($diff['sambalogonscript']) 458 475 { 459 476 $ldap_mod_replace['sambalogonscript'] = $new_values['sambalogonscript']; 460 $this->db_functions->write_log("alterado sambalogonscript do usuario ",'',$dn,'','');477 $this->db_functions->write_log("alterado sambalogonscript do usuario $dn",'','','',''); 461 478 } 462 479 if ($diff['sambahomedirectory']) 463 480 { 464 481 $ldap_mod_replace['homedirectory'] = $new_values['sambahomedirectory']; 465 $this->db_functions->write_log("alterado homedirectory do usuario ",'',$dn,'','');482 $this->db_functions->write_log("alterado homedirectory do usuario $dn",'','','',''); 466 483 } 467 484 if ($diff['sambadomain']) … … 469 486 $ldap_mod_replace['sambaSID'] = $diff['sambadomain'] . '-' . ((2 * $old_values['uidnumber'])+1000); 470 487 $ldap_mod_replace['sambaPrimaryGroupSID'] = $diff['sambadomain'] . '-' . ((2 * $old_values['gidnumber'])+1001); 471 $this->db_functions->write_log("alterado dominio samba do usuario $dn para " . $params['sambadomain'],'', $dn,'','');488 $this->db_functions->write_log("alterado dominio samba do usuario $dn para " . $params['sambadomain'],'','','',''); 472 489 } 473 490 } … … 485 502 { 486 503 $this->ldap_functions->ldap_remove_photo($dn); 487 $this->db_functions->write_log("removido jpegphoto do usuario ",'',$dn,'','');504 $this->db_functions->write_log("removido jpegphoto do usuario $dn",'','','',''); 488 505 } 489 506 elseif ($_FILES['photo']['name'] != '') … … 500 517 { 501 518 $photo_exist = true; 502 $this->db_functions->write_log("substituido jpegphoto do usuario ",'',$dn,'','');519 $this->db_functions->write_log("substituido jpegphoto do usuario $dn",'','','',''); 503 520 } 504 521 else 505 522 { 506 523 $photo_exist = false; 507 $this->db_functions->write_log("adicionado jpegphoto ao usuario ",'',$dn,'','');524 $this->db_functions->write_log("adicionado jpegphoto ao usuario $dn",'','','',''); 508 525 } 509 526 $this->ldap_functions->ldap_save_photo($dn, $_FILES['photo']['tmp_name'], $new_values['photo_exist'], $photo_exist); … … 520 537 { 521 538 $ldap_add['telephonenumber'] = $new_values['telephonenumber']; 522 $this->db_functions->write_log("adicionado telephonenumber ao usuario ",'',$dn,'','');539 $this->db_functions->write_log("adicionado telephonenumber ao usuario $dn",'','','',''); 523 540 } 524 541 if (($old_values['telephonenumber'] != '') && ($new_values['telephonenumber'] == '')) 525 542 { 526 543 $ldap_remove['telephonenumber'] = array(); 527 $this->db_functions->write_log("removido telephonenumber do usuario ",'',$dn,'','');544 $this->db_functions->write_log("removido telephonenumber do usuario $dn",'','','',''); 528 545 } 529 546 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// … … 532 549 { 533 550 $ldap_add['phpgwlastpasswdchange'] = '0'; 534 $this->db_functions->write_log("Expirado senha do usuário ",'',$dn,'','');551 $this->db_functions->write_log("Expirado senha do usuário $dn",'','','',''); 535 552 } 536 553 if (($old_values['passwd_expired'] == '0') && ($new_values['passwd_expired'] == '')) 537 554 { 538 555 $ldap_remove['phpgwlastpasswdchange'] = array(); 539 $this->db_functions->write_log("Removido expiração da senha do usuário ",'',$dn,'','');556 $this->db_functions->write_log("Removido expiração da senha do usuário $dn",'','','',''); 540 557 } 541 558 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// … … 544 561 { 545 562 $this->db_functions->add_pref_changepassword($new_values['uidnumber']); 546 $this->db_functions->write_log("adicionado changepassword ao usuario ",'',$dn,'','');563 $this->db_functions->write_log("adicionado changepassword ao usuario $dn",'','','',''); 547 564 } 548 565 if (($old_values['changepassword'] != '') && ($new_values['changepassword'] == '')) 549 566 { 550 567 $this->db_functions->remove_pref_changepassword($new_values['uidnumber']); 551 $this->db_functions->write_log("removido changepassword do usuario ",'',$dn,'','');568 $this->db_functions->write_log("removido changepassword do usuario $dn",'','','',''); 552 569 } 553 570 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// … … 556 573 { 557 574 $ldap_add['phpgwaccountstatus'] = 'A'; 558 $this->db_functions->write_log("ativado conta do usuario ",'',$dn,'','');575 $this->db_functions->write_log("ativado conta do usuario $dn",'','','',''); 559 576 } 560 577 if (($old_values['phpgwaccountstatus'] != '') && ($new_values['phpgwaccountstatus'] == '')) 561 578 { 562 579 $ldap_remove['phpgwaccountstatus'] = array(); 563 $this->db_functions->write_log("desativado conta do usuario ",'',$dn,'','');580 $this->db_functions->write_log("desativado conta do usuario $dn",'','','',''); 564 581 } 565 582 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// … … 568 585 { 569 586 $ldap_add['phpgwaccountvisible'] = '-1'; 570 $this->db_functions->write_log("adicionado phpgwaccountvisible ao usuario ",'',$dn,'','');587 $this->db_functions->write_log("adicionado phpgwaccountvisible ao usuario $dn",'','','',''); 571 588 } 572 589 if (($old_values['phpgwaccountvisible'] != '') && ($new_values['phpgwaccountvisible'] == '')) 573 590 { 574 591 $ldap_remove['phpgwaccountvisible'] = array(); 575 $this->db_functions->write_log("removido phpgwaccountvisible ao usuario ",'',$dn,'','');592 $this->db_functions->write_log("removido phpgwaccountvisible ao usuario $dn",'','','',''); 576 593 } 577 594 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// … … 580 597 { 581 598 $ldap_add['accountstatus'] = 'active'; 582 $this->db_functions->write_log("ativado conta de email do usuario ",'',$dn,'','');599 $this->db_functions->write_log("ativado conta de email do usuario $dn",'','','',''); 583 600 } 584 601 if (($old_values['accountstatus'] != '') && ($new_values['accountstatus'] == '')) 585 602 { 586 603 $ldap_remove['accountstatus'] = array(); 587 $this->db_functions->write_log("desativado conta de email do usuario ",'',$dn,'','');604 $this->db_functions->write_log("desativado conta de email do usuario $dn",'','','',''); 588 605 } 589 606 /* … … 675 692 { 676 693 $ldap_add['deliverymode'] = 'forwardOnly'; 677 $this->db_functions->write_log("adicionado forwardOnly ao usuario ",'',$dn,'','');694 $this->db_functions->write_log("adicionado forwardOnly ao usuario $dn",'','','',''); 678 695 } 679 696 if (($old_values['deliverymode'] != '') && ($new_values['deliverymode'] == '')) 680 697 { 681 698 $ldap_remove['deliverymode'] = array(); 682 $this->db_functions->write_log("removido forwardOnly ao usuario ",'',$dn,'','');699 $this->db_functions->write_log("removido forwardOnly ao usuario $dn",'','','',''); 683 700 } 684 701 } … … 692 709 { 693 710 $this->imap_functions->change_user_quota($new_values['uid'], $new_values['mailquota']); 694 $this->db_functions->write_log("alterado cota do usuario ",'',$dn,'','');711 $this->db_functions->write_log("alterado cota do usuario $dn",'','','',''); 695 712 } 696 713 } … … 715 732 $ldap_remove['sambaPwdLastSet'] = array(); 716 733 $ldap_remove['sambaPwdMustChange'] = array(); 717 $this->db_functions->write_log("removido atributos samba do usuario .",'',$dn,'','');734 $this->db_functions->write_log("removido atributos samba do usuario $dn.",'','','',''); 718 735 } 719 736 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// … … 742 759 $ldap_add['sambaPwdLastSet'] = strtotime("now"); 743 760 $ldap_add['sambaPwdMustChange'] = '2147483647'; 744 $this->db_functions->write_log("adicionado atributos samba do usuario.",'',$dn,'','');761 $this->db_functions->write_log("adicionado atributos samba ao usuario $dn.",'','','',''); 745 762 } 746 763 } … … 765 782 $this->db_functions->add_user2group($gidnumber, $new_values['uidnumber']); 766 783 $this->ldap_functions->add_user2group($gidnumber, $new_values['uid']); 767 $this->db_functions->write_log("adicionado usuario ao grupo $gidnumber.",'',$dn,'','');784 $this->db_functions->write_log("adicionado usuario $dn ao grupo $gidnumber.",'','','',''); 768 785 } 769 786 } … … 779 796 $this->db_functions->remove_user2group($gidnumber, $new_values['uidnumber']); 780 797 $this->ldap_functions->remove_user2group($gidnumber, $new_values['uid']); 781 $this->db_functions->write_log("removido usuario do grupo $gidnumber.",'',$dn,'','');798 $this->db_functions->write_log("removido usuario $dn do grupo $gidnumber.",'','','',''); 782 799 } 783 800 } 784 801 } 785 802 } 786 803 /* GIDNUMBER agora é um atributo samba e pode ser alterado por gerentes com este perfil 804 /* 787 805 if ($diff['gidnumber']) 788 806 { … … 794 812 $this->db_functions->write_log("alterado gidnumber do usuario.",'',$dn,'',''); 795 813 } 814 */ 796 815 } 797 816 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// … … 854 873 { 855 874 $this->ldap_functions->add_user2maillist($uid, $new_values['mail']); 856 $this->db_functions->write_log("adicionado usuario a maillist $uid.",'',$dn,'','');875 $this->db_functions->write_log("adicionado usuario $dn a maillist $uid.",'','','',''); 857 876 } 858 877 } … … 868 887 { 869 888 $this->ldap_functions->remove_user2maillist($uid, $new_values['mail']); 870 $this->db_functions->write_log("removido usuario da maillist $uid.",'',$dn,'','');889 $this->db_functions->write_log("removido usuario $dn da maillist $uid.",'','','',''); 871 890 } 872 891 } … … 947 966 } 948 967 949 $this->db_functions->write_log( 'Setado senha default','',$uid,'','');968 $this->db_functions->write_log("Setado senha default para $uid",'','','',''); 950 969 951 970 return $return; … … 968 987 } 969 988 970 $this->db_functions->write_log( 'Retornado senha default','',$uid,'','');989 $this->db_functions->write_log("Retornado senha default de $uid",'','','',''); 971 990 972 991 return $return; … … 1007 1026 $return['msg'] .= $result_ldap['msg']; 1008 1027 } 1009 $this->db_functions->write_log('deletado usuario ','',$user_info['uid'],'','');1028 $this->db_functions->write_log('deletado usuario ' . $user_info['uid'],'','','',''); 1010 1029 } 1011 1030 } … … 1122 1141 $this->ldap_functions->set_user_password($new_uid, $user_password); 1123 1142 1124 $this->db_functions->write_log( 'renomeado usuario',$new_uid,$uid,'','');1143 $this->db_functions->write_log("renomeado login do usuario $uid para $new_uid.",'','','',''); 1125 1144 1126 1145 $return['exec_return'] = "";
Note: See TracChangeset
for help on using the changeset viewer.