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

    r27 r64  
    1919         
    2020                var $so; 
     21                var $db_functions; 
    2122                var $functions; 
    2223 
     
    2526                        $this->so = CreateObject('expressoAdmin1_2.socomputers'); 
    2627                        $this->functions = $this->so->functions; 
     28                        $this->db_functions = CreateObject('expressoAdmin1_2.db_functions'); 
    2729                } 
    2830 
    2931                function create_computer() 
    3032                { 
    31                         if (!$this->functions->check_acl($_SESSION['phpgw_session']['session_lid'], 'add_groups')) 
     33                        if (!$this->functions->check_acl($_SESSION['phpgw_session']['session_lid'], 'create_computers')) 
    3234                        { 
    33                                 $_POST['error_messages'] = "O arquivo binário /home/expressolivre/mkntpwd não exite."; 
    34                                 ExecMethod('expressoAdmin1_2.uiaccounts.add_computer'); 
    3535                                return false; 
    3636                        } 
     
    3939                        $c->read_repository(); 
    4040                        $current_config = $c->config_data; 
     41                        // Leio o ID a ser usado na criação do objecto. 
     42                        $next_id = ($this->db_functions->get_next_id('accounts')); 
    4143                         
    42                         // Pega ID do BD e incrementa de 1. 
    43                         $id = (($this->functions->get_next_id()) + 1); 
     44                        if ((!is_numeric($next_id['id'])) || (!$next_id['status'])) 
     45                        { 
     46                                 
     47                                $return['status'] = false; 
     48                                $return['msg'] = "Problemas obtendo ID do usuário.\n" . $id['msg']; 
     49                                return $return; 
     50                        } 
     51                        else 
     52                        { 
     53                                $id = $next_id['id']; 
     54                        }        
     55                        // Incrementa o id no BD. 
     56                        //$this->functions->increment_id($id,'accounts'); 
    4457                         
    4558                        // Cria array para incluir no LDAP 
     
    8396                                return false; 
    8497                        } 
    85                                                  
    86                         // Incrementa o id no BD. 
    87                         $this->functions->increment_id($id,'accounts'); 
    8898                         
    8999                        // Volta para o ListGroups 
     
    163173                function delete_computer() 
    164174                { 
    165                         //_debug_array($_POST); 
    166                          
    167175                        //Delete from ldap. 
    168176                        if (!$this->so->delete_computer_ldap($_POST['computer_dn'])) 
Note: See TracChangeset for help on using the changeset viewer.