Changeset 3104


Ignore:
Timestamp:
07/30/10 14:50:18 (10 years ago)
Author:
amuller
Message:

Ticket #1135 - Instalando Filemanager no branches 2.2

Location:
branches/2.2/phpgwapi
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2/phpgwapi/inc/class.vfs_sql.inc.php

    r3019 r3104  
    791791                } 
    792792                function ownerOf($base,$path){ 
    793                         $query = $GLOBALS['phpgw']->db->query ("SELECT owner_id FROM phpgw_vfs WHERE directory='". 
    794                         $GLOBALS['phpgw']->db->db_addslashes($base)."' AND name='". 
    795                         $GLOBALS['phpgw']->db->db_addslashes($path)."' ".$this->extra_sql (array ('query_type' => VFS_SQL_SELECT)), __LINE__, __FILE__); 
     793                        $query = $GLOBALS['phpgw']->db->query ("SELECT owner_id FROM phpgw_vfs WHERE ". 
     794                                "( directory='".$GLOBALS['phpgw']->db->db_addslashes($base)."' AND name='".$GLOBALS['phpgw']->db->db_addslashes($path)."' ". 
     795                                "OR directory='/home/".$GLOBALS['phpgw']->db->db_addslashes($path)."') ". 
     796                                $this->extra_sql (array ('query_type' => VFS_SQL_SELECT)), __LINE__, __FILE__); 
     797 
    796798                        $GLOBALS['phpgw']->db->next_record(); 
    797799                        $owner_id = $GLOBALS['phpgw']->db->Record['owner_id']; 
     
    803805                } 
    804806 
    805                 /*used to safe memory in downloads*/ 
     807                /*used to save memory in downloads*/ 
    806808                function print_content ($data) 
    807809                { 
     
    840842 
    841843                                ob_end_flush(); 
     844         
     845                                $bufferSize = 10240; 
    842846 
    843847                                if ($fp = fopen ($p->real_full_path, 'rb')) 
    844848                                { 
    845                                         for ($i=0; $i<=filesize($p->real_full_path); $i+=10240) 
     849                                        for ($i=$bufferSize; $i<=filesize($p->real_full_path); $i+=$bufferSize) 
    846850                                        { 
    847851                                                echo fread($fp, $i); 
  • branches/2.2/phpgwapi/setup/tables_update.inc.php

    r3031 r3104  
    8888        function phpgwapi_upgrade2_1_000() 
    8989        { 
     90                global $setup_info,$phpgw_setup; 
     91                $phpgw_setup->oProc->query("ALTER TABLE phpgw_vfs ALTER COLUMN created TYPE timestamp;"); 
     92                $phpgw_setup->oProc->query("ALTER TABLE phpgw_vfs ALTER COLUMN modified TYPE timestamp;"); 
     93                $phpgw_setup->oProc->query("CREATE TABLE phpgw_vfs_quota (directory VARCHAR(100), quota_size INT NOT NULL, PRIMARY KEY (directory));"); 
     94                $phpgw_setup->oProc->query("ALTER TABLE phpgw_vfs ADD COLUMN type integer DEFAULT 0;"); 
     95                $phpgw_setup->oProc->query("ALTER TABLE phpgw_vfs ADD COLUMN summary bytea;"); 
     96                $phpgw_setup->oProc->query("INSERT INTO phpgw_config VALUES ('filemanager','filemanager_quota_size',500);"); 
     97                $phpgw_setup->oProc->query("INSERT INTO phpgw_config VALUES ('filemanager','filemanager_Max_file_size',20);"); 
     98                $phpgw_setup->oProc->query('INSERT INTO phpgw_preferences VALUES (-2,\'filemanager\',\'a:19:{s:4:"name";s:1:"1";s:9:"mime_type";s:1:"1";s:4:"size";s:1:"1";s:7:"created";s:1:"1";s:8:"modified";s:1:"1";s:5:"owner";s:1:"1";s:12:"createdby_id";s:1:"1";s:13:"modifiedby_id";s:1:"1";s:3:"app";s:1:"0";s:7:"comment";s:1:"1";s:7:"version";s:1:"1";s:12:"viewinnewwin";s:1:"1";s:12:"viewonserver";s:1:"1";s:13:"viewtextplain";s:1:"1";s:6:"dotdot";s:1:"1";s:8:"dotfiles";s:1:"1";s:8:"pdf_type";s:8:"portrait";s:14:"pdf_paper_type";s:2:"a4";s:14:"files_per_page";s:3:"200";}\');'); 
     99                $phpgw_setup->oProc->query("INSERT INTO phpgw_vfs (owner_id, createdby_id, modifiedby_id, created, modified, size, mime_type, deleteable, comment, app, directory, name, link_directory, link_name) VALUES (1,0,0,'1970-01-01',NULL,NULL,'Directory','Y',NULL,NULL,'/','', NULL, NULL);"); 
     100                $phpgw_setup->oProc->query("INSERT INTO phpgw_vfs (owner_id, createdby_id, modifiedby_id, created, modified, size, mime_type, deleteable, comment, app, directory, name, link_directory, link_name) VALUES (2,0,0,'1970-01-01',NULL,NULL,'Directory','Y',NULL,NULL,'/','home', NULL, NULL);"); 
    90101                $GLOBALS['setup_info']['phpgwapi']['currentver'] = '2.2.000'; 
    91102                return $GLOBALS['setup_info']['phpgwapi']['currentver']; 
Note: See TracChangeset for help on using the changeset viewer.