Ignore:
Timestamp:
10/28/09 08:04:06 (14 years ago)
Author:
amuller
Message:

Ticket #597 - Melhorias no filemanager com correção de bugs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sandbox/filemanager/inc/class.uifilemanager.inc.php

    r1529 r1533  
    293293                                $this->path = $this->cdtodir; 
    294294                        } 
    295 */ 
     295 */ 
     296                        if(!$this->bo->vfs->acl_check(array( 
     297                                'string' => $this->path, 
     298                                'relatives' => array(RELATIVE_NONE), 
     299                                'operation' => PHPGW_ACL_READ 
     300                        ))) 
     301                        { 
     302                                $this->path = $this->bo->homedir;        
     303                        } 
    296304                        // new method for switching to a new dir. 
    297305                        if($this->changedir=='true' && $this->cdtodir || $this->goto_x) 
     
    356364                                } 
    357365                        $this->readable_groups = array(); 
    358  
    359366                        while(list($num, $account) = each($groups)) 
    360367                        { 
     
    386393                                $this->bo->vfs->working_id = $this->bo->userinfo['username']; 
    387394                        } 
    388  
    389395 
    390396                        # FIXME # comment waht happens here 
     
    10861092                                                } 
    10871093 
    1088                                                 if(!$this->rename_x && $this->can_edit) 
     1094                                                if(!$this->rename_x && $this->can_edit &&  
     1095                                                $_SESSION['phpgw_info']['user']['preferences']['filemanager']['comment'] == 1) 
    10891096                                                { 
    10901097                                                        $toolbar.=$this->inputImage('edit_comments','edit_comments',lang('Edit comments')); 
     
    11831190                                         $c->read_repository(); 
    11841191                                         $current_config = $c->config_data; 
    1185                                          $max_size = $current_config['filemanager_Max_attachment_size']; 
     1192                                         $max_size = $current_config['filemanager_Max_file_size']; 
    11861193                                         if (! $max_size) 
    11871194                                                 $max_size = ini_get('upload_max_filesize'); 
     
    13841391                                        { 
    13851392                                                $copied++; 
    1386                                                 $this->message .= lang('Copied %1 to %2', $this->disppath.'/'.$file, $this->todir.'/'.$file); 
     1393                                                $this->messages[] .= lang('Copied %1 to %2', $this->disppath.'/'.$file, $this->todir.'/'.$file); 
    13871394                                        } 
    13881395                                        else 
    13891396                                        { 
    1390                                                 $this->message .= $GLOBALS['phpgw']->common->error_list(array(lang('Could not copy %1 to %2', $this->disppath.'/'.$file, $this->todir.'/'.$file))); 
     1397                                                $this->messages[] .= lang('Could not copy %1 to %2', $this->disppath.'/'.$file, $this->todir.'/'.$file); 
    13911398                                        } 
    13921399                                } 
     
    15991606                function edit() 
    16001607                { 
     1608                        $files = array_keys($this->fileman); 
     1609                        $this->file = $this->fileman[$files[0]]; 
     1610                        if($this->file) 
     1611                        { 
     1612                                $ls_array = $this->bo->vfs->ls(array( 
     1613                                        'string'        => $this->path.'/'.$this->file, 
     1614                                        'relatives'     => array(RELATIVE_ALL), 
     1615                                        'checksubdirs'  => False, 
     1616                                        'nofiles'       => True 
     1617                                )); 
     1618 
     1619                                if($ls_array[0]['mime_type']) 
     1620                                { 
     1621                                        $mime_type = $ls_array[0]['mime_type']; 
     1622                                } 
     1623                                elseif($this->prefs['viewtextplain']) 
     1624                                { 
     1625                                        $mime_type = 'text/plain'; 
     1626                                } 
     1627                                $viewable = array('','text/plain','text/csv','text/html','text/text'); 
     1628 
     1629                                if(!in_array($mime_type,$viewable)){ 
     1630                                        echo lang('Inpossbile to edit this file'); 
     1631                                        return False; 
     1632                                } 
     1633                        } 
     1634 
    16011635                        $this->readFilesInfo(); 
    16021636 
Note: See TracChangeset for help on using the changeset viewer.