Ignore:
Timestamp:
07/17/09 10:46:40 (15 years ago)
Author:
rodsouza
Message:

Ticket #581 - Restrict the manager to create sub-organizations in organizations where he has not permission.

File:
1 edited

Legend:

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

    r597 r1145  
    147147                        $manager_lid = $GLOBALS['phpgw']->accounts->data['account_lid']; 
    148148                        $acl = $this->functions->read_acl($manager_lid); 
    149                          
     149 
     150                        $manager_contexts = $acl['contexts']; 
     151                        $combo_manager_org = ''; 
     152                        foreach ($manager_contexts as $index=>$context) 
     153                                $combo_manager_org .= $this->functions->get_organizations( $context ); 
     154 
    150155                        $context = $_GET['context']; 
    151156                         
     
    173178                                'context'                       => $context == '' ? $GLOBALS['phpgw_info']['server']['ldap_context'] : $context, 
    174179                                'sector'                        => $_POST['sector'], 
     180                                'manager_org'           => $combo_manager_org, 
    175181                                'sector_visible_checked'=> $_POST['sector_visible'] ? 'checked' : '', 
    176182                                'error_messages'        => $_POST['error_messages'] == '' ? '' : "<script type='text/javascript'>alert('".$_POST['error_messages']."')</script>", 
     
    189195                         
    190196                        $context = $_GET['context']; 
     197 
     198                        $combo_manager_org = $this->functions->get_organizations($_GET['context'], '', true, true, true); 
     199                        $combo_manager_org = substr( $combo_manager_org, 0, ( strpos($combo_manager_org, '</option>') + 9 ) ); 
     200 
    191201                        $a_tmp = explode(",", ldap_dn2ufn($context)); 
    192202                        $sector_name = $a_tmp[0]; 
     
    220230                                'th_bg'                         => $GLOBALS['phpgw_info']['theme']['th_bg'], 
    221231                                'context'                       => $context == '' ? $manager_context : $context, 
    222                                 'sector'                                => $_POST['sector'] == '' ? $sector_name : $_POST['sector'], 
     232                                'sector'                        => $_POST['sector'] == '' ? $sector_name : $_POST['sector'], 
     233                                'manager_org'           => $combo_manager_org, 
    223234                                'sector_visible_checked'=> $_POST['sector_visible'] ? 'checked' : '', 
    224235                                 
Note: See TracChangeset for help on using the changeset viewer.