Changeset 1804 for sandbox/filemanager/inc/class.uifilemanager.inc.php
- Timestamp:
- 12/10/09 15:26:19 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/filemanager/inc/class.uifilemanager.inc.php
r1791 r1804 31 31 'dir_ls' => True, 32 32 'search' => True, 33 'showUploadboxes' => True, 33 34 'uploadModel'=>True 34 35 ); … … 69 70 var $edit_save_done_x; 70 71 var $edit_cancel_x; 71 var $upload_x;72 72 73 73 // this ones must be checked thorougly; … … 78 78 var $sortby; 79 79 var $messages; 80 var $show_upload_boxes;81 80 82 81 var $now; … … 347 346 echo "<script src='".$GLOBALS['phpgw_info']['flags']['currentapp']."/js/connector.js'></script>"; 348 347 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>"; 349 349 include('load_lang.php'); 350 350 … … 412 412 } 413 413 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 ))) 432 420 { 433 421 $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 451 424 # if is different path than home and no permission allowed 452 425 if($this->path != $this->bo->homedir && $this->path != $this->bo->fakebase && $this->path != '/' && !$this->can_read) … … 503 476 { 504 477 $this->createdir(); 505 }506 elseif($this->upload_x || $this->show_upload_boxes)507 {508 $this->showUploadboxes();509 478 } 510 479 elseif($this->copy_to_x) … … 907 876 function showUploadboxes() 908 877 { 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 909 888 $this->t->set_file(array('upload' => 'upload.tpl')); 910 889 $this->t->set_block('upload','upload_header','upload_header'); … … 912 891 $this->t->set_block('upload','upload_footer','upload_footer'); 913 892 914 if($this->path != '/' && $this->path != $this->bo->fakebase && $this->can_add)893 if($this->path != '/' && $this->path != $this->bo->fakebase) 915 894 { 916 895 $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.