Ignore:
Timestamp:
09/05/07 11:18:58 (17 years ago)
Author:
niltonneto
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/expressoAdmin1_2/inc/class.uiaccounts.inc.php

    r63 r64  
    5555                { 
    5656                        $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                        } 
    6064                         
    6165                        // Verifica se o administrador tem acesso. 
     
    9498                                 
    9599                                'create_user_disabled'          => $this->functions->check_acl($account_lid,'add_users') ? '' : 'disabled', 
    96                                 'context'                                       => $context, 
     100                                'context'                                       => $raw_context, 
    97101                                'context_display'                       => $context_display, 
    98102                                'imapDelimiter'                         => $_SESSION['phpgw_info']['expresso']['email_server']['imapDelimiter'],  
     
    107111                                'lang_search'                           => lang('Search'), 
    108112                                'lang_back'                                     => lang('back'), 
    109                                 'lang_context'                          => lang('Context') 
     113                                'lang_contexts'                         => lang('Contexts') 
    110114                                 
    111115                        ); 
     
    118122                        if ($GLOBALS['query'] != '') 
    119123                        { 
    120                                 $account_info = $this->functions->get_list('accounts', $GLOBALS['query'], $context); 
     124                                $account_info = $this->functions->get_list('accounts', $GLOBALS['query'], $contexts); 
    121125                        } 
    122126                         
     
    131135                                        ($this->functions->check_acl($account_lid,'change_users_password')) || 
    132136                                        ($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                                        )  
    134140                                        $can_edit = True; 
    135141                                elseif ($this->functions->check_acl($account_lid,'view_users')) 
     
    159165 
    160166                                        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>"); 
    162168                                        else 
    163169                                                $p->set_var('row_rename','&nbsp;'); 
     
    165171                                        if ($can_delete) 
    166172                                        { 
    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>"); 
    168174                                        } 
    169175                                        else 
     
    179185                { 
    180186                        $GLOBALS['phpgw']->js->validate_file('jscode','users','expressoAdmin1_2'); 
     187                         
    181188                        $GLOBALS['phpgw']->js->set_onload('get_available_groups(document.forms[0].context.value);'); 
    182189                        $GLOBALS['phpgw']->js->set_onload('get_available_maillists(document.forms[0].context.value);'); 
    183190                        if ($this->current_config['expressoAdmin_samba_support'] == 'true') 
    184191                                $GLOBALS['phpgw']->js->set_onload('get_available_sambadomains(document.forms[0].context.value, \'create_user\');'); 
    185  
     192                         
    186193                        $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                         
    189198                        // Verifica se tem acesso a este modulo 
    190199                        if (!$this->functions->check_acl($manager_lid,'add_users')) 
     
    206215 
    207216                        // 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); 
    209219 
    210220                        // 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); 
    213222 
    214223                        // Cria combo de dominio samba 
     
    222231                                        { 
    223232                                                // 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'])) 
    225234                                                        $sambadomainname_options .= "<option value='" . $a_sambadomain['samba_domain_sid'] . "'>" . $a_sambadomain['samba_domain_name'] . "</option>"; 
    226235                                        } 
     
    233242                                'row_off'                               => "#EEEEEE", 
    234243                                'color_bg1'                             => "#E8F0F0", 
    235                                 'manager_context'               => $manager_context, 
     244                                //'manager_context'             => $manager_context, 
    236245                                'type'                                  => 'create_user', 
    237246                                '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', 
    239248                                'disabled_access_button'=> 'disabled', 
    240249                                 
     
    313322                                 
    314323                                //SAMBA ABA 
    315                                 'display_samba_suport'                          => $this->functions->check_acl($manager_lid,'edit_sambausers_attributes') ? '' : 'none', 
    316324                                'lang_samba_config'                                     => lang('Samba Config'), 
    317325                                'lang_use_attrs_samba'                          => lang('Use samba attributes'), 
     
    340348                { 
    341349                        $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'];            
    344353                        $alert_warning = ''; 
    345354                         
     
    351360                                (!$this->functions->check_acl($manager_account_lid,'change_users_password')) && 
    352361                                (!$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')) 
    354364                                ) 
    355365                        { 
     
    387397                         
    388398                        // 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']); 
    390400                         
    391401                        // JavaScript 
     
    408418                                                         
    409419                // 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']); 
    411422 
    412423                        // GROUPS. 
     
    473484                        if (count($user_info['maillists_info']) > 0) 
    474485                        { 
    475                                  
    476486                                foreach ($user_info['maillists_info'] as $maillist) 
    477487                                { 
     
    487497                        // APPS. 
    488498                        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'); 
    490500                        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']); 
    492502                         
    493503                        //PHOTO 
    494504                        if ($user_info['photo_exist']) 
    495505                        { 
    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']; 
    497507                        } 
    498508                        else 
     
    521531                        if ($alert_warning != '') 
    522532                                $alert_warning = "alert('". $alert_warning ."')"; 
    523  
    524533                        $var = Array( 
    525534                                'uidnumber'                                     => $_GET['account_id'], 
    526                                 'manager_context'                       => $manager_context, 
    527535                                'type'                                          => 'edit_user', 
    528536                                'photo_exist'                           => $user_info['photo_exist'], 
     
    535543                                'action'                                        => $GLOBALS['phpgw']->link('/index.php','menuaction=expressoAdmin1_2.uiaccounts.validate_user_data_edit'), 
    536544                                'back_url'                                      => './index.php?menuaction=expressoAdmin1_2.uiaccounts.list_users', 
    537                                 'display_samba_suport'          => $this->current_config['expressoAdmin_samba_support'] == 'true' ? '' : 'display:none', 
    538545                                'disabled'                                      => $disabled, 
    539546                                'disabled_password'                     => $disabled_password, 
    540547                                'disabled_samba'                        => $disabled_samba, 
    541548                                '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', 
    542556                                 
    543557                                // First ABA 
     
    583597 
    584598                                // Corporative Information 
    585                                 'display_corporative_information'=> $this->functions->check_acl($manager_account_lid,'edit_sambausers_attributes') ? '' : 'none', 
    586599                                'lang_employeenumber'                   => lang('Employee number'), 
    587600                                'lang_cpf'                                              => lang('cpf'), 
     
    594607                                 
    595608                                //MAIL 
    596                                 'disabled_quota_used'                   => 'disabled', 
    597                                 'lang_activeemailaccount'               => lang('Active email account'), 
    598                                 'lang_email'                                    => lang('E-mail'), 
    599                                 'lang_aliasemail'                               => lang('Alias email'), 
    600                                 'lang_forwardingemail'                  => lang('Forwarding email'), 
    601                                 'lang_email_quota'                              => lang('Email quota in MB'), 
    602                                 'lang_onlyforwarding'                   => lang('Only forwarding'), 
    603                                 'lang_email_quota_used'                 => lang('Quota used in MB'), 
     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'), 
    604617                                 
    605618                                'accountstatus_checked'         => $user_info['accountstatus'] == 'active' ? 'CHECKED' : '', 
     
    651664                        ); 
    652665                        $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                         
    653673                        $t->pfp('out','body');                   
    654674                } 
     
    705725                { 
    706726                        $uidNumber = $_GET['uidNumber']; 
    707                         $manager_context = $_GET['manager_context']; 
    708                         $photo = $this->get_photo($uidNumber, $manager_context);  
     727                        $photo = $this->get_photo($uidNumber);  
    709728                         
    710729                if ($photo) 
     
    722741                } 
    723742                 
    724                 function get_photo($uidNumber, $manager_context) 
     743                function get_photo($uidNumber) 
    725744                { 
    726745                        $ldap_conn = $GLOBALS['phpgw']->common->ldapConnect(); 
     
    728747                        $justthese = array("jpegphoto"); 
    729748 
    730                         $search = ldap_search($ldap_conn, $manager_context, $filter, $justthese); 
     749                        $search = ldap_search($ldap_conn, $GLOBALS['phpgw_info']['server']['ldap_context'], $filter, $justthese); 
    731750                        $entry = ldap_first_entry($ldap_conn, $search); 
    732751                        $jpeg_data = ldap_get_values_len($ldap_conn, $entry, "jpegphoto"); 
Note: See TracChangeset for help on using the changeset viewer.