Ignore:
Timestamp:
12/10/09 15:26:19 (14 years ago)
Author:
amuller
Message:

Ticket #597 - Melhorias no modulo gerenciador de arquivos

File:
1 edited

Legend:

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

    r1791 r1804  
    3131                        'dir_ls' => True, 
    3232                        'search' => True, 
     33                        'showUploadboxes' => True, 
    3334                        'uploadModel'=>True 
    3435                ); 
     
    6970                var $edit_save_done_x; 
    7071                var $edit_cancel_x; 
    71                 var $upload_x; 
    7272 
    7373                // this ones must be checked thorougly; 
     
    7878                var $sortby; 
    7979                var $messages; 
    80                 var $show_upload_boxes; 
    8180 
    8281                var $now; 
     
    347346                        echo "<script src='".$GLOBALS['phpgw_info']['flags']['currentapp']."/js/connector.js'></script>"; 
    348347                        echo "<script src='".$GLOBALS['phpgw_info']['flags']['currentapp']."/js/draw_api.js'></script>"; 
     348                        echo "<script src='".$GLOBALS['phpgw_info']['flags']['currentapp']."/js/drag_area.js'></script>"; 
    349349                        include('load_lang.php'); 
    350350 
     
    412412                        } 
    413413 
    414                         # We determine if they're in their home directory or a group's directory, 
    415                         # and set the VFS working_id appropriately 
    416                         if((preg_match('+^'.$this->bo->fakebase.'\/(.*)(\/|$)+U', $this->path, $matches)) && $matches[1] != $this->bo->userinfo['account_lid']) //FIXME matches not defined 
    417  
    418                         { 
    419                                 $this->bo->vfs->working_id = $GLOBALS['phpgw']->accounts->name2id($matches[1]);//FIXME matches not defined 
    420  
    421                         } 
    422                         else 
    423                         { 
    424                                 $this->bo->vfs->working_id = $this->bo->userinfo['username']; 
    425                         } 
    426  
    427                         # Check available permissions for $this->path, so we can disable unusable operations in user interface 
    428                         $path = explode('/',$this->path); 
    429                         $owner_id = $this->bo->vfs->ownerOf($this->bo->fakebase,$path[2]); 
    430                         $user_id = $GLOBALS['phpgw_info']['user']['account_id']; 
    431                         if ($owner_id == $user_id) 
     414                        /*Check permission*/ 
     415                        if($this->bo->vfs->acl_check(array( 
     416                                'string' => $this->path, 
     417                                'relatives' => array(RELATIVE_NONE), 
     418                                'operation' => PHPGW_ACL_READ 
     419                        ))) 
    432420                        { 
    433421                                $this->can_read = True; 
    434                                 $this->can_add = True; 
    435                                 $this->can_edit = True; 
    436                                 $this->can_delete = True; 
    437                                 $this->can_private = True; 
    438                         }else 
    439                         { 
    440                                 $acl = CreateObject ('phpgwapi.acl', $owner_id); 
    441                                 $acl->account_id = $owner_id; 
    442                                 $acl->read_repository(); 
    443                                 $rights = $acl->get_rights($user_id); 
    444                                 $this->can_read = $rights & PHPGW_ACL_READ; 
    445                                 $this->can_add = $rights & PHPGW_ACL_ADD; 
    446                                 $this->can_edit = $rights & PHPGW_ACL_EDIT; 
    447                                 $this->can_delete = $rights & PHPGW_ACL_DELETE; 
    448                                 $this->can_private = $rights & PHPGW_ACL_PRIVATE; 
    449                         } 
    450          
     422                        } 
     423 
    451424                        # if is different path than home and no permission allowed 
    452425                        if($this->path != $this->bo->homedir && $this->path != $this->bo->fakebase && $this->path != '/' && !$this->can_read) 
     
    503476                        { 
    504477                                $this->createdir(); 
    505                         } 
    506                         elseif($this->upload_x || $this->show_upload_boxes) 
    507                         { 
    508                                 $this->showUploadboxes(); 
    509478                        } 
    510479                        elseif($this->copy_to_x) 
     
    907876                function showUploadboxes() 
    908877                { 
     878                        $GLOBALS['phpgw_info']['flags'] = array 
     879                                ( 
     880                                        'currentapp'    => 'filemanager', 
     881                                        'noheader'      => True, 
     882                                        'nonavbar' => True, 
     883                                        'nofooter'      => True, 
     884                                        'noappheader'   => True 
     885                                ); 
     886                        $GLOBALS['phpgw']->common->phpgw_header(); 
     887 
    909888                        $this->t->set_file(array('upload' => 'upload.tpl')); 
    910889                        $this->t->set_block('upload','upload_header','upload_header'); 
     
    912891                        $this->t->set_block('upload','upload_footer','upload_footer'); 
    913892 
    914                         if($this->path != '/' && $this->path != $this->bo->fakebase && $this->can_add) 
     893                        if($this->path != '/' && $this->path != $this->bo->fakebase) 
    915894                        { 
    916895                                $vars[max_size]=lang('Note: Uploaded is limited to %1MB',($this->current_config['filemanager_Max_file_size'])); 
Note: See TracChangeset for help on using the changeset viewer.