Ignore:
Timestamp:
09/12/08 11:39:24 (16 years ago)
Author:
niltonneto
Message:

Alterações feitas por João Alfredo.
Email: jakjr@…

File:
1 edited

Legend:

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

    r180 r414  
    106106        { 
    107107                $return['status'] = false; 
    108                         $return['msg'] = "Problemas executando a query accounts no Banco de Dados."; 
     108                        $result['msg'] = $this->functions->lang('Problems running query on DB') . '.'; 
    109109                        $db->disconnect(); 
    110110                return $return; 
     
    120120        { 
    121121                $return['status'] = false; 
    122                         $return['msg'] = "Problemas executando a query groups no Banco de Dados."; 
     122                        $result['msg'] = $this->functions->lang('Problems running query on DB') . '.'; 
    123123                        $db->disconnect(); 
    124124                return $return; 
     
    142142                { 
    143143                $return['status'] = false; 
    144                         $return['msg'] = "Problemas executando a query update id no Banco de Dados."; 
     144                        $result['msg'] = $this->functions->lang('Problems running query on DB') . '.'; 
    145145                } 
    146146                $db->disconnect(); 
     
    148148        } 
    149149         
    150         /* 
    151         function increment_id($id, $type) 
    152         { 
    153                 $current_config = $_SESSION['phpgw_info']['expresso']['expressoAdmin']; 
    154                 if ($current_config['expressoAdmin_nextid_db_host'] != '') 
    155                 { 
    156                         $this->db->disconnect(); 
    157                         $host = $current_config['expressoAdmin_nextid_db_host']; 
    158                         $port = $current_config['expressoAdmin_nextid_db_port']; 
    159                         $name = $current_config['expressoAdmin_nextid_db_name']; 
    160                         $user = $current_config['expressoAdmin_nextid_db_user']; 
    161                         $pass = $current_config['expressoAdmin_nextid_db_pass']; 
    162                          
    163                         $db = new db(); 
    164                         $db->Halt_On_Error = 'no'; 
    165                         $db->connect($name, $host, $port, $user, $pass, 'pgsql'); 
    166                 } 
    167                 else 
    168                 { 
    169                         $db = $this->db; 
    170                 } 
    171  
    172                 $sql = "UPDATE phpgw_nextid set id = '".$id."' WHERE appname = '" . $type . "'"; 
    173                 if (!$db->query($sql)) 
    174                 { 
    175                         $db->disconnect(); 
    176                         return 'Erro em increment_id:' . pg_last_error(); 
    177                 } 
    178                 else 
    179                 { 
    180                         $db->disconnect(); 
    181                         return true; 
    182                 } 
    183         } 
    184         */ 
    185          
    186150        function add_user2group($gidnumber, $uidnumber) 
    187151        { 
     
    190154                { 
    191155                        $result['status'] = false; 
    192                         $result['msg'] = 'Erro em add_user2group:' . pg_last_error(); 
     156                        $result['msg'] = $this->functions->lang('Error on function') . " db_functions->add_user2group.\n" . $this->functions->lang('Server returns') . ': ' . pg_last_error(); 
    193157                        return $result; 
    194158                } 
     
    203167                        { 
    204168                                $result['status'] = false; 
    205                                 $result['msg'] = 'Erro em add_user2group:' . pg_last_error(); 
     169                                $result['msg'] = $this->functions->lang('Error on function') . " db_functions->add_user2group.\n" . $this->functions->lang('Server returns') . ': ' . pg_last_error(); 
    206170                                return $result; 
    207171                        } 
     
    217181                { 
    218182                        $result['status'] = false; 
    219                         $result['msg'] = 'Erro em add_user2group:' . pg_last_error(); 
     183                        $result['msg'] = $this->functions->lang('Error on function') . " db_functions->remove_user2group.\n" . $this->functions->lang('Server returns') . ': ' . pg_last_error(); 
    220184                        return $result; 
    221185                } 
     
    229193                        { 
    230194                                $result['status'] = false; 
    231                                 $result['msg'] = 'Erro em add_user2group:' . pg_last_error(); 
     195                                $result['msg'] = $this->functions->lang('Error on function') . " db_functions->remove_user2group.\n" . $this->functions->lang('Server returns') . ': ' . pg_last_error(); 
    232196                                return $result; 
    233197                        } 
     
    243207                { 
    244208                        $result['status'] = false; 
    245                         $result['msg'] = 'Erro em add_pref_changepassword:' . pg_last_error(); 
     209                        $result['msg'] = $this->functions->lang('Error on function') . " db_functions->add_pref_changepassword.\n" . $this->functions->lang('Server returns') . ': ' . pg_last_error(); 
    246210                        return $result; 
    247211                } 
     
    256220                        { 
    257221                                $result['status'] = false; 
    258                                 $result['msg'] = 'Erro em add_pref_changepassword:' . pg_last_error(); 
     222                                $result['msg'] = $this->functions->lang('Error on function') . " db_functions->add_pref_changepassword.\n" . $this->functions->lang('Server returns') . ': ' . pg_last_error(); 
    259223                                return $result; 
    260224                        } 
     
    270234                { 
    271235                        $result['status'] = false; 
    272                         $result['msg'] = 'Erro em add_pref_changepassword:' . pg_last_error(); 
     236                        $result['msg'] = $this->functions->lang('Error on function') . " db_functions->remove_pref_changepassword.\n" . $this->functions->lang('Server returns') . ': ' . pg_last_error(); 
    273237                        return $result; 
    274238                } 
     
    282246                        { 
    283247                                $result['status'] = false; 
    284                                 $result['msg'] = 'Erro em remove_pref_changepassword:' . pg_last_error(); 
     248                                $result['msg'] = $this->functions->lang('Error on function') . " db_functions->remove_pref_changepassword.\n" . $this->functions->lang('Server returns') . ': ' . pg_last_error(); 
    285249                                return $result; 
    286250                        } 
     
    301265                                { 
    302266                                        $result['status'] = false; 
    303                                         $result['msg'] = 'Erro em add_id2apps: ' . pg_last_error(); 
     267                                        $result['msg'] = $this->functions->lang('Error on function') . " db_functions->add_id2apps.\n" . $this->functions->lang('Server returns') . ': ' . pg_last_error(); 
    304268                                        return $result; 
    305269                                } 
     
    316280                                        { 
    317281                                                $result['status'] = false; 
    318                                                 $result['msg'] = 'Erro em add_id2apps: ' . pg_last_error(); 
     282                                                $result['msg'] = $this->functions->lang('Error on function') . " db_functions->add_id2apps.\n" . $this->functions->lang('Server returns') . ': ' . pg_last_error(); 
    319283                                                return $result; 
    320284                                        } 
    321285                                        else 
    322286                                        { 
    323                                                 $this->write_log("Adicionado aplicativo $app ao id",$id,'','','');       
     287                                                $this->write_log("Added application","$id:$app");        
    324288                                        } 
    325289                                } 
     
    341305                                { 
    342306                                        $result['status'] = false; 
    343                                         $result['msg'] = 'Erro em remove_id2apps:' . pg_last_error(); 
     307                                        $result['msg'] = $this->functions->lang('Error on function') . " db_functions->remove_id2apps.\n" . $this->functions->lang('Server returns') . ': ' . pg_last_error(); 
    344308                                        return $result; 
    345309                                } 
     
    353317                                        { 
    354318                                                $result['status'] = false; 
    355                                                 $result['msg'] = 'Erro em remove_id2apps:' . pg_last_error(); 
     319                                                $result['msg'] = $this->functions->lang('Error on function') . " db_functions->remove_id2apps.\n" . $this->functions->lang('Server returns') . ': ' . pg_last_error(); 
    356320                                                return $result; 
    357321                                        } 
    358322                                        else 
    359323                                        { 
    360                                                 $this->write_log("Removido aplicativo $app do id",$id,'','','');         
     324                                                $this->write_log("Removed application from id","$id: $app");     
    361325                                        } 
    362326                                } 
     
    467431                        { 
    468432                                $result['status'] = false; 
    469                                 $result['msg'] = 'Erro em set_user_password: ' . pg_last_error(); 
     433                                $result['msg'] = $this->functions->lang('Error on function') . " db_functions->set_user_password.\n" . $this->functions->lang('Server returns') . ': ' . pg_last_error(); 
    470434                                return $result; 
    471435                        } 
     
    578542        } 
    579543         
    580         function write_log($action, $groupinfo='', $userinfo='', $appinfo='', $msg_log='') 
    581         { 
    582                 $sql = "INSERT INTO phpgw_expressoadmin_log (date, manager, action, groupinfo, userinfo, appinfo, msg) " 
    583                 . "VALUES('now','" . $_SESSION['phpgw_info']['expresso']['user']['account_lid'] . "','" . strtolower($action) . "','" . strtolower($groupinfo) . "','" . strtolower($userinfo) . "','" . strtolower($appinfo) . "','" .strtolower($msg_log) . "')"; 
     544        function write_log($action, $about) 
     545        { 
     546                $sql = "INSERT INTO phpgw_expressoadmin_log (date, manager, action, userinfo) " 
     547                . "VALUES('now','" . $_SESSION['phpgw_info']['expresso']['user']['account_lid'] . "','" . strtolower($action) . "','" . strtolower($about) . "')"; 
    584548                $this->db->query($sql); 
    585549                return; 
Note: See TracChangeset for help on using the changeset viewer.