Changeset 64 for trunk/expressoAdmin1_2/inc/class.uiaccounts.inc.php
- Timestamp:
- 09/05/07 11:18:58 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoAdmin1_2/inc/class.uiaccounts.inc.php
r63 r64 55 55 { 56 56 $account_lid = $GLOBALS['phpgw']->accounts->data['account_lid']; 57 $tmp = $this->functions->read_acl($account_lid); 58 $context = $tmp[0]['context']; 59 $context_display = $tmp[0]['context_display']; 57 $acl = $this->functions->read_acl($account_lid); 58 $raw_context = $acl['raw_context']; 59 $contexts = $acl['contexts']; 60 foreach ($acl['contexts_display'] as $index=>$tmp_context) 61 { 62 $context_display .= '<br>'.$tmp_context; 63 } 60 64 61 65 // Verifica se o administrador tem acesso. … … 94 98 95 99 'create_user_disabled' => $this->functions->check_acl($account_lid,'add_users') ? '' : 'disabled', 96 'context' => $ context,100 'context' => $raw_context, 97 101 'context_display' => $context_display, 98 102 'imapDelimiter' => $_SESSION['phpgw_info']['expresso']['email_server']['imapDelimiter'], … … 107 111 'lang_search' => lang('Search'), 108 112 'lang_back' => lang('back'), 109 'lang_context ' => lang('Context')113 'lang_contexts' => lang('Contexts') 110 114 111 115 ); … … 118 122 if ($GLOBALS['query'] != '') 119 123 { 120 $account_info = $this->functions->get_list('accounts', $GLOBALS['query'], $context );124 $account_info = $this->functions->get_list('accounts', $GLOBALS['query'], $contexts); 121 125 } 122 126 … … 131 135 ($this->functions->check_acl($account_lid,'change_users_password')) || 132 136 ($this->functions->check_acl($account_lid,'edit_sambausers_attributes')) || 133 ($this->functions->check_acl($account_lid,'change_users_quote'))) 137 ($this->functions->check_acl($account_lid,'change_users_quote')) || 138 ($this->functions->check_acl($account_lid,'manipulate_corporative_information')) 139 ) 134 140 $can_edit = True; 135 141 elseif ($this->functions->check_acl($account_lid,'view_users')) … … 159 165 160 166 if ($can_rename) 161 $p->set_var('row_rename',"<a href='#' onClick='javascript:rename_user(\"".$account['account_lid']."\",\"".$account['account_id']."\" ,\"".$context."\");'>Renomear</a>");167 $p->set_var('row_rename',"<a href='#' onClick='javascript:rename_user(\"".$account['account_lid']."\",\"".$account['account_id']."\");'>Renomear</a>"); 162 168 else 163 169 $p->set_var('row_rename',' '); … … 165 171 if ($can_delete) 166 172 { 167 $p->set_var('row_delete',"<a href='#' onClick='javascript:delete_user(\"".$account['account_lid']."\",\"".$account['account_id']."\" ,\"".$context."\");'>Excluir</a>");173 $p->set_var('row_delete',"<a href='#' onClick='javascript:delete_user(\"".$account['account_lid']."\",\"".$account['account_id']."\");'>Excluir</a>"); 168 174 } 169 175 else … … 179 185 { 180 186 $GLOBALS['phpgw']->js->validate_file('jscode','users','expressoAdmin1_2'); 187 181 188 $GLOBALS['phpgw']->js->set_onload('get_available_groups(document.forms[0].context.value);'); 182 189 $GLOBALS['phpgw']->js->set_onload('get_available_maillists(document.forms[0].context.value);'); 183 190 if ($this->current_config['expressoAdmin_samba_support'] == 'true') 184 191 $GLOBALS['phpgw']->js->set_onload('get_available_sambadomains(document.forms[0].context.value, \'create_user\');'); 185 192 186 193 $manager_lid = $GLOBALS['phpgw']->accounts->data['account_lid']; 187 $tmp = $this->functions->read_acl($manager_lid); 188 $manager_context = $tmp[0]['context']; 194 $acl = $this->functions->read_acl($manager_lid); 195 196 $manager_contexts = $acl['contexts']; 197 189 198 // Verifica se tem acesso a este modulo 190 199 if (!$this->functions->check_acl($manager_lid,'add_users')) … … 206 215 207 216 // Pega combo das organizações e seleciona, caso seja um post, o setor que o usuario selecionou. 208 $sectors = $this->functions->get_organizations($manager_context); 217 foreach ($manager_contexts as $index=>$context) 218 $sectors .= $this->functions->get_organizations($context); 209 219 210 220 // Chama funcao para criar lista de aplicativos disponiveis. 211 //$app_list['applications_list'] = $_POST['applications_list']; 212 $applications_list = $this->functions->make_list_app($manager_lid, $manager_context, $app_list); 221 $applications_list = $this->functions->make_list_app($manager_lid); 213 222 214 223 // Cria combo de dominio samba … … 222 231 { 223 232 // So mostra os sambaDomainName do contexto do manager 224 if ($this->ldap_functions->exist_sambadomains($manager_context , $a_sambadomain['samba_domain_name']))233 if ($this->ldap_functions->exist_sambadomains($manager_contexts, $a_sambadomain['samba_domain_name'])) 225 234 $sambadomainname_options .= "<option value='" . $a_sambadomain['samba_domain_sid'] . "'>" . $a_sambadomain['samba_domain_name'] . "</option>"; 226 235 } … … 233 242 'row_off' => "#EEEEEE", 234 243 'color_bg1' => "#E8F0F0", 235 'manager_context' => $manager_context,244 //'manager_context' => $manager_context, 236 245 'type' => 'create_user', 237 246 'back_url' => $GLOBALS['phpgw']->link('/index.php','menuaction=expressoAdmin1_2.uiaccounts.list_users'), 238 'display_samba_suport' => $this->current_config['expressoAdmin_samba_support'] == 'true' ? '' : ' display:none',247 'display_samba_suport' => $this->current_config['expressoAdmin_samba_support'] == 'true' ? '' : 'none', 239 248 'disabled_access_button'=> 'disabled', 240 249 … … 313 322 314 323 //SAMBA ABA 315 'display_samba_suport' => $this->functions->check_acl($manager_lid,'edit_sambausers_attributes') ? '' : 'none',316 324 'lang_samba_config' => lang('Samba Config'), 317 325 'lang_use_attrs_samba' => lang('Use samba attributes'), … … 340 348 { 341 349 $manager_account_lid = $GLOBALS['phpgw']->accounts->data['account_lid']; 342 $tmp = $this->functions->read_acl($manager_account_lid); 343 $manager_context = $tmp[0]['context']; 350 $acl = $this->functions->read_acl($manager_account_lid); 351 $raw_context = $acl['raw_context']; 352 $contexts = $acl['contexts']; 344 353 $alert_warning = ''; 345 354 … … 351 360 (!$this->functions->check_acl($manager_account_lid,'change_users_password')) && 352 361 (!$this->functions->check_acl($manager_account_lid,'edit_sambausers_attributes')) && 353 (!$this->functions->check_acl($manager_account_lid,'view_users')) 362 (!$this->functions->check_acl($manager_account_lid,'view_users')) && 363 (!$this->functions->check_acl($manager_account_lid,'manipulate_corporative_information')) 354 364 ) 355 365 { … … 387 397 388 398 // GET all infomations about the user. 389 $user_info = $this->user->get_user_info($_GET['account_id'] , $manager_context);399 $user_info = $this->user->get_user_info($_GET['account_id']); 390 400 391 401 // JavaScript … … 408 418 409 419 // ORGANIZATIONS 410 $orgs = $this->functions->get_organizations($manager_context, $user_info['context']); 420 foreach ($contexts as $index=>$context) 421 $orgs .= $this->functions->get_organizations($context, $user_info['context']); 411 422 412 423 // GROUPS. … … 473 484 if (count($user_info['maillists_info']) > 0) 474 485 { 475 476 486 foreach ($user_info['maillists_info'] as $maillist) 477 487 { … … 487 497 // APPS. 488 498 if ($disabled == 'disabled') 489 $apps = $this->functions->make_list_app($manager_account_lid, $ manager_context, $user_info['apps'], 'disabled');499 $apps = $this->functions->make_list_app($manager_account_lid, $user_info['apps'], 'disabled'); 490 500 else 491 $apps = $this->functions->make_list_app($manager_account_lid, $ manager_context, $user_info['apps']);501 $apps = $this->functions->make_list_app($manager_account_lid, $user_info['apps']); 492 502 493 503 //PHOTO 494 504 if ($user_info['photo_exist']) 495 505 { 496 $photo_bin = "./index.php?menuaction=expressoAdmin1_2.uiaccounts.show_photo&uidNumber=".$_GET['account_id'] ."&manager_context=$manager_context";506 $photo_bin = "./index.php?menuaction=expressoAdmin1_2.uiaccounts.show_photo&uidNumber=".$_GET['account_id']; 497 507 } 498 508 else … … 521 531 if ($alert_warning != '') 522 532 $alert_warning = "alert('". $alert_warning ."')"; 523 524 533 $var = Array( 525 534 'uidnumber' => $_GET['account_id'], 526 'manager_context' => $manager_context,527 535 'type' => 'edit_user', 528 536 'photo_exist' => $user_info['photo_exist'], … … 535 543 'action' => $GLOBALS['phpgw']->link('/index.php','menuaction=expressoAdmin1_2.uiaccounts.validate_user_data_edit'), 536 544 'back_url' => './index.php?menuaction=expressoAdmin1_2.uiaccounts.list_users', 537 'display_samba_suport' => $this->current_config['expressoAdmin_samba_support'] == 'true' ? '' : 'display:none',538 545 'disabled' => $disabled, 539 546 'disabled_password' => $disabled_password, 540 547 'disabled_samba' => $disabled_samba, 541 548 'changequote_disabled' => $disabled_quote, 549 550 // Display ABAS 551 'display_corporative_information'=> $this->functions->check_acl($manager_account_lid,'manipulate_corporative_information') ? '' : 'none', 552 'display_applications' => $this->functions->check_acl($manager_account_lid,'display_applications') ? '' : 'none', 553 'display_emaillists' => $this->functions->check_acl($manager_account_lid,'display_emaillists') ? '' : 'none', 554 'display_groups' => $this->functions->check_acl($manager_account_lid,'display_groups') ? '' : 'none', 555 'display_emailconfig' => $this->functions->check_acl($manager_account_lid,'display_emailconfig') ? '' : 'none', 542 556 543 557 // First ABA … … 583 597 584 598 // Corporative Information 585 'display_corporative_information'=> $this->functions->check_acl($manager_account_lid,'edit_sambausers_attributes') ? '' : 'none',586 599 'lang_employeenumber' => lang('Employee number'), 587 600 'lang_cpf' => lang('cpf'), … … 594 607 595 608 //MAIL 596 'disabled_quota_used' 597 'lang_activeemailaccount' 598 'lang_email' 599 'lang_aliasemail' 600 'lang_forwardingemail' 601 'lang_email_quota' 602 'lang_onlyforwarding' 603 'lang_email_quota_used' 609 'disabled_quota_used' => 'disabled', 610 'lang_activeemailaccount' => lang('Active email account'), 611 'lang_email' => lang('E-mail'), 612 'lang_aliasemail' => lang('Alias email'), 613 'lang_forwardingemail' => lang('Forwarding email'), 614 'lang_email_quota' => lang('Email quota in MB'), 615 'lang_onlyforwarding' => lang('Only forwarding'), 616 'lang_email_quota_used' => lang('Quota used in MB'), 604 617 605 618 'accountstatus_checked' => $user_info['accountstatus'] == 'active' ? 'CHECKED' : '', … … 651 664 ); 652 665 $t->set_var($var); 666 667 // Devo mostrar aba SAMBA ?? 668 if ( ($this->current_config['expressoAdmin_samba_support'] == 'true') && ($this->functions->check_acl($manager_account_lid,'edit_sambausers_attributes')) ) 669 $t->set_var('display_samba_suport', ''); 670 else 671 $t->set_var('display_samba_suport', 'none'); 672 653 673 $t->pfp('out','body'); 654 674 } … … 705 725 { 706 726 $uidNumber = $_GET['uidNumber']; 707 $manager_context = $_GET['manager_context']; 708 $photo = $this->get_photo($uidNumber, $manager_context); 727 $photo = $this->get_photo($uidNumber); 709 728 710 729 if ($photo) … … 722 741 } 723 742 724 function get_photo($uidNumber , $manager_context)743 function get_photo($uidNumber) 725 744 { 726 745 $ldap_conn = $GLOBALS['phpgw']->common->ldapConnect(); … … 728 747 $justthese = array("jpegphoto"); 729 748 730 $search = ldap_search($ldap_conn, $ manager_context, $filter, $justthese);749 $search = ldap_search($ldap_conn, $GLOBALS['phpgw_info']['server']['ldap_context'], $filter, $justthese); 731 750 $entry = ldap_first_entry($ldap_conn, $search); 732 751 $jpeg_data = ldap_get_values_len($ldap_conn, $entry, "jpegphoto");
Note: See TracChangeset
for help on using the changeset viewer.