Changeset 63 for trunk/expressoAdmin1_2
- Timestamp:
- 08/29/07 08:55:50 (17 years ago)
- Location:
- trunk/expressoAdmin1_2
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoAdmin1_2/docs/change_log.txt
r62 r63 87 87 - Corrigido bug ao adicionar email em grupos 88 88 - Corrigido bug ao adicionar atributos samba a um usuários já existente. 89 90 14/08/2007 91 - Criado aba Informações Corporativas, com os campo employeeNumber, cpf, rg, rgUf 92 - Melhorado classe user.inc.php. -
trunk/expressoAdmin1_2/inc/class.bomanagers.inc.php
r62 r63 30 30 'lid' => $_POST['manager_lid'], 31 31 'context' => $_POST['context'], 32 32 33 'add_users' => $_POST['add_users'], 33 34 'edit_users' => $_POST['edit_users'], … … 35 36 'rename_users' => $_POST['rename_users'], 36 37 'view_users' => $_POST['view_users'], 38 'manipulate_corporative_information' => $_POST['manipulate_corporative_information'], 37 39 'add_groups' => $_POST['add_groups'], 38 40 'edit_groups' => $_POST['edit_groups'], … … 42 44 'change_users_quote' => $_POST['change_users_quote'], 43 45 'set_user_default_password' => $_POST['set_user_default_password'], 46 'empty_user_inbox' => $_POST['empty_user_inbox'], 44 47 'edit_sambausers_attributes'=> $_POST['edit_sambausers_attributes'], 45 48 'edit_sambadomains' => $_POST['edit_sambadomains'], … … 54 57 'create_computers' => $_POST['create_computers'], 55 58 'edit_computers' => $_POST['edit_computers'], 56 'delete_computers' => $_POST['delete_computers'], 59 'delete_computers' => $_POST['delete_computers'], 60 57 61 'apps' => $_POST['applications_list'] 58 62 ); … … 60 64 // Soma os niveis de acesso criando uma ACL 61 65 $acl = 0; 62 $acl = $acl + $manager['add_users'] + $manager['edit_users'] + $manager['delete_users'] + $manager['rename_users'] + $manager['view_users'] ;66 $acl = $acl + $manager['add_users'] + $manager['edit_users'] + $manager['delete_users'] + $manager['rename_users'] + $manager['view_users'] + $manager['manipulate_corporative_information']; 63 67 $acl = $acl + $manager['add_groups'] + $manager['edit_groups'] + $manager['delete_groups'] + $manager['edit_email_groups']; 64 $acl = $acl + $manager['change_users_password'] + $manager['change_users_quote'] + $manager['set_user_default_password'] ;68 $acl = $acl + $manager['change_users_password'] + $manager['change_users_quote'] + $manager['set_user_default_password'] + $manager['empty_user_inbox']; 65 69 $acl = $acl + $manager['edit_sambausers_attributes'] + $manager['edit_sambadomains']; 66 70 $acl = $acl + $manager['add_email_lists'] + $manager['edit_email_lists'] + $manager['delete_email_lists']; … … 102 106 'lid' => $_POST['manager_lid'], 103 107 'context' => $_POST['context'], 108 104 109 'add_users' => $_POST['add_users'], 105 110 'edit_users' => $_POST['edit_users'], … … 107 112 'rename_users' => $_POST['rename_users'], 108 113 'view_users' => $_POST['view_users'], 114 'manipulate_corporative_information' => $_POST['manipulate_corporative_information'], 109 115 'add_groups' => $_POST['add_groups'], 110 116 'edit_groups' => $_POST['edit_groups'], … … 114 120 'change_users_quote' => $_POST['change_users_quote'], 115 121 'set_user_default_password' => $_POST['set_user_default_password'], 122 'empty_user_inbox' => $_POST['empty_user_inbox'], 116 123 'edit_sambausers_attributes'=> $_POST['edit_sambausers_attributes'], 117 124 'edit_sambadomains' => $_POST['edit_sambadomains'], … … 127 134 'edit_computers' => $_POST['edit_computers'], 128 135 'delete_computers' => $_POST['delete_computers'], 136 129 137 'apps' => $_POST['applications_list'] 130 138 ); … … 132 140 // Soma os niveis de acesso criando uma ACL 133 141 $acl = 0; 134 $acl = $acl + $manager['add_users'] + $manager['edit_users'] + $manager['delete_users'] + $manager['rename_users'] + $manager['view_users'] ;142 $acl = $acl + $manager['add_users'] + $manager['edit_users'] + $manager['delete_users'] + $manager['rename_users'] + $manager['view_users'] + $manager['manipulate_corporative_information']; 135 143 $acl = $acl + $manager['add_groups'] + $manager['edit_groups'] + $manager['delete_groups'] + $manager['edit_email_groups']; 136 $acl = $acl + $manager['change_users_password'] + $manager['change_users_quote'] + $manager['set_user_default_password'] ;144 $acl = $acl + $manager['change_users_password'] + $manager['change_users_quote'] + $manager['set_user_default_password'] + $manager['empty_user_inbox']; 137 145 $acl = $acl + $manager['edit_sambausers_attributes'] + $manager['edit_sambadomains']; 138 146 $acl = $acl + $manager['add_email_lists'] + $manager['edit_email_lists'] + $manager['delete_email_lists']; -
trunk/expressoAdmin1_2/inc/class.functions.inc.php
r62 r63 66 66 return true; 67 67 break; 68 case manipulate_corporative_information: 69 if ($array_acl[manipulate_corporative_information]) 70 return true; 71 break; 68 72 case change_users_password: 69 73 if ($array_acl[change_users_password]) … … 76 80 case set_user_default_password: 77 81 if ($array_acl[set_user_default_password]) 82 return true; 83 break; 84 case empty_user_inbox: 85 if (($array_acl[empty_user_inbox]) && ($array_acl[edit_users])) 78 86 return true; 79 87 break; … … 186 194 187 195 // Make a array read humam 188 // Last acl: 33.554.432, 67.108.864 196 // Last acl: 33.554.432, 67.108.864, 134.217.728, 134.217.728, 268.435.456 189 197 function make_array_acl($acl) 190 198 { … … 194 202 $array_acl['rename_users'] = $acl & 8388608; 195 203 $array_acl['view_users'] = $acl & 33554432; 204 $array_acl['manipulate_corporative_information'] = $acl & 268435456; 196 205 $array_acl['add_groups'] = $acl & 16; 197 206 $array_acl['edit_groups'] = $acl & 32; … … 201 210 $array_acl['change_users_quote'] = $acl & 262144; 202 211 $array_acl['set_user_default_password'] = $acl & 524288; 212 $array_acl['empty_user_inbox'] = $acl & 134217728; 203 213 $array_acl['edit_sambausers_attributes'] = $acl & 32768; 204 214 $array_acl['edit_sambadomains'] = $acl & 16777216; -
trunk/expressoAdmin1_2/inc/class.imap_functions.inc.php
r62 r63 1 1 <?php 2 3 include_once('class.functions.inc.php'); 2 4 3 5 class imap_functions 4 6 { 7 var $functions; 5 8 var $imap; 6 9 var $imapDelimiter; … … 17 20 $this->imapDelimiter= $_SESSION['phpgw_info']['expresso']['email_server']['imapDelimiter']; 18 21 $this->imap = imap_open('{'.$this->imap_server.':'.$this->imap_port.'/novalidate-cert}', $this->imap_admin, $this->imap_passwd, OP_HALFOPEN); 22 $this->functions = new functions; 19 23 } 20 24 … … 72 76 else 73 77 { 74 $quota['mailquota'] = ($get_quota['limit'] / 1024);75 $quota['mailquota_used'] = ($get_quota['usage'] / 1024);78 $quota['mailquota'] = round (($get_quota['limit'] / 1024), 2); 79 $quota['mailquota_used'] = round (($get_quota['usage'] / 1024), 2); 76 80 } 77 81 … … 116 120 return $result; 117 121 } 122 123 function empty_inbox($params) 124 { 125 // Verifica o acesso do gerente 126 if (!$this->functions->check_acl($_SESSION['phpgw_session']['session_lid'], 'empty_user_inbox')) 127 { 128 $result['status'] = false; 129 $result['msg'] = 'Você não tem acesso para executar esta operação.'; 130 return $result; 131 } 132 133 if ($_SESSION['phpgw_info']['expressomail']['email_server']['imapTLSEncryption'] == 'yes') 134 { 135 $imap_options = '/tls/novalidate-cert'; 136 } 137 else 138 { 139 $imap_options = '/notls/novalidate-cert'; 140 } 141 142 143 $result['status'] = true; 144 $uid = $params['uid']; 145 146 $return_setacl = imap_setacl($this->imap, "user" . $this->imapDelimiter . $uid, $this->imap_admin, 'lrswipcda'); 147 148 if ($return_setacl) 149 { 150 //$mbox_stream = imap_open('{'.$this->imap_server.':'.$this->imap_port.$imap_options.'/user="'.$uid.'"}', $this->imap_admin, $this->imap_passwd); 151 $mbox_stream = imap_open('{'.$this->imap_server.':'.$this->imap_port.$imap_options .'}user'. $this->imapDelimiter . $uid, $this->imap_admin, $this->imap_passwd); 152 153 $check = imap_mailboxmsginfo($mbox_stream); 154 $inbox_size = (string)(round ((($check->Size)/(1024*1024)), 2)); 155 156 $return_imap_delete = imap_delete($mbox_stream,'1:*'); 157 imap_close($mbox_stream, CL_EXPUNGE); 158 159 imap_setacl ($this->imap, "user" . $this->imapDelimiter . $uid, $this->imap_admin, ''); 160 161 if ($return_imap_delete) 162 { 163 $result['inbox_size'] = $inbox_size; 164 165 $get_user_quota = @imap_get_quotaroot($this->imap,"user" . $this->imapDelimiter . $uid); 166 $result['mailquota_used'] = (string)(round(($get_user_quota['usage']/1024), 2)); 167 } 168 else 169 { 170 $result['status'] = false; 171 $result['msg'] = "Nao foi possivel esvaziar a caixa postal do usuario:\n" . imap_last_error(); 172 } 173 } 174 else 175 { 176 $result['status'] = false; 177 $result['msg'] = "Nao foi possivel modificar a acl do usuario:\n" . imap_last_error(); 178 } 179 return $result; 180 } 118 181 } -
trunk/expressoAdmin1_2/inc/class.ldap_functions.inc.php
r62 r63 3 3 define('PHPGW_API_INC','../phpgwapi/inc'); 4 4 include_once(PHPGW_API_INC.'/class.common.inc.php'); 5 include_once('class.functions.inc.php'); 5 6 6 7 class ldap_functions … … 8 9 var $ldap; 9 10 var $current_config; 11 var $functions; 10 12 11 13 function ldap_functions(){ … … 14 16 $common = new common(); 15 17 $this->ldap = $common->ldapConnect(); 18 $this->functions = new functions; 16 19 } 17 20 18 21 function validate_fields($params) 19 22 { 23 $result['status'] = true; 20 24 $params = unserialize($params['attributes']); 21 25 $type = $params['type']; … … 24 28 $mail = $params['mail']; 25 29 $mailalternateaddress = $params['mailalternateaddress']; 26 27 $result['status'] = true; 28 30 29 31 if ($_SESSION['phpgw_info']['expresso']['global_denied_users'][$uid]) 30 32 { … … 657 659 array_pop($a_tmp); 658 660 $result['sambasid'] = implode("-", $a_tmp); 661 } 662 663 // Verifica o acesso do gerente aos atributos corporativos 664 if ($this->functions->check_acl($_SESSION['phpgw_session']['session_lid'], 'manipulate_corporative_information')) 665 { 666 $result['corporative_information_employeenumber']= $entry[0]['employeenumber'][0]; 667 $result['corporative_information_cpf'] = $entry[0]['cpf'][0]; 668 $result['corporative_information_rg'] = $entry[0]['rg'][0]; 669 $result['corporative_information_rguf'] = $entry[0]['rguf'][0]; 659 670 } 660 671 -
trunk/expressoAdmin1_2/inc/class.uiaccounts.inc.php
r62 r63 242 242 'display_spam_uid' => 'display:none', 243 243 'lang_general_information' => lang('General Information'), 244 'lang_corporative_information' => lang('Corporative Information'), 244 245 'lang_email_config' => lang('Email Config'), 245 246 'lang_groups_permission' => lang('Groups Permission'), … … 274 275 'ldap_context' => ldap_dn2ufn($GLOBALS['phpgw_info']['server']['ldap_context']), 275 276 277 // Corporative Information 278 'display_corporative_information' => $this->functions->check_acl($manager_lid,'manipulate_corporative_information') ? '' : 'none', 279 'lang_employeenumber' => lang('Employee number'), 280 'lang_cpf' => lang('cpf'), 281 'lang_rg' => lang('rg'), 282 'lang_rguf' => lang('rguf'), 283 276 284 //MAIL 277 285 'lang_activeemailaccount' => lang('Active email account'), … … 305 313 306 314 //SAMBA ABA 315 'display_samba_suport' => $this->functions->check_acl($manager_lid,'edit_sambausers_attributes') ? '' : 'none', 307 316 'lang_samba_config' => lang('Samba Config'), 308 317 'lang_use_attrs_samba' => lang('Use samba attributes'), … … 536 545 'display_input_account_lid' => 'display:none', 537 546 'lang_general_information' => lang('General Information'), 547 'lang_corporative_information' => lang('Corporative Information'), 538 548 'lang_email_config' => lang('Email Config'), 539 549 'lang_groups_permission' => lang('Groups Permission'), … … 572 582 'phpgwaccountvisible_checked' => $user_info['phpgwaccountvisible'] == '-1' ? 'CHECKED' : '', 573 583 574 //MAIL BORD 584 // Corporative Information 585 'display_corporative_information'=> $this->functions->check_acl($manager_account_lid,'edit_sambausers_attributes') ? '' : 'none', 586 'lang_employeenumber' => lang('Employee number'), 587 'lang_cpf' => lang('cpf'), 588 'lang_rg' => lang('rg'), 589 'lang_rguf' => lang('rguf'), 590 'corporative_information_employeenumber' => $user_info['corporative_information_employeenumber'], 591 'corporative_information_cpf' => $user_info['corporative_information_cpf'], 592 'corporative_information_rg' => $user_info['corporative_information_rg'], 593 'corporative_information_rguf' => $user_info['corporative_information_rguf'], 594 595 //MAIL 575 596 'disabled_quota_used' => 'disabled', 576 597 'lang_activeemailaccount' => lang('Active email account'), -
trunk/expressoAdmin1_2/inc/class.uimanagers.inc.php
r62 r63 207 207 'lang_rename_user' => lang('Rename users'), 208 208 'lang_view_user' => lang('View users'), 209 'lang_manipulate_corporative_information' => lang('Manipulate corporative information'), 209 210 'lang_add_groups' => lang('Add groups'), 210 211 'lang_edit_groups' => lang('Edit groups'), … … 214 215 'lang_change_users_quote' => lang('Change users quote'), 215 216 'lang_set_user_default_password'=> lang('Set default users password'), 217 'lang_empty_user_inbox' => lang('Empty user inbox'), 216 218 'lang_edit_sambausers_attributes'=> lang('Edit SAMBA users attributes'), 217 219 'lang_edit_sambadomains' => lang('Edit SAMBA domains'), … … 233 235 'add_users' => $_POST['add_users'] != '' ? 'checked' : '', 234 236 'edit_users' => $_POST['edit_users'] != '' ? 'checked' : '', 237 'view_users' => $_POST['view_users'] != '' ? 'checked' : '', 238 'manipulate_corporative_information' => $_POST['manipulate_corporative_information'] != '' ? 'checked' : '', 235 239 'delete_users' => $_POST['delete_users'] != '' ? 'checked' : '', 236 240 'add_groups' => $_POST['add_groups'] != '' ? 'checked' : '', … … 335 339 $_POST['rename_users'] = $acl['rename_users']; 336 340 $_POST['view_users'] = $acl['view_users']; 341 $_POST['manipulate_corporative_information'] = $acl['manipulate_corporative_information']; 337 342 $_POST['add_groups'] = $acl['add_groups']; 338 343 $_POST['edit_groups'] = $acl['edit_groups']; … … 342 347 $_POST['change_users_quote'] = $acl['change_users_quote']; 343 348 $_POST['set_user_default_password'] = $acl['set_user_default_password']; 349 $_POST['empty_user_inbox'] = $acl['empty_user_inbox']; 344 350 $_POST['edit_sambausers_attributes'] = $acl['edit_sambausers_attributes']; 345 351 $_POST['edit_sambadomains'] = $acl['edit_sambadomains']; … … 453 459 'lang_rename_user' => lang('Rename users'), 454 460 'lang_view_user' => lang('View users'), 461 'lang_manipulate_corporative_information' => lang('Manipulate corporative information'), 455 462 'lang_add_groups' => lang('Add groups'), 456 463 'lang_edit_groups' => lang('Edit groups'), … … 460 467 'lang_change_users_quote' => lang('Change users quote'), 461 468 'lang_set_user_default_password'=> lang('Set default user password'), 469 'lang_empty_user_inbox' => lang('Empty user inbox'), 462 470 'lang_edit_sambausers_attributes'=> lang('Edit SAMBA users attributes'), 463 471 'lang_edit_sambadomains' => lang('Edit SAMBA domains'), … … 483 491 'rename_users' => $_POST['rename_users'] != '' ? 'checked' : '', 484 492 'view_users' => $_POST['view_users'] != '' ? 'checked' : '', 493 'manipulate_corporative_information' => $_POST['manipulate_corporative_information'] != '' ? 'checked' : '', 485 494 'add_groups' => $_POST['add_groups'] != '' ? 'checked' : '', 486 495 'edit_groups' => $_POST['edit_groups'] != '' ? 'checked' : '', … … 490 499 'change_users_quote' => $_POST['change_users_quote'] != '' ? 'checked' : '', 491 500 'set_user_default_password' => $_POST['set_user_default_password'] != '' ? 'checked' : '', 501 'empty_user_inbox' => $_POST['empty_user_inbox'] != '' ? 'checked' : '', 492 502 'edit_sambausers_attributes' => $_POST['edit_sambausers_attributes'] != '' ? 'checked' : '', 493 503 'edit_sambadomains' => $_POST['edit_sambadomains'] != '' ? 'checked' : '', -
trunk/expressoAdmin1_2/inc/class.user.inc.php
r62 r63 117 117 if (($this->current_config['expressoAdmin_samba_support'] == 'true') && ($params['use_attrs_samba'] == 'on')) 118 118 { 119 //Verifica se o binario para criar as senhas do samba exite. 120 if (!is_file('/home/expressolivre/mkntpwd')) 121 { 122 $return['status'] = false; 123 $return['msg'] .= "O arquivo binário /home/expressolivre/mkntpwd não exite.\\nEle é necessário para a criação das senhas usadas pelo SAMBA.\\nInforme o administrador ExpressoLivre sobre isto."; 124 } 125 else 126 { 127 $user_info['objectClass'][] = 'sambaSamAccount'; 128 $user_info['loginShell'] = '/bin/bash'; 129 130 $user_info['sambaSID'] = $params['sambadomain'] . '-' . ((2 * $id)+1000); 131 $user_info['sambaPrimaryGroupSID'] = $params['sambadomain'] . '-' . ((2 * $user_info['gidNumber'])+1001); 132 133 $user_info['sambaAcctFlags'] = $params['sambaacctflags']; 134 135 $user_info['sambaLogonScript'] = $params['sambalogonscript']; 136 $user_info['homeDirectory'] = $params['sambahomedirectory']; 137 138 $user_info['sambaLMPassword'] = exec('/home/expressolivre/mkntpwd -L '.$params['password1']); 139 $user_info['sambaNTPassword'] = exec('/home/expressolivre/mkntpwd -N '.$params['password1']); 140 $user_info['sambaPasswordHistory'] = '0000000000000000000000000000000000000000000000000000000000000000'; 141 142 $user_info['sambaPwdCanChange'] = strtotime("now"); 143 $user_info['sambaPwdLastSet'] = strtotime("now"); 144 $user_info['sambaPwdMustChange'] = '2147483647'; 145 } 146 } 119 // Verifica o acesso do gerente aos atributos samba 120 if ($this->functions->check_acl($_SESSION['phpgw_session']['session_lid'], 'edit_sambausers_attributes')) 121 { 122 //Verifica se o binario para criar as senhas do samba exite. 123 if (!is_file('/home/expressolivre/mkntpwd')) 124 { 125 $return['status'] = false; 126 $return['msg'] .= "O arquivo binário /home/expressolivre/mkntpwd não exite.\\nEle é necessário para a criação das senhas usadas pelo SAMBA.\\nInforme o administrador ExpressoLivre sobre isto."; 127 } 128 else 129 { 130 $user_info['objectClass'][] = 'sambaSamAccount'; 131 $user_info['loginShell'] = '/bin/bash'; 132 133 $user_info['sambaSID'] = $params['sambadomain'] . '-' . ((2 * $id)+1000); 134 $user_info['sambaPrimaryGroupSID'] = $params['sambadomain'] . '-' . ((2 * $user_info['gidNumber'])+1001); 135 136 $user_info['sambaAcctFlags'] = $params['sambaacctflags']; 137 138 $user_info['sambaLogonScript'] = $params['sambalogonscript']; 139 $user_info['homeDirectory'] = $params['sambahomedirectory']; 140 141 $user_info['sambaLMPassword'] = exec('/home/expressolivre/mkntpwd -L '.$params['password1']); 142 $user_info['sambaNTPassword'] = exec('/home/expressolivre/mkntpwd -N '.$params['password1']); 143 $user_info['sambaPasswordHistory'] = '0000000000000000000000000000000000000000000000000000000000000000'; 144 145 $user_info['sambaPwdCanChange'] = strtotime("now"); 146 $user_info['sambaPwdLastSet'] = strtotime("now"); 147 $user_info['sambaPwdMustChange'] = '2147483647'; 148 } 149 } 150 } 151 152 // Verifica o acesso do gerente aos atributos corporativos 153 if ($this->functions->check_acl($_SESSION['phpgw_session']['session_lid'], 'manipulate_corporative_information')) 154 { 155 foreach ($params as $atribute=>$value) 156 { 157 $pos = strrpos($atribute, 'corporative_information_'); 158 if ($pos !== false) 159 { 160 if ($params[$atribute]) 161 { 162 $ldap_atribute = str_replace("corporative_information_", "", $atribute); 163 $user_info[$ldap_atribute] = $params[$atribute]; 164 } 165 } 166 } 167 } 168 147 169 $result = $this->ldap_functions->ldap_add_entry($dn, $user_info); 148 170 if (!$result['status']) … … 239 261 $old_values = $this->get_user_info($new_values['uidnumber'], $new_values['manager_context']); 240 262 $dn = 'uid=' . $old_values['uid'] . ',' . strtolower($old_values['context']); 241 263 242 264 $diff = array_diff($new_values, $old_values); 243 265 244 266 $manager_account_lid = $_SESSION['phpgw_session']['session_lid']; 245 267 if ((!$this->functions->check_acl($manager_account_lid,'edit_users')) && … … 254 276 255 277 // Verifica o acesso do gerente 256 if (!$this->functions->check_acl($_SESSION['phpgw_session']['session_lid'], 'edit_users'))257 {258 259 }260 261 // Verifica o acesso do gerente262 278 if ($this->functions->check_acl($_SESSION['phpgw_session']['session_lid'], 'edit_users')) 263 279 { … … 293 309 $ldap_mod_replace['sn'] = $new_values['sn']; 294 310 $ldap_mod_replace['cn'] = $new_values['givenname'] . ' ' . $new_values['sn']; 295 $this->db_functions->write_log("altera do sn do usuario",'',$dn,'','');311 $this->db_functions->write_log("altera$ldap_mod_do sn do usuario",'',$dn,'',''); 296 312 } 297 313 if ($diff['mail']) … … 349 365 } 350 366 } 351 367 368 // REPLACE, ADD & REMOVE COPORATIVEs ATRIBUTES 369 // Verifica o acesso do gerente aos atributos corporativos 370 if ($this->functions->check_acl($_SESSION['phpgw_session']['session_lid'], 'manipulate_corporative_information')) 371 { 372 foreach ($new_values as $atribute=>$value) 373 { 374 $pos = strrpos($atribute, 'corporative_information_'); 375 if ($pos !== false) 376 { 377 $ldap_atribute = str_replace("corporative_information_", "", $atribute); 378 // REPLACE ATTRS OF CORPORATIVE 379 if (($diff[$atribute]) && ($old_values[$atribute] != '')) 380 { 381 $ldap_atribute = str_replace("corporative_information_", "", $atribute); 382 $ldap_mod_replace[$ldap_atribute] = $new_values[$atribute]; 383 $this->db_functions->write_log("alterado $ldap_atribute do usuario",'',$dn,'',''); 384 } 385 //ADD ATTRS OF CORPORATIVE 386 elseif (($old_values[$atribute] == '') && ($new_values[$atribute] != '')) 387 { 388 $ldap_add[$ldap_atribute] = $new_values[$atribute]; 389 $this->db_functions->write_log("adicionado $ldap_atribute ao usuario",'',$dn,'',''); 390 } 391 //REMOVE ATTRS OF CORPORATIVE 392 elseif (($old_values[$atribute] != '') && ($new_values[$atribute] == '')) 393 { 394 $ldap_remove[$ldap_atribute] = array(); 395 $this->db_functions->write_log("removido $ldap_atribute do usuario",'',$dn,'',''); 396 } 397 } 398 } 399 } 400 352 401 //Suporte ao SAMBA 353 402 if ( ($this->functions->check_acl($_SESSION['phpgw_session']['session_lid'], 'edit_users')) || … … 512 561 } 513 562 } 514 563 515 564 if ( ($this->functions->check_acl($_SESSION['phpgw_session']['session_lid'], 'edit_users')) || 516 565 ($this->functions->check_acl($_SESSION['phpgw_session']['session_lid'], 'edit_sambausers_attributes')) ) … … 640 689 if (count($ldap_remove)) 641 690 { 642 643 691 $result = $this->ldap_functions->remove_user_attributes($dn, $ldap_remove); 644 692 if (!$result['status']) … … 727 775 return $return; 728 776 } 729 730 777 731 778 function get_user_info($uidnumber, $context) … … 1076 1123 } 1077 1124 } 1125 1126 function write_log_from_ajax($params) 1127 { 1128 $this->db_functions->write_log($params['_action'],'',$params['userinfo'],'',''); 1129 return true; 1130 } 1078 1131 } 1079 1132 ?> -
trunk/expressoAdmin1_2/js/jscode/users.js
r62 r63 41 41 return; 42 42 } 43 43 44 // Corporative Information 45 if (document.forms[0].corporative_information_employeenumber.value != "") 46 { 47 var re_employeenumber = /^([0-9])+$/; 48 49 if(!re_employeenumber.test(document.forms[0].corporative_information_employeenumber.value)) 50 { 51 alert('Campo matrícula contém caracteres não permitidos. Somente números são permitidos.'); 52 document.forms[0].corporative_information_employeenumber.focus(); 53 return; 54 } 55 } 56 57 if (document.forms[0].corporative_information_cpf.value != "") 58 { 59 var re_cpf = /^([0-9])+$/; 60 61 if(!re_cpf.test(document.forms[0].corporative_information_cpf.value)) 62 { 63 alert('Campo cpf contém caracteres não permitidos. Somente números são permitidos'); 64 document.forms[0].corporative_information_employeenumber.focus(); 65 return; 66 } 67 68 if (! validarCPF(document.forms[0].corporative_information_cpf.value) ) 69 { 70 alert("Campo CPF invalido."); 71 document.forms[0].corporative_information_cpf.focus(); 72 return; 73 } 74 } 75 44 76 //MAIL 45 77 document.forms[0].mail.value = document.forms[0].mail.value.toLowerCase(); … … 606 638 } 607 639 } 640 641 function empty_inbox(uid) 642 { 643 var action = "Limpado INBOX do usuario"; 644 var handler_write_log = function(){} 645 var handler_empty_inbox = function(data) 646 { 647 if (!data.status) 648 alert(data.msg); 649 else{ 650 cExecute ('$this.user.write_log_from_ajax&_action='+action+'&userinfo='+uid, handler_write_log); 651 alert("Esvaziados '" + data.inbox_size + "' MB da caixa postal do usuário"); 652 document.getElementById('mailquota_used').value = data.mailquota_used; 653 } 654 } 655 cExecute ('$this.imap_functions.empty_inbox&uid='+uid, handler_empty_inbox); 656 } 657 658 function validarCPF(cpf) 659 { 660 if(cpf.length != 11 || cpf == "00000000000" || cpf == "11111111111" || 661 cpf == "22222222222" || cpf == "33333333333" || cpf == "44444444444" || 662 cpf == "55555555555" || cpf == "66666666666" || cpf == "77777777777" || 663 cpf == "88888888888" || cpf == "99999999999"){ 664 return false; 665 } 666 667 soma = 0; 668 for(i = 0; i < 9; i++) 669 soma += parseInt(cpf.charAt(i)) * (10 - i); 670 resto = 11 - (soma % 11); 671 if(resto == 10 || resto == 11) 672 resto = 0; 673 if(resto != parseInt(cpf.charAt(9))) 674 { 675 return false; 676 } 677 678 soma = 0; 679 for(i = 0; i < 10; i ++) 680 soma += parseInt(cpf.charAt(i)) * (11 - i); 681 resto = 11 - (soma % 11); 682 if(resto == 10 || resto == 11) 683 resto = 0; 684 if(resto != parseInt(cpf.charAt(10))){ 685 return false; 686 } 687 return true; 688 } -
trunk/expressoAdmin1_2/templates/default/accounts_form.tpl
r62 r63 2 2 3 3 <script type="text/javascript"> 4 var tab = new Tabs( 6,'activetab','inactivetab','tab','tabcontent','','','tabpage');4 var tab = new Tabs(7,'activetab','inactivetab','tab','tabcontent','','','tabpage'); 5 5 function initAll() 6 6 { … … 28 28 <tr> 29 29 <th id="tab1" class="activetab" onclick="javascript:tab.display(1);"><a href="#" tabindex="0" accesskey="1" onfocus="tab.display(1);" onclick="tab.display(1); return(false);">{lang_general_information}</a></th> 30 <th id="tab2" class="activetab" onclick="javascript:tab.display(2);"><a href="#" tabindex="0" accesskey="2" onfocus="tab.display(2);" onclick="tab.display(2); return(false);">{lang_email_config}</a></th> 31 <th id="tab3" class="activetab" onclick="javascript:tab.display(3);"><a href="#" tabindex="0" accesskey="3" onfocus="tab.display(3);" onclick="tab.display(3); return(false);">{lang_groups_permission}</a></th> 32 <th id="tab4" class="activetab" onclick="javascript:tab.display(4);"><a href="#" tabindex="0" accesskey="4" onfocus="tab.display(4);" onclick="tab.display(4); return(false);">{lang_lists_permission}</a></th> 33 <th id="tab5" class="activetab" onclick="javascript:tab.display(5);"><a href="#" tabindex="0" accesskey="5" onfocus="tab.display(5);" onclick="tab.display(5); return(false);">{lang_aplication_permission}</a></th> 34 <th style="{display_samba_suport}" id="tab6" class="activetab" onclick="javascript:tab.display(6);"><a href="#" tabindex="0" accesskey="6" onfocus="tab.display(6);" onclick="tab.display(6); return(false);">{lang_samba_config}</a></th> 30 <th id="tab2" class="activetab" style="display:{display_corporative_information}"onclick="javascript:tab.display(2);"><a href="#" tabindex="0" accesskey="2" onfocus="tab.display(2);" onclick="tab.display(2); return(false);">{lang_corporative_information}</a></th> 31 <th id="tab3" class="activetab" onclick="javascript:tab.display(3);"><a href="#" tabindex="0" accesskey="3" onfocus="tab.display(3);" onclick="tab.display(3); return(false);">{lang_email_config}</a></th> 32 <th id="tab4" class="activetab" onclick="javascript:tab.display(4);"><a href="#" tabindex="0" accesskey="4" onfocus="tab.display(4);" onclick="tab.display(4); return(false);">{lang_groups_permission}</a></th> 33 <th id="tab5" class="activetab" onclick="javascript:tab.display(5);"><a href="#" tabindex="0" accesskey="5" onfocus="tab.display(5);" onclick="tab.display(5); return(false);">{lang_lists_permission}</a></th> 34 <th id="tab6" class="activetab" onclick="javascript:tab.display(6);"><a href="#" tabindex="0" accesskey="6" onfocus="tab.display(6);" onclick="tab.display(6); return(false);">{lang_aplication_permission}</a></th> 35 <th id="tab7" class="activetab" style="display:{display_samba_suport}" onclick="javascript:tab.display(7);"><a href="#" tabindex="0" accesskey="7" onfocus="tab.display(7);" onclick="tab.display(7); return(false);">{lang_samba_config}</a></th> 35 36 </tr> 36 37 </table> … … 111 112 </div> 112 113 114 <!-- The code for Corporative Information --> 115 <div id="tabcontent2" class="inactivetab"> 116 <table width="60%" border="0" cellspacing="4" cellpading="0"> 117 <tr bgcolor={row_on}> 118 <td>{lang_employeenumber}:</td> 119 <td><input type="text" name="corporative_information_employeenumber" autocomplete="off" value="{corporative_information_employeenumber}" size="30"></td> 120 </tr> 121 <tr bgcolor={row_off}> 122 <td>{lang_cpf}:</td> 123 <td><input type="text" name="corporative_information_cpf" autocomplete="off" value="{corporative_information_cpf}" size="30"></td> 124 </tr> 125 <tr bgcolor={row_on}> 126 <td>{lang_rg}:</td> 127 <td><input type="text" name="corporative_information_rg" autocomplete="off" value="{corporative_information_rg}" size="30"></td> 128 </tr> 129 <tr bgcolor={row_off}> 130 <td>{lang_rguf}:</td> 131 <td><input type="text" name="corporative_information_rguf" autocomplete="off" value="{corporative_information_rguf}" size="30"></td> 132 </tr> 133 </table> 134 </div> 135 113 136 <!-- The code for Email Config --> 114 <div id="tabcontent 2" class="inactivetab">137 <div id="tabcontent3" class="inactivetab"> 115 138 <table width="60%" border="0" cellspacing="4" cellpading="0"> 116 139 <tr bgcolor={row_off}> … … 146 169 <tr bgcolor={row_off}> 147 170 <td>{lang_email_quota_used}:</td> 148 <td><input type="text" name="mailquota_used" value="{mailquota_used}" disabled size=10></td> 149 </tr> 150 171 <td><input type="text" name="mailquota_used" id="mailquota_used" value="{mailquota_used}" disabled size=10></td> 172 </tr> 173 174 <tr bgcolor={row_on}> 175 <td><input type='button' {disabled} {disabled_empty_inbox} value='Limpar INBOX do usuário' onclick="javascript:empty_inbox(uid.value);"></td> 176 </tr> 177 151 178 </table> 152 179 </div> 153 180 154 181 <!-- The code for Group --> 155 <div id="tabcontent 3" class="inactivetab">182 <div id="tabcontent4" class="inactivetab"> 156 183 <table width="60%" border="0" cellspacing="4" cellpading="0"> 157 184 <tr bgcolor={row_on}> … … 213 240 214 241 <!-- The code for lists Email --> 215 <div id="tabcontent 4" class="inactivetab">242 <div id="tabcontent5" class="inactivetab"> 216 243 <table width="60%" border="0" cellspacing="4" cellpading="0"> 217 244 <tr bgcolor={row_on}> … … 265 292 266 293 <!-- The code for Apps Tab --> 267 <div id="tabcontent 5" class="inactivetab">294 <div id="tabcontent6" class="inactivetab"> 268 295 <table id="ea_table_apps" width="80%" border="0" cellspacing="2" cellpading="0"> 269 296 {apps} … … 272 299 273 300 <!-- The code for SAMBA --> 274 <div id="tabcontent6" class="inactivetab" style="{display_samba_suport}"> 301 <!--<div id="tabcontent7" class="inactivetab" style="{display_samba_suport}">--> 302 <div id="tabcontent7" class="inactivetab"> 275 303 <table width="60%" border="0" cellspacing="4" cellpading="0"> 276 304 <tr bgcolor={row_on}> -
trunk/expressoAdmin1_2/templates/default/managers_form.tpl
r62 r63 76 76 </tr> 77 77 <tr bgcolor="{color_font1}" align='right'> 78 <td>{lang_manipulate_corporative_information}:</td> 79 <td><input type="checkbox" name="manipulate_corporative_information" value="268435456" {manipulate_corporative_information}></td> 80 </tr> 81 <tr bgcolor="{color_font1}" align='right'> 78 82 <td>{lang_view_user}:</td> 79 83 <td><input type="checkbox" name="view_users" value="33554432" {view_users}></td> … … 90 94 <td>{lang_set_user_default_password}:</td> 91 95 <td><input type="checkbox" name="set_user_default_password" value="524288" {set_user_default_password}></td> 96 </tr> 97 <tr bgcolor="{color_font1}" align='right'> 98 <td>{lang_empty_user_inbox}:</td> 99 <td><input type="checkbox" name="empty_user_inbox" value="134217728" {empty_user_inbox}></td> 92 100 </tr> 93 101
Note: See TracChangeset
for help on using the changeset viewer.