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.uigroups.inc.php

    r46 r64  
    1414                var $public_functions = array 
    1515                ( 
    16                         'list_groups'                           => True, 
    17                         'add_groups'                            => True, 
    18                         'edit_groups'                           => True, 
    19                         'css'                                           => True 
     16                        'list_groups'   => True, 
     17                        'add_groups'    => True, 
     18                        'edit_groups'   => True, 
     19                        'css'                   => True 
    2020                ); 
    2121 
     
    5050                { 
    5151                        $account_lid = $GLOBALS['phpgw']->accounts->data['account_lid']; 
    52                         $acl = $this->functions->read_acl($account_lid); 
    53                         $context = $acl[0]['context']; 
    54                         $context_display = $acl[0]['context_display']; 
     52                        $manager_acl = $this->functions->read_acl($account_lid); 
     53                        $raw_context = $acl['raw_context']; 
     54                        $contexts = $manager_acl['contexts']; 
     55                        foreach ($manager_acl['contexts_display'] as $index=>$tmp_context) 
     56                        { 
     57                                $context_display .= '<br>'.$tmp_context; 
     58                        } 
    5559                         
    5660                        // Verifica se tem acesso a este modulo 
     
    8589                                'add_action'                    => $GLOBALS['phpgw']->link('/index.php','menuaction=expressoAdmin1_2.uigroups.add_groups'), 
    8690                                'add_group_disabled'    => $this->functions->check_acl($account_lid,'add_groups') ? '' : 'disabled', 
    87                                 'context'                               => $context, 
     91                                //'context'                             => $context, 
    8892                                'context_display'               => $context_display, 
    8993                                'lang_groups_names'             => lang('Groups Names'), 
     
    104108                        if ($GLOBALS['query'] != '') 
    105109                        { 
    106                                 $groups_info = $this->functions->get_list('groups', $GLOBALS['query'], $context); 
     110                                $groups_info = $this->functions->get_list('groups', $GLOBALS['query'], $contexts); 
    107111                        } 
    108112                        $total = count($groups_info); 
     
    144148                                        if ($can_delete) 
    145149                                        { 
    146                                                 $p->set_var('delete_link',"<a href='#' onClick='javascript:delete_group(\"".$group['cn']."\",\"".$group['gidnumber']."\",\"".$context."\");'>Excluir</a>"); 
     150                                                $p->set_var('delete_link',"<a href='#' onClick='javascript:delete_group(\"".$group['cn']."\",\"".$group['gidnumber']."\");'>Excluir</a>"); 
    147151                                        } 
    148152                                        else 
     
    174178                                $GLOBALS['phpgw']->js->set_onload('get_available_sambadomains(document.forms[0].context.value, \'create_group\');'); 
    175179 
    176                         $account_lid = $GLOBALS['phpgw']->accounts->data['account_lid']; 
    177                         $acl = $this->functions->read_acl($account_lid); 
    178                         $manager_context = $acl[0]['context']; 
     180                        $manager_lid = $GLOBALS['phpgw']->accounts->data['account_lid']; 
     181                        $manager_acl = $this->functions->read_acl($manager_lid); 
     182                        $manager_contexts = $manager_acl['contexts']; 
    179183                         
    180184                        // Verifica se tem acesso a este modulo 
    181                         if (!$this->functions->check_acl($account_lid,'add_groups')) 
     185                        if (!$this->functions->check_acl($manager_lid,'add_groups')) 
    182186                        { 
    183187                                $GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/expressoAdmin1_2/inc/access_denied.php')); 
     
    194198 
    195199                        // Pega combo das organizações e seleciona um dos setores em caso de um erro na validaçao dos dados. 
    196                         $combo_manager_org = $this->functions->get_organizations($manager_context, trim(strtolower($group_info['context']))); 
     200                        //$combo_manager_org = $this->functions->get_organizations($manager_context, trim(strtolower($group_info['context']))); 
     201                        foreach ($manager_contexts as $index=>$context) 
     202                                $combo_manager_org .= $this->functions->get_organizations($context, trim(strtolower($group_info['context']))); 
    197203                        $combo_all_orgs = $this->functions->get_organizations($GLOBALS['phpgw_info']['server']['ldap_context'], trim(strtolower($group_info['context']))); 
    198204                         
    199205                        // Chama funcao para criar lista de aplicativos disponiveis. 
    200                         $apps = $this->functions->make_list_app($account_lid, $manager_context, ''); 
     206                        $apps = $this->functions->make_list_app($manager_lid); 
    201207                         
    202208                        // Cria combo de dominio samba 
     
    210216                                        { 
    211217                                                // So mostra os sambaDomainName do contexto do manager 
    212                                                 if ($this->ldap_functions->exist_sambadomains($manager_context, $a_sambadomain['samba_domain_name'])) 
     218                                                if ($this->ldap_functions->exist_sambadomains($manager_contexts, $a_sambadomain['samba_domain_name'])) 
    213219                                                        $sambadomainname_options .= "<option value='" . $a_sambadomain['samba_domain_sid'] . "'>" . $a_sambadomain['samba_domain_name'] . "</option>"; 
    214220                                        } 
     
    244250                                'disabled_samba'                        => 'disabled', 
    245251                                'display_samba_options'         => $this->current_config['expressoAdmin_samba_support'] == 'true' ? '' : '"display:none"', 
    246                                 'disable_email_groups'          => $this->functions->check_acl($account_lid,'edit_email_groups') ? '' : 'disabled', 
     252                                'disable_email_groups'          => $this->functions->check_acl($manager_lid,'edit_email_groups') ? '' : 'disabled', 
    247253                                'sambadomainname_options'       => $sambadomainname_options, 
    248254                                'back_url'                                      => $GLOBALS['phpgw']->link('/index.php','menuaction=expressoAdmin1_2.uigroups.list_groups'), 
     
    258264                { 
    259265                        $GLOBALS['phpgw']->js->set_onload('get_available_users(document.forms[0].org_context.value, document.forms[0].ea_check_allUsers.checked);'); 
    260                          
    261                         $account_lid = $GLOBALS['phpgw']->accounts->data['account_lid']; 
    262                         $acl = $this->functions->read_acl($account_lid); 
    263                         $manager_context = $acl[0]['context']; 
    264                          
     266 
     267                        $manager_lid = $GLOBALS['phpgw']->accounts->data['account_lid']; 
     268                        $manager_acl = $this->functions->read_acl($manager_lid); 
     269                        $manager_contexts = $manager_acl['contexts']; 
     270 
    265271                        // Verifica se tem acesso a este modulo 
    266                         if (!$this->functions->check_acl($account_lid,'edit_groups')) 
     272                        if (!$this->functions->check_acl($manager_lid,'edit_groups')) 
    267273                        { 
    268274                                $GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/expressoAdmin1_2/inc/access_denied.php')); 
     
    270276 
    271277                        // GET all infomations about the group. 
    272                         $group_info = $this->group->get_info($_GET['gidnumber'], $manager_context); 
     278                        $group_info = $this->group->get_info($_GET['gidnumber']); 
    273279 
    274280                        unset($GLOBALS['phpgw_info']['flags']['noheader']); 
     
    282288 
    283289                        // Pega combo das organizações e seleciona a org do grupo. 
    284                         $combo_manager_org = $this->functions->get_organizations($manager_context, trim(strtolower($group_info['context']))); 
     290                        //$combo_manager_org = $this->functions->get_organizations($manager_context, trim(strtolower($group_info['context']))); 
     291                        foreach ($manager_contexts as $index=>$context) 
     292                                $combo_manager_org .= $this->functions->get_organizations($context, trim(strtolower($group_info['context']))); 
    285293                        $combo_all_orgs = $this->functions->get_organizations($GLOBALS['phpgw_info']['server']['ldap_context'], trim(strtolower($group_info['context']))); 
    286294 
     
    315323                         
    316324                        // Chama funcao para criar lista de aplicativos disponiveis. 
    317                         $apps = $this->functions->make_list_app($account_lid, $manager_context, $group_info['apps']); 
     325                        $apps = $this->functions->make_list_app($manager_lid, $group_info['apps']); 
    318326                         
    319327                        // Cria combo de dominios do samba 
     
    352360                                'lang_all_users'                        => lang('Select users from all sub-organizations'), 
    353361                                'gidnumber'                                     => $group_info['gidnumber'], 
    354                                 'manager_context'                       => $manager_context, 
     362                                //'manager_context'                     => $manager_context, 
    355363                                'cn'                                            => $group_info['cn'], 
    356364                                'user_count'                            => $user_count, 
     
    360368                                'use_attrs_samba_checked'       => $group_info['sambaGroup'] ? 'CHECKED' : '', 
    361369                                'disabled_samba'                        => $group_info['sambaGroup'] ? '' : 'disabled', 
    362                                 'disable_email_groups'          => $this->functions->check_acl($account_lid,'edit_email_groups') ? '' : 'disabled', 
     370                                'disable_email_groups'          => $this->functions->check_acl($manager_lid,'edit_email_groups') ? '' : 'disabled', 
    363371                                'sambadomainname_options'       => $sambadomainname_options, 
    364372                                'phpgwaccountvisible_checked'   => $group_info['phpgwaccountvisible'] == '-1' ? 'CHECKED' : '', 
Note: See TracChangeset for help on using the changeset viewer.