Changeset 1145


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.

Location:
trunk/expressoAdmin1_2
Files:
2 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                                 
  • trunk/expressoAdmin1_2/templates/default/sectors_form.tpl

    r414 r1145  
    22<p> 
    33  <table border="0" align="center"> 
     4  <!-- 
    45  <tr bgcolor="{th_bg}"> 
    56   <td>{lang_context}: {context}</td> 
    67  </tr> 
     8  --> 
    79 </table> 
    810  
    911  <table border="0" align="center"> 
    1012        <form method="POST" action="{action}"> 
     13                <tr bgcolor={row_off}> 
     14                        <td>{lang_organizations}:</td> 
     15                        <td><select {disabled} name="context">{manager_org}</select></td> 
     16                </tr> 
    1117                <tr>   
    1218                        <td> 
     
    2935                        <input type="submit" name="button_submit" value={lang_save}> 
    3036                        <input type="button" value="{lang_back}" onClick="document.location.href='{back_url}'"> 
     37                                <!-- 
    3138                        <input type="hidden" name="context" value="{context}"> 
     39                                --> 
    3240                        <input type="hidden" name="old_sector" value="{old_sector}"> 
    3341                        </td> 
Note: See TracChangeset for help on using the changeset viewer.