Changeset 64 for trunk/expressoAdmin1_2/inc/class.uicomputers.inc.php
- Timestamp:
- 09/05/07 11:18:58 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoAdmin1_2/inc/class.uicomputers.inc.php
r27 r64 35 35 $this->so = $this->bo->so; 36 36 $this->functions = $this->bo->functions; 37 $this->db_functions = CreateObject('expressoAdmin1_2.db_functions');37 $this->db_functions = $this->bo->db_functions; 38 38 39 39 $c = CreateObject('phpgwapi.config','expressoAdmin1_2'); … … 44 44 function list_computers() 45 45 { 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 } 50 53 51 54 // 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')) 53 56 { 54 57 $GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/expressoAdmin1_2/inc/access_denied.php')); … … 80 83 'th_bg' => $GLOBALS['phpgw_info']['theme']['th_bg'], 81 84 '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', 83 86 'back_url' => $GLOBALS['phpgw']->link('/expressoAdmin1_2/index.php'), 84 87 'lang_back' => lang('Back'), 85 //'context' => $context,86 88 'context_display' => $context_display, 87 89 'lang_computers_uid' => lang('Computer UID'), … … 101 103 if ($GLOBALS['query'] != '') 102 104 { 103 $computers_info = $this->functions->get_list('computers', $GLOBALS['query'], $ context);105 $computers_info = $this->functions->get_list('computers', $GLOBALS['query'], $manager_contexts); 104 106 } 105 107 … … 111 113 else if (count($computers_info)) 112 114 { 113 if ($this->functions->check_acl($ account_lid,'edit_computers'))115 if ($this->functions->check_acl($manager_lid,'edit_computers')) 114 116 { 115 117 $can_edit = True; 116 118 } 117 if ($this->functions->check_acl($ account_lid,'delete_computers'))119 if ($this->functions->check_acl($manager_lid,'delete_computers')) 118 120 { 119 121 $can_delete = True; … … 157 159 function add_computer() 158 160 { 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']; 164 164 165 165 // 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')) 167 167 { 168 168 $GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/expressoAdmin1_2/inc/access_denied.php')); … … 191 191 } 192 192 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); 195 195 196 196 // Cria combo de dominio samba … … 271 271 function validade_computers_data_add() 272 272 { 273 //_debug_array($_POST);274 275 273 if (($_POST['sambaAcctFlags'] == '[I ]') && ($_POST['computer_password'] == '')) 276 274 { … … 304 302 function edit_computer() 305 303 { 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']; 309 307 310 308 // 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')) 312 310 { 313 311 $GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/expressoAdmin1_2/inc/access_denied.php')); 314 312 } 315 313 314 // Set o header 316 315 unset($GLOBALS['phpgw_info']['flags']['noheader']); 317 316 unset($GLOBALS['phpgw_info']['flags']['nonavbar']); … … 327 326 { 328 327 $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']))); 333 333 334 334 // Cria combo de dominios do samba … … 411 411 { 412 412 // 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); 414 416 415 417 // Cria combo de dominios do samba
Note: See TracChangeset
for help on using the changeset viewer.