- Timestamp:
- 07/18/08 11:36:30 (16 years ago)
- Location:
- trunk/expressoAdmin1_2
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoAdmin1_2/inc/class.functions.inc.php
r317 r355 747 747 return $key . '*'; 748 748 } 749 750 751 function checkCPF($cpf) 752 { 753 $nulos = array("12345678909","11111111111","22222222222","33333333333", 754 "44444444444","55555555555","66666666666","77777777777", 755 "88888888888","99999999999","00000000000"); 756 757 /* Retira todos os caracteres que nao sejam 0-9 */ 758 $cpf = ereg_replace("[^0-9]", "", $cpf); 759 760 /*Retorna falso se houver letras no cpf */ 761 if (!(ereg("[0-9]",$cpf))) 762 return false; 763 764 /* Retorna falso se o cpf for nulo */ 765 if( in_array($cpf, $nulos) ) 766 return false; 767 768 /*Calcula o penúltimo dígito verificador*/ 769 $acum=0; 770 for($i=0; $i<9; $i++) 771 { 772 $acum+= $cpf[$i]*(10-$i); 773 } 774 775 $x=$acum % 11; 776 $acum = ($x>1) ? (11 - $x) : 0; 777 /* Retorna falso se o digito calculado eh diferente do passado na string */ 778 if ($acum != $cpf[9]){ 779 return false; 780 } 781 /*Calcula o último dígito verificador*/ 782 $acum=0; 783 for ($i=0; $i<10; $i++) 784 { 785 $acum+= $cpf[$i]*(11-$i); 786 } 787 788 $x=$acum % 11; 789 $acum = ($x > 1) ? (11-$x) : 0; 790 /* Retorna falso se o digito calculado eh diferente do passado na string */ 791 if ( $acum != $cpf[10]) 792 { 793 return false; 794 } 795 /* Retorna verdadeiro se o cpf eh valido */ 796 return true; 797 } 749 798 } 750 799 -
trunk/expressoAdmin1_2/inc/class.group.inc.php
r317 r355 168 168 if ($diff['context'] || $diff['cn']) 169 169 { 170 $newrdn = 'cn=' . $new_values['cn']; 171 $newparent = $new_values['context']; 172 $result = $this->ldap_functions->change_user_context($dn, $newrdn, $newparent); 173 if (!$result['status']) 174 { 175 $return['status'] = false; 176 $return['msg'] .= $result['msg']; 177 } 178 else 179 { 180 $dn = $newrdn . ',' . $newparent; 181 $this->db_functions->write_log('Renomeado grupo de usuários de '.$old_values['cn']." para $dn.",'',$dn,$old_values['cn'],''); 170 if ( (strcasecmp($old_values['cn'], $new_values['cn']) != 0) || (strcasecmp($old_values['context'], $new_values['context']) != 0) ) 171 { 172 $newrdn = 'cn=' . $new_values['cn']; 173 $newparent = $new_values['context']; 174 $result = $this->ldap_functions->change_user_context($dn, $newrdn, $newparent); 175 if (!$result['status']) 176 { 177 $return['status'] = false; 178 $return['msg'] .= $result['msg']; 179 } 180 else 181 { 182 $dn = $newrdn . ',' . $newparent; 183 $this->db_functions->write_log('Renomeado grupo de usuários de '.$old_values['cn']." para $dn.",'',$dn,$old_values['cn'],''); 184 } 182 185 } 183 186 } -
trunk/expressoAdmin1_2/inc/class.ldap_functions.inc.php
r317 r355 7 7 function ldapRebind($ldap_connection, $ldap_url) 8 8 { 9 // Enquanto estivermos utilizando referral na arvore ldap, teremos que continuar a utilizar o usuário sistemas:expresso. 10 // Depois, quando não existir mais referral, não existirá a necessidade de ldapRebind. 11 //ldap_bind($ldap_connection, $GLOBALS['phpgw_info']['server']['ldap_master_root_dn'], $GLOBALS['phpgw_info']['server']['ldap_master_root_pw']); 9 12 if ( ($_SESSION['phpgw_info']['expresso']['cc_ldap_server']['acc'] != '') && ($_SESSION['phpgw_info']['expresso']['cc_ldap_server']['pw'] != '') ) 10 13 { … … 20 23 var $manager_contexts; 21 24 22 function ldap_functions(){ 25 function ldap_functions(){ 23 26 $GLOBALS['phpgw_info']['server'] = $_SESSION['phpgw_info']['expresso']['server']; 24 27 $this->current_config = $_SESSION['phpgw_info']['expresso']['expressoAdmin']; 25 28 $common = new common(); 26 $this->ldap = $common->ldapConnect(); 29 30 if ( (!empty($GLOBALS['phpgw_info']['server']['ldap_master_host'])) && 31 (!empty($GLOBALS['phpgw_info']['server']['ldap_master_root_dn'])) && 32 (!empty($GLOBALS['phpgw_info']['server']['ldap_master_root_pw'])) ) 33 { 34 $this->ldap = $common->ldapConnect($GLOBALS['phpgw_info']['server']['ldap_master_host'], 35 $GLOBALS['phpgw_info']['server']['ldap_master_root_dn'], 36 $GLOBALS['phpgw_info']['server']['ldap_master_root_pw']); 37 } 38 else 39 { 40 $this->ldap = $common->ldapConnect(); 41 } 27 42 28 43 $this->functions = new functions; … … 31 46 } 32 47 33 /* ldap connection following referals and using Contac Center config*/ 48 /* expressoAdmin: email lists : deve utilizar o ldap Host Master com o usuario e senha do CC*/ 49 /* ldap connection following referrals and using Master config, from setup */ 34 50 function ldapMasterConnect() 35 51 { 36 if ( (is_array($_SESSION['phpgw_info']['expresso']['cc_ldap_server'])) && ($ldap_connection = ldap_connect($_SESSION['phpgw_info']['expresso']['cc_ldap_server']['host'])) ) 52 /* 53 $common = new common(); 54 if ( (!empty($GLOBALS['phpgw_info']['server']['ldap_master_host'])) && 55 (!empty($GLOBALS['phpgw_info']['server']['ldap_master_root_dn'])) && 56 (!empty($GLOBALS['phpgw_info']['server']['ldap_master_root_pw'])) ) 57 { 58 $ldap_connection = ldap_connect($GLOBALS['phpgw_info']['server']['ldap_master_host']); 59 ldap_set_option($ldap_connection, LDAP_OPT_PROTOCOL_VERSION, 3); 60 ldap_set_option($ldap_connection, LDAP_OPT_REFERRALS, true); 61 ldap_set_rebind_proc($ldap_connection, ldapRebind); 62 ldap_bind($ldap_connection, $GLOBALS['phpgw_info']['server']['ldap_master_root_dn'], $GLOBALS['phpgw_info']['server']['ldap_master_root_pw']); 63 } 64 else 65 { 66 $ldap_connection = $common->ldapConnect($GLOBALS['phpgw_info']['server']['ldap_host'], 67 $GLOBALS['phpgw_info']['server']['ldap_root_dn'], 68 $GLOBALS['phpgw_info']['server']['ldap_root_pw'], true); 69 } 70 71 // If success, return follow_referral connection. Else, return normal connection. 72 if ($ldap_connection) 73 return $ldap_connection; 74 else 75 return $this->ldap; 76 */ 77 78 if ( (!empty($GLOBALS['phpgw_info']['server']['ldap_master_host'])) && ($ldap_connection = ldap_connect($GLOBALS['phpgw_info']['server']['ldap_master_host'])) ) 37 79 { 38 80 ldap_set_option($ldap_connection, LDAP_OPT_PROTOCOL_VERSION, 3); … … 101 143 $mail = $params['mail']; 102 144 $mailalternateaddress = $params['mailalternateaddress']; 145 $cpf = $params['cpf']; 103 146 104 147 if ($_SESSION['phpgw_info']['expresso']['global_denied_users'][$uid]) … … 265 308 } 266 309 310 //Begin: Check CPF 311 if (!empty($cpf)) 312 { 313 if (!$this->functions->checkCPF($cpf)) 314 { 315 $result['status'] = false; 316 $result['msg'] = $this->functions->lang('Field CPF is invalid') . '.'; 317 return $result; 318 } 319 else 320 { 321 $local_ldap_connection = ldap_connect($GLOBALS['phpgw_info']['server']['ldap_host']); 322 if ($ldap_connection) 323 { 324 ldap_set_option($local_ldap_connection, LDAP_OPT_PROTOCOL_VERSION, 3); 325 ldap_set_option($local_ldap_connection, LDAP_OPT_REFERRALS, false); 326 ldap_bind($local_ldap_connection, $GLOBALS['phpgw_info']['server']['ldap_root_dn'], $GLOBALS['phpgw_info']['server']['ldap_root_pw']); 327 } 328 else 329 { 330 $result['status'] = false; 331 $result['msg'] = 'Falha na conexao com o ldap.'; 332 return $result; 333 } 334 335 $filter = "(&(phpgwAccountType=u)(cpf=$cpf))"; 336 $justthese = array("cn","uid"); 337 $search = ldap_search($local_ldap_connection, $context, $filter, $justthese); 338 $entries = ldap_get_entries($local_ldap_connection,$search); 339 340 if ( ($entries['count'] == 1) && (strcasecmp($uid, $entries[0]['uid'][0]) == 0) ) 341 {} 342 else 343 { 344 if ($entries['count'] > 0) 345 { 346 $result['question'] = $this->functions->lang('Field CPF used by') . ":\n"; 347 for ($i=0; $i<$entries['count']; $i++) 348 { 349 if (strcasecmp($uid, $entries[$i]['uid'][0]) != 0) 350 $result['question'] .= "- " . $entries[$i]['cn'][0] . "\n"; 351 } 352 $result['question'] .= $this->functions->lang("Do you want to continue anyway") . "?"; 353 return $result; 354 } 355 } 356 ldap_close($local_ldap_connection); 357 } 358 } 359 else if ($this->current_config['expressoAdmin_cpf_obligation']) 360 { 361 $result['status'] = false; 362 $result['msg'] = $this->functions->lang('Field CPF must be completed') . '.'; 363 return $result; 364 } 365 //End: Check CPF 366 267 367 return $result; 268 368 } … … 1357 1457 1358 1458 $return['status'] = true; 1359 1459 $return['msg'] = ""; 1460 1360 1461 // GROUPS 1361 1462 $attrs = array(); 1362 $attrs['memberUid'] = $user_info['uid']; 1463 $attrs['memberuid'] = $user_info['uid']; 1464 1363 1465 if (count($user_info['groups_info'])) 1364 1466 { … … 1371 1473 $entry = ldap_get_entries($this->ldap, $search); 1372 1474 $dn = $entry[0]['dn']; 1373 1475 1374 1476 if (!@ldap_mod_del($this->ldap, $dn, $attrs)) 1375 1477 { 1376 1478 $return['status'] = false; 1377 $return['msg'] .= 'Erro em ldap_funcitons->delete_user, grupos: '. ldap_error($this->ldap);1479 $return['msg'] .= "Erro em ldap_functions->delete_user from group ($dn): " . ldap_error($this->ldap); 1378 1480 } 1379 1481 } -
trunk/expressoAdmin1_2/inc/class.maillist.inc.php
r283 r355 144 144 if ($diff['context'] || $diff['uid']) 145 145 { 146 $newrdn = 'uid=' . $new_values['uid']; 147 $newparent = $new_values['context']; 148 $result = $this->ldap_functions->change_user_context($dn, $newrdn, $newparent); 149 if (!$result['status']) 150 { 151 $return['status'] = false; 152 $return['msg'] .= $result['msg']; 153 } 154 else 155 { 156 $dn = $newrdn . ',' . $newparent; 157 $old_dn = $old_values['uid']; 158 $this->db_functions->write_log("Renomeado login da lista de $old_dn para $dn",'',$dn,$old_values['uid'],''); 146 if ( (strcasecmp($old_values['uid'], $new_values['uid']) != 0) || (strcasecmp($old_values['context'], $new_values['context']) != 0) ) 147 { 148 $newrdn = 'uid=' . $new_values['uid']; 149 $newparent = $new_values['context']; 150 $result = $this->ldap_functions->change_user_context($dn, $newrdn, $newparent); 151 if (!$result['status']) 152 { 153 $return['status'] = false; 154 $return['msg'] .= $result['msg']; 155 } 156 else 157 { 158 $dn = $newrdn . ',' . $newparent; 159 $old_dn = $old_values['uid']; 160 $this->db_functions->write_log("Renomeado login da lista de $old_dn para $dn",'',$dn,$old_values['uid'],''); 161 } 159 162 } 160 163 } -
trunk/expressoAdmin1_2/inc/class.uilogs.inc.php
r309 r355 92 92 } 93 93 94 $query .= " ORDER by manager ASC,date DESC";94 $query .= " ORDER by date DESC"; 95 95 96 96 $GLOBALS['phpgw']->db->query($query); … … 136 136 //_debug_array($log); 137 137 $this->nextmatchs->template_alternate_row_color($p); 138 138 139 //Date treatment 140 $a_date = split(" ", $log['date']); 141 $a_day = split("-", $a_date[0]); 142 $a_day_tmp = array_reverse($a_day); 143 $a_day = join($a_day_tmp, "/"); 144 $a_hour = split("\.", $a_date[1]); 145 139 146 $var = array( 140 147 'row_manager_lid' => $log['manager'], 141 148 'row_action' => $log['action'], 142 'row_date' => $ log['date'],149 'row_date' => $a_day . ' ' . $a_hour[0], 143 150 //'row_view' => (!$account['account_lastname']?' ':$account['account_lastname']) 144 151 ); -
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'] = ""; -
trunk/expressoAdmin1_2/js/jscode/users.js
r309 r355 56 56 } 57 57 58 /* Validation cpf is in php now. 59 /* 58 60 if (document.forms[0].corporative_information_cpf.value != "") 59 61 { … … 73 75 return; 74 76 } 75 } 77 }*/ 76 78 77 79 //MAIL … … 150 152 } 151 153 152 // Uid & Mailexist?154 // Uid, Mail and CPF exist? 153 155 var attrs_array = new Array(); 154 156 attrs_array['type'] = type; 155 157 attrs_array['uid'] = document.forms[0].uid.value; 156 158 attrs_array['mail'] = document.forms[0].mail.value; 159 attrs_array['cpf'] = document.forms[0].corporative_information_cpf.value; 160 157 161 if (document.forms[0].mailalternateaddress.value != '') 158 162 attrs_array['mailalternateaddress'] = document.forms[0].mailalternateaddress.value; … … 165 169 else 166 170 { 171 if ( (data.question) && (!confirm(data.question)) ) 172 { 173 return false; 174 } 175 167 176 if (type == 'create_user') 168 177 { -
trunk/expressoAdmin1_2/templates/default/accounts_form.tpl
r317 r355 250 250 <td colspan="4" align="left"> 251 251 {lang_primary_group}: 252 <select id="ea_combo_primary_user_group" name="gidnumber" {disabled }>{ea_combo_primary_user_group_options}</select>252 <select id="ea_combo_primary_user_group" name="gidnumber" {disabled_samba}>{ea_combo_primary_user_group_options}</select> 253 253 </td> 254 254 </tr> -
trunk/expressoAdmin1_2/templates/default/config.tpl
r283 r355 125 125 </td> 126 126 </tr> 127 <tr class="row_off"> 128 <td>{lang_Does_CPF_field_must_be_completed}?</td> 129 <td> 130 <select name="newsettings[expressoAdmin_cpf_obligation]"> 131 <option value="0" {selected_expressoAdmin_cpf_obligation_0}>{lang_no}</option> 132 <option value="1" {selected_expressoAdmin_cpf_obligation_1}>{lang_yes}</option> 133 </select> 134 </td> 135 </tr> 127 136 128 137 <tr class="th">
Note: See TracChangeset
for help on using the changeset viewer.