Changeset 370


Ignore:
Timestamp:
07/28/08 16:42:45 (16 years ago)
Author:
niltonneto
Message:

Ver ocorrência #270 do Trac.

Location:
trunk/phpgwapi/inc
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/phpgwapi/inc/adodb/drivers/adodb-postgres64.inc.php

    r34 r370  
    679679                } 
    680680                if ($this->_connectionID === false) return false; 
     681                $this->_nestedSQL = true; 
     682                 
     683                /* jakjr: I really do not know why this is executed. 
    681684                $this->Execute("set datestyle='ISO'"); 
    682685                 
     
    686689                        $this->_nestedSQL = true; 
    687690                } 
     691                */ 
    688692                return true; 
    689693        } 
  • trunk/phpgwapi/inc/class.applications.inc.php

    r2 r370  
    275275                function read_installed_apps() 
    276276                { 
    277                         $this->db->query('select * from phpgw_applications where app_enabled != 0 order by app_order asc',__LINE__,__FILE__); 
    278                         if($this->db->num_rows()) 
    279                         { 
    280                                 while ($this->db->next_record()) 
    281                                 { 
    282                                         $title = $app_name = $this->db->f('app_name'); 
    283  
    284                                         if (@is_array($GLOBALS['phpgw_info']['user']['preferences']) && 
    285                                             ($t = lang($app_name)) != $app_name.'*') 
     277                        //jakjr: so vai ao banco, caso o array de apps esteja vazio. 
     278                        if (empty($GLOBALS['phpgw_info']['apps'])) 
     279                        { 
     280                                $this->db->query('select * from phpgw_applications where app_enabled != 0 order by app_order asc',__LINE__,__FILE__); 
     281                                if($this->db->num_rows()) 
     282                                { 
     283                                        while ($this->db->next_record()) 
    286284                                        { 
    287                                                 $title = $t; 
     285                                                $title = $app_name = $this->db->f('app_name'); 
     286 
     287                                                if (@is_array($GLOBALS['phpgw_info']['user']['preferences']) && 
     288                                                    ($t = lang($app_name)) != $app_name.'*') 
     289                                                { 
     290                                                        $title = $t; 
     291                                                } 
     292                                                $GLOBALS['phpgw_info']['apps'][$this->db->f('app_name')] = Array( 
     293                                                        'title'   => $title, 
     294                                                        'name'    => $this->db->f('app_name'), 
     295                                                        'enabled' => True, 
     296                                                        'status'  => $this->db->f('app_enabled'), 
     297                                                        'id'      => (int)$this->db->f('app_id'), 
     298                                                        'order'   => (int)$this->db->f('app_order'), 
     299                                                        'version' => $this->db->f('app_version') 
     300                                                ); 
    288301                                        } 
    289                                         $GLOBALS['phpgw_info']['apps'][$this->db->f('app_name')] = Array( 
    290                                                 'title'   => $title, 
    291                                                 'name'    => $this->db->f('app_name'), 
    292                                                 'enabled' => True, 
    293                                                 'status'  => $this->db->f('app_enabled'), 
    294                                                 'id'      => (int)$this->db->f('app_id'), 
    295                                                 'order'   => (int)$this->db->f('app_order'), 
    296                                                 'version' => $this->db->f('app_version') 
    297                                         ); 
    298302                                } 
    299303                        } 
  • trunk/phpgwapi/inc/class.config.inc.php

    r2 r370  
    7474                        { 
    7575                                $this->db->lock(array('phpgw_config','phpgw_app_sessions')); 
     76                                /*jakjr: ExpressoLivre does not use this. 
    7677                                if($this->appname == 'phpgwapi') 
    7778                                { 
    7879                                        $this->db->query("delete from phpgw_app_sessions where sessionid = '0' and loginid = '0' and app = '".$this->appname."' and location = 'config'",__LINE__,__FILE__); 
    79                                 } 
     80                                }*/ 
    8081                                foreach($this->config_data as $name => $value) 
    8182                                { 
  • trunk/phpgwapi/inc/class.errorlog.inc.php

    r189 r370  
    104104                function commit() 
    105105                { 
     106                        // jakjr: where I disable the log event. 
     107                        return true; 
    106108                        $db = $GLOBALS['phpgw']->db; 
    107109//                      $db->lock('phpgw_log'); 
  • trunk/phpgwapi/inc/class.hooks.inc.php

    r2 r370  
    4141                        $this->db = $db ? $db : $GLOBALS['phpgw']->db;  // this is to allow setup to set the db 
    4242 
    43                         $this->db->query("SELECT hook_appname, hook_location, hook_filename FROM phpgw_hooks",__LINE__,__FILE__); 
    44                         while( $this->db->next_record() ) 
    45                         { 
    46                                 $this->found_hooks[$this->db->f('hook_appname')][$this->db->f('hook_location')] = $this->db->f('hook_filename'); 
    47                         } 
    48                         //echo '<pre>'; 
    49                         //print_r($this->found_hooks); 
    50                         //echo '</pre>'; 
     43                        //jakjr: Go search in DB, only if the array is empty. 
     44                        if (empty($this->found_hooks)) 
     45                        { 
     46                                $this->db->query("SELECT hook_appname, hook_location, hook_filename FROM phpgw_hooks",__LINE__,__FILE__); 
     47                                while( $this->db->next_record() ) 
     48                                { 
     49                                        $this->found_hooks[$this->db->f('hook_appname')][$this->db->f('hook_location')] = $this->db->f('hook_filename'); 
     50                                } 
     51                                //echo '<pre>'; 
     52                                //print_r($this->found_hooks); 
     53                                //echo '</pre>'; 
     54                        } 
    5155                } 
    5256                 
  • trunk/phpgwapi/inc/class.sessions.inc.php

    r2 r370  
    186186                                $save_rep = True; 
    187187                        } 
     188                         
     189                        // jakjr: ? usando o hardcode, para evitar sempre 2 chamadas ao banco. 
     190                        /* 
    188191                        if ($save_rep) 
    189192                        { 
     
    199202                                $config->save_repository(); 
    200203                                unset($config); 
    201                         } 
     204                        }*/ 
    202205                } 
    203206 
     
    493496 
    494497                        $this->clean_sessions(); 
    495                         sessions_::split_login_domain($login,$this->account_lid,$this->account_domain); 
     498                        //sessions_::split_login_domain($login,$this->account_lid,$this->account_domain); 
     499                        // jakjr: allow uid with (@); 
     500                        $this->account_lid = $login; 
     501                        $this->account_domain = 'default'; 
    496502 
    497503                        $now = time(); 
     
    514520                        } 
    515521 
     522                        /* jakjr: Expresso does not use auto-create account. 
    516523                        if (!$this->account_id && $GLOBALS['phpgw_info']['server']['auto_create_acct'] == True) 
    517524                        { 
    518525                                $this->account_id = $GLOBALS['phpgw']->accounts->auto_add($this->account_lid, $passwd); 
    519526                        } 
     527                        */ 
    520528 
    521529                        $GLOBALS['phpgw_info']['user']['account_id'] = $this->account_id; 
     
    618626                                        . $sessionid . "'",__LINE__,__FILE__); 
    619627                        } 
     628                        /* jakjr: Clean phpgw_access_log with a crontab event. 
    620629                        if ($GLOBALS['phpgw_info']['server']['max_access_log_age']) 
    621630                        { 
     
    623632 
    624633                                $GLOBALS['phpgw']->db->query("DELETE FROM phpgw_access_log WHERE li < $max_age"); 
    625                         } 
     634                        }*/ 
    626635                } 
    627636 
     
    635644                function login_blocked($login,$ip) 
    636645                { 
     646                        /*jakjr: Disable this protection. When block an proxy server ip, all the sub-network will be blocking.*/ 
     647                        return false; 
    637648                        $blocked = False; 
    638649                        $block_time = time() - $GLOBALS['phpgw_info']['server']['block_time'] * 60; 
  • trunk/phpgwapi/inc/functions.inc.php

    r266 r370  
    162162        } 
    163163        $GLOBALS['phpgw']->db->Halt_On_Error = 'no'; 
     164        /* jakjr: ExpressoLivre: We do not count the config table. */ 
     165        if (! 
    164166        $GLOBALS['phpgw']->db->connect( 
    165167                $GLOBALS['phpgw_info']['server']['db_name'], 
     
    169171                $GLOBALS['phpgw_info']['server']['db_pass'], 
    170172                $GLOBALS['phpgw_info']['server']['db_type'] 
    171         ); 
    172         @$GLOBALS['phpgw']->db->query("SELECT COUNT(config_name) FROM phpgw_config"); 
    173         if(!@$GLOBALS['phpgw']->db->next_record()) 
    174         { 
    175                 $setup_dir = str_replace($_SERVER['PHP_SELF'],'index.php','setup/'); 
     173        ) ) 
     174        //@$GLOBALS['phpgw']->db->query("SELECT COUNT(config_name) FROM phpgw_config"); 
     175        //if(!@$GLOBALS['phpgw']->db->next_record()) 
     176        { 
     177                 
    176178                /* BEGIN - CELEPAR - jakjr - 05/06/2006 */ 
     179                /* $setup_dir = str_replace($_SERVER['PHP_SELF'],'index.php','setup/'); */ 
    177180                /*echo '<center><b>Fatal Error:</b> It appears that you have not created the database tables for ' 
    178181                        .'eGroupWare.  Click <a href="' . $setup_dir . '">here</a> to run setup.</center>';*/ 
     
    185188        /* Fill phpgw_info["server"] array */ 
    186189        // An Attempt to speed things up using cache premise 
     190        /* jakjr: ExpressoLivre does not use cache. */ 
     191        /* 
    187192        $GLOBALS['phpgw']->db->query("select config_value from phpgw_config WHERE config_app='phpgwapi' and config_name='cache_phpgw_info'",__LINE__,__FILE__); 
    188193        if ($GLOBALS['phpgw']->db->num_rows()) 
     
    190195                $GLOBALS['phpgw']->db->next_record(); 
    191196                $GLOBALS['phpgw_info']['server']['cache_phpgw_info'] = stripslashes($GLOBALS['phpgw']->db->f('config_value')); 
    192         } 
    193  
     197        }*/ 
     198 
     199        /* jakjr: ExpressoLivre does not use cache. */ 
     200        /*       
    194201        $cache_query = "select content from phpgw_app_sessions where" 
    195202                ." sessionid = '0' and loginid = '0' and app = 'phpgwapi' and location = 'config'"; 
     
    197204        $GLOBALS['phpgw']->db->query($cache_query,__LINE__,__FILE__); 
    198205        $server_info_cache = $GLOBALS['phpgw']->db->num_rows(); 
    199  
     206        */ 
     207        /* 
    200208        if(@$GLOBALS['phpgw_info']['server']['cache_phpgw_info'] && $server_info_cache) 
    201209        { 
     
    204212        } 
    205213        else 
    206         { 
    207                 $GLOBALS['phpgw']->db->query("select * from phpgw_config WHERE config_app='phpgwapi'",__LINE__,__FILE__); 
     214        {*/ 
     215                $GLOBALS['phpgw']->db->query("SELECT * from phpgw_config WHERE config_app='phpgwapi'",__LINE__,__FILE__); 
    208216                while ($GLOBALS['phpgw']->db->next_record()) 
    209217                { 
     
    211219                } 
    212220 
     221                /* 
    213222                if(@isset($GLOBALS['phpgw_info']['server']['cache_phpgw_info'])) 
    214223                { 
     
    221230                                . "'0','0','phpgwapi','config','".addslashes(serialize($GLOBALS['phpgw_info']['server']))."')"; 
    222231                        $GLOBALS['phpgw']->db->query($cache_query,__LINE__,__FILE__); 
    223                 } 
    224         } 
     232                }*/ 
     233        //} 
    225234        unset($cache_query); 
    226235        unset($server_info_cache); 
Note: See TracChangeset for help on using the changeset viewer.