Changeset 1648 for trunk/phpgwapi


Ignore:
Timestamp:
11/13/09 17:16:13 (14 years ago)
Author:
amuller
Message:

Ticket #597 - melhoria no modulo gerenciador de arquivos

Location:
trunk/phpgwapi
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/phpgwapi/inc/class.vfs_sql.inc.php

    r1627 r1648  
    620620                                $data = array (); 
    621621                        } 
    622  
    623                         /* ExpressoLivre principle: In your home you do what you want*/ 
    624                         if (strpos($data['string'],$this->my_home) === 0) 
    625                                 return True; 
    626  
     622         
    627623                        $default_values = array 
    628624                                ( 
     
    639635                                return True; 
    640636                        } 
     637 
     638                        /* ExpressoLivre principle: In your home you do what you want*/ 
     639                        if (strpos($data['string'],$this->my_home) === 0) 
     640                                return True; 
     641                        if ($data['relatives'][0] == RELATIVE_NONE || $data['relatives'][0] == RELATIVE_ALL) 
     642                        { 
     643                                $path = explode('/',$data['string']); 
     644                                $data['string'] = '/'.$path[1].'/'.$path[2]; 
     645                        } 
     646 
     647 
    641648 
    642649                        if (!$data['owner_id']) 
     
    703710                                   We don't use ls () to get owner_id as we normally would, 
    704711                                   because ls () calls acl_check (), which would create an infinite loop 
    705                                 */ 
    706                                 $query = $GLOBALS['phpgw']->db->query ("SELECT owner_id FROM phpgw_vfs WHERE directory='". 
    707                                         $GLOBALS['phpgw']->db->db_addslashes($p2->fake_leading_dirs_clean)."' AND name='". 
    708                                         $GLOBALS['phpgw']->db->db_addslashes($p2->fake_name_clean)."'" . $this->extra_sql (array ('query_type' => VFS_SQL_SELECT)), __LINE__, __FILE__); 
    709                                 $GLOBALS['phpgw']->db->next_record (); 
    710  
    711                                 $owner_id = $GLOBALS['phpgw']->db->Record['owner_id']; 
     712                                 */ 
     713                                $owner_id = $this->ownerOf($p2->fake_leading_dirs_clean,$p2->fake_name_clean); 
    712714                        } 
    713715                        else 
    714716                        { 
    715717                                $owner_id = $data['owner_id']; 
    716                         } 
    717  
    718                         /* This is correct.  The ACL currently doesn't handle undefined values correctly */ 
    719                         if (!$owner_id) 
    720                         { 
    721                                 $owner_id = 0; 
    722718                        } 
    723719 
     
    781777                                return False; 
    782778                        } 
     779                } 
     780                function ownerOf($base,$path){ 
     781                        $query = $GLOBALS['phpgw']->db->query ("SELECT owner_id FROM phpgw_vfs WHERE directory='". 
     782                        $GLOBALS['phpgw']->db->db_addslashes($base)."' AND name='". 
     783                        $GLOBALS['phpgw']->db->db_addslashes($path)."' ".$this->extra_sql (array ('query_type' => VFS_SQL_SELECT)), __LINE__, __FILE__); 
     784                        $GLOBALS['phpgw']->db->next_record(); 
     785                        $owner_id = $GLOBALS['phpgw']->db->Record['owner_id']; 
     786                        if (!$owner_id) 
     787                        { 
     788                                $owner_id = 0; 
     789                        } 
     790                        return $owner_id; 
    783791                } 
    784792 
     
    856864                        $path = explode('/',$data['string']); 
    857865                        $quota = $this->get_quota(array('string' => '/'.$path[1].'/'.$path[2])); 
    858                         if ($quota > 0 && $this->get_size($data) >= $quota * 1024 * 1024) 
     866                        if ($quota > 0 && $this->get_size('/'.$path[1].'/'.$path[2]) >= $quota * 1024 * 1024) 
    859867                                return false; 
    860868 
     
    887895                                $acl_operation = PHPGW_ACL_ADD; 
    888896                        } 
    889                         // In your dir you can do anything you want 
    890                         $path = explode('/',$p->fake_full_path); 
    891                         if (!$this->acl_check (array( 
    892                                         'string'        => '/'.$path[1].'/'.$path[2], 
    893                                         'relatives'     => array ($p->mask), 
    894                                         'operation'     => $acl_operation 
    895                                 )) 
    896                         ) 
    897                         { 
    898                                 return False; 
    899                         } 
    900  
    901897                        umask(0177); 
    902898 
     
    10981094                        $path = explode('/',$data['to']); 
    10991095                        $quota = $this->get_quota(array('string' => '/'.$path[1].'/'.$path[2])); 
    1100                         $size = $this->get_size(array('string' => $data['to'], 'relatives' => $data['relatives'][1])); 
     1096                        $size = $this->get_size(array('string' => '/'.$path[1].'/'.$path[2], 'relatives' => $data['relatives'][1])); 
    11011097                        if ($quota > 0 && $size >= $quota * 1024 * 1024) 
    11021098                                return false; 
     
    13631359                                $data = array (); 
    13641360                        } 
    1365  
    1366                         $path = explode('/',$data['to']); 
    1367                         $quota = $this->get_quota(array('string' => '/'.$path[1].'/'.$path[2])); 
    1368                         $size = $this->get_size(array('string' => $data['to'], 'relatives' => $data['relatives'][1])); 
     1361                        if ($data['relatives'][1] == RELATIVE_NONE) 
     1362                        { 
     1363                                $path = explode('/',$data['to']); 
     1364                                $quota = $this->get_quota(array('string' => '/'.$path[1].'/'.$path[2])); 
     1365                                $size = $this->get_size(array('string' => '/'.$path[1].'/'.$path[2], 'relatives' => $data['relatives'][1])); 
     1366                        } 
     1367                        else 
     1368                        { 
     1369                                $quota = $this->get_quota(array('string' => $this->my_home)); 
     1370                                $size = $this->get_size(array('string' => $this->my_home, 'relatives' => $data['relatives'][1])); 
     1371                        } 
    13691372                        if ($quota > 0 && $size >= $quota * 1024 * 1024) 
    13701373                                return false; 
     
    13911394                                ) 
    13921395                        ); 
    1393                         // In your dir you can do anything you want 
    1394                         $path = explode('/',$t->fake_full_path); 
     1396 
    13951397                        if (!$this->acl_check (array( 
    1396                                         'string'        => '/'.$path[1].'/'.$path[2], 
    1397                                         'relatives'     => array ($f->mask), 
    1398                                         'operation'     => PHPGW_ACL_READ 
    1399                                 )) 
    1400                                 || !$this->acl_check (array( 
    1401                                         'string'        => '/'.$path[1].'/'.$path[2], 
    1402                                         'relatives'     => array ($f->mask), 
    1403                                         'operation'     => PHPGW_ACL_DELETE 
    1404                                 )) 
    1405                         ) 
    1406                         { 
    1407                                 return False; 
    1408                         } 
    1409  
    1410                         if (!$this->acl_check (array( 
    1411                                         'string'        => '/'.$path[1].'/'.$path[2], 
     1398                                        'string'        => $data['to'], 
    14121399                                        'relatives'     => array ($t->mask), 
    14131400                                        'operation'     => PHPGW_ACL_ADD 
     
    14251412                        { 
    14261413                                if (!$this->acl_check (array( 
    1427                                                 'string'        => '/'.$path[1].'/'.$path[2], 
     1414                                                'string'        => $data['to'], 
    14281415                                                'relatives'     => array ($t->mask), 
    14291416                                                'operation'     => PHPGW_ACL_EDIT 
     
    16151602                                ) 
    16161603                        ); 
    1617                         // Inside the folder that you have pemission you can do anything you want 
    1618                         $path = explode('/',$p->fake_full_path); 
    1619                         if (!$this->acl_check (array( 
    1620                                         'string'        => '/'.$path[1].'/'.$path[2], 
    1621                                         'relatives'     => array ($p->mask), 
    1622                                         'operation'     => PHPGW_ACL_DELETE 
    1623                                 )) 
    1624                         ) 
    1625                         { 
    1626                                 return False; 
    1627                         } 
    1628  
    16291604                        if (!$this->file_exists (array( 
    16301605                                        'string'        => $data['string'], 
  • trunk/phpgwapi/templates/default/css/rochas.css

    r1514 r1648  
    179179{ 
    180180        height:9px; 
     181} 
     182 
     183.dsused 
     184{ 
     185                background-image: url(../images/dsused.gif); 
    181186} 
    182187 
Note: See TracChangeset for help on using the changeset viewer.