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

    r27 r64  
    3535                        $this->so = $this->bo->so; 
    3636                        $this->functions = $this->bo->functions; 
    37                         $this->db_functions = CreateObject('expressoAdmin1_2.db_functions'); 
     37                        $this->db_functions = $this->bo->db_functions; 
    3838                         
    3939                        $c = CreateObject('phpgwapi.config','expressoAdmin1_2'); 
     
    4444                function list_computers() 
    4545                { 
    46                         $account_lid = $GLOBALS['phpgw']->accounts->data['account_lid']; 
    47                         $acl = $this->functions->read_acl($account_lid); 
    48                         $context = $acl[0]['context']; 
    49                         $context_display = $acl[0]['context_display']; 
     46                        $manager_lid = $GLOBALS['phpgw']->accounts->data['account_lid']; 
     47                        $manager_acl = $this->functions->read_acl($manager_lid); 
     48                        $manager_contexts = $manager_acl['contexts']; 
     49                        foreach ($manager_acl['contexts_display'] as $index=>$tmp_context) 
     50                        { 
     51                                $context_display .= '<br>'.$tmp_context; 
     52                        } 
    5053         
    5154                        // Verifica se tem acesso a este modulo 
    52                         if (!$this->functions->check_acl($account_lid,'list_computers')) 
     55                        if (!$this->functions->check_acl($manager_lid,'list_computers')) 
    5356                        { 
    5457                                $GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/expressoAdmin1_2/inc/access_denied.php')); 
     
    8083                                'th_bg'                                         => $GLOBALS['phpgw_info']['theme']['th_bg'], 
    8184                                'add_action'                            => $GLOBALS['phpgw']->link('/index.php','menuaction=expressoAdmin1_2.uicomputers.add_computer'), 
    82                                 'add_computers_disabled'        => $this->functions->check_acl($account_lid,'create_computers') ? '' : 'display:none', 
     85                                'add_computers_disabled'        => $this->functions->check_acl($manager_lid,'create_computers') ? '' : 'display:none', 
    8386                                'back_url'                                      => $GLOBALS['phpgw']->link('/expressoAdmin1_2/index.php'), 
    8487                                'lang_back'                                     => lang('Back'), 
    85                                 //'context'                                     => $context, 
    8688                                'context_display'                       => $context_display, 
    8789                                'lang_computers_uid'            => lang('Computer UID'), 
     
    101103                        if ($GLOBALS['query'] != '') 
    102104                        { 
    103                                 $computers_info = $this->functions->get_list('computers', $GLOBALS['query'], $context); 
     105                                $computers_info = $this->functions->get_list('computers', $GLOBALS['query'], $manager_contexts); 
    104106                        } 
    105107                         
     
    111113                        else if (count($computers_info)) 
    112114                        { 
    113                                 if ($this->functions->check_acl($account_lid,'edit_computers')) 
     115                                if ($this->functions->check_acl($manager_lid,'edit_computers')) 
    114116                                { 
    115117                                        $can_edit = True; 
    116118                                } 
    117                                 if ($this->functions->check_acl($account_lid,'delete_computers')) 
     119                                if ($this->functions->check_acl($manager_lid,'delete_computers')) 
    118120                                { 
    119121                                        $can_delete = True; 
     
    157159                function add_computer() 
    158160                { 
    159                         //_debug_array($_POST); 
    160                          
    161                         $account_lid = $GLOBALS['phpgw']->accounts->data['account_lid']; 
    162                         $acl = $this->functions->read_acl($account_lid); 
    163                         $context = $acl[0]['context']; 
     161                        $manager_lid = $GLOBALS['phpgw']->accounts->data['account_lid']; 
     162                        $manager_acl = $this->functions->read_acl($manager_lid); 
     163                        $manager_contexts = $manager_acl['contexts']; 
    164164                         
    165165                        // Verifica se tem acesso a este modulo 
    166                         if (!$this->functions->check_acl($account_lid,'create_computers')) 
     166                        if (!$this->functions->check_acl($manager_lid,'create_computers')) 
    167167                        { 
    168168                                $GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/expressoAdmin1_2/inc/access_denied.php')); 
     
    191191                        } 
    192192                         
    193                         // Pega combo das organizações e seleciona um dos setores em caso de um erro na validaçao dos dados. 
    194                         $sectors = $this->functions->get_organizations($context, trim(strtolower($_POST['sector_context']))); 
     193                        foreach ($manager_contexts as $index=>$context) 
     194                                $sectors .= $this->functions->get_organizations($context); 
    195195 
    196196                        // Cria combo de dominio samba 
     
    271271                function validade_computers_data_add() 
    272272                { 
    273                         //_debug_array($_POST); 
    274                          
    275273                        if (($_POST['sambaAcctFlags'] == '[I          ]') && ($_POST['computer_password'] == '')) 
    276274                        { 
     
    304302                function edit_computer() 
    305303                { 
    306                         $account_lid = $GLOBALS['phpgw']->accounts->data['account_lid']; 
    307                         $acl = $this->functions->read_acl($account_lid); 
    308                         $manager_context = $acl[0]['context']; 
     304                        $manager_lid = $GLOBALS['phpgw']->accounts->data['account_lid']; 
     305                        $manager_acl = $this->functions->read_acl($manager_lid); 
     306                        $manager_contexts = $manager_acl['contexts']; 
    309307                         
    310308                        // Verifica se tem acesso a este modulo 
    311                         if (!$this->functions->check_acl($account_lid,'edit_computers')) 
     309                        if (!$this->functions->check_acl($manager_lid,'edit_computers')) 
    312310                        { 
    313311                                $GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/expressoAdmin1_2/inc/access_denied.php')); 
    314312                        } 
    315313                         
     314                        // Set o header 
    316315                        unset($GLOBALS['phpgw_info']['flags']['noheader']); 
    317316                        unset($GLOBALS['phpgw_info']['flags']['nonavbar']); 
     
    327326                        { 
    328327                                $uidnumber = $_GET['uidnumber']; 
    329                                 $computer_data = $this->so->get_computer_data($uidnumber, $manager_context); 
    330  
    331                                 // Pega combo das organizações e seleciona um dos setores em caso de um erro na validaçao dos dados. 
    332                                 $sectors = $this->functions->get_organizations($manager_context, trim(strtolower($computer_data['context']))); 
     328                                $computer_data = $this->so->get_computer_data($uidnumber); 
     329 
     330                                // Gera combo sectors 
     331                                foreach ($manager_contexts as $index=>$context) 
     332                                        $sectors .= $this->functions->get_organizations($context, trim(strtolower($computer_data['context']))); 
    333333 
    334334                                // Cria combo de dominios do samba 
     
    411411                        { 
    412412                                // Pega combo das organizações e seleciona um dos setores em caso de um erro na validaçao dos dados. 
    413                                 $sectors = $this->functions->get_organizations($manager_context, trim(strtolower($_POST['sector_context']))); 
     413                                foreach ($manager_contexts as $index=>$context) 
     414                                        $sectors .= $this->functions->get_organizations($context, trim(strtolower($_POST['sector_context']))); 
     415                                //$sectors = $this->functions->get_organizations($manager_contexts); 
    414416                                 
    415417                                // Cria combo de dominios do samba 
Note: See TracChangeset for help on using the changeset viewer.