Project

General

Profile

Bug #2239

Problem with "my_files" and split users directories

Added by Yannick Warnier over 10 years ago. Updated over 10 years ago.

Status:
Bug resolved
Priority:
High
Category:
-
Target version:
Start date:
12/11/2010
Due date:
% Done:

100%

Estimated time:
1.00 h
Spent time:
Complexity:
Normal
SCRUM pts - complexity:
5

Description

The users directories splitting feature is broken by the recent "my_files" directory management. api_get_user_id() cannot be used directly to generate the user directory in main/upload/users. It has to go through a call to UserManager::get_user_picture_path_by_id(api_get_user_id(),'rel').

References found:

 ./main/document/document.php:    $user_folder  = api_get_path(SYS_CODE_PATH).'upload/users/'.api_get_user_id().'/my_files/';
 ./main/inc/course_document.inc.php:        $base_work_dir = $_configuration['root_sys'].'main/upload/users/'.api_get_user_id().'/my_files/';
 ./main/inc/course_document.inc.php:        $http_www = $_configuration['root_web'].'main/upload/users/'.api_get_user_id().'/my_files/';
 ./main/inc/lib/fckeditor/fckeditor.php:                $config['CreateDocumentWebDir'] = api_get_path(WEB_PATH).'main/upload/users'.api_get_user_id().'/my_files/';
 ./main/inc/lib/fckeditor/fckeditor.php:                $config['CreateDocumentDir'] = $relative_path_prefix.'upload/users/'.api_get_user_id().'/my_files/';
 ./main/inc/lib/fckeditor/repository.php:$user_folder = api_get_path(SYS_PATH).'main/upload/users/'.api_get_user_id().'/my_files/';
 ./main/inc/lib/fckeditor/editor/plugins/ImageManager/config.inc.php:        $IMConfig['base_dir'] = $_configuration['root_sys'].'main/upload/users/'.api_get_user_id().'/my_files/';
 ./main/inc/lib/fckeditor/editor/plugins/ImageManager/config.inc.php:        $IMConfig['base_url'] = $_configuration['root_web'].'main/upload/users/'.api_get_user_id().'/my_files/';
 ./main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/inc/config.base.php:            $PathChamiloAjaxFileManager='../../../../../../../main/upload/users/'.api_get_user_id().'/my_files/';
 ./main/inc/lib/fckeditor/editor/filemanager/connectors/php/config.php:        $Config['UserFilesPath'] = api_get_path(REL_PATH).'main/upload/users/'.api_get_user_id().'/my_files/';

Fixes to this code have to be taken with care to avoid mistakes

Associated revisions

Revision 79caf51a (diff)
Added by Yannick Warnier over 10 years ago

Fixed problem with split users directories (fixes #2239)

History

#1

Updated by Juan Carlos Raña Trabado over 10 years ago

more info please and some sample

#2

Updated by Juan Carlos Raña Trabado over 10 years ago

In UserManager::get_user_picture_path_by_id(api_get_user_id(),'rel') what is rel?

#3

Updated by Ivan Tcholakov over 10 years ago

I know the following convention about returned paths:

'system' : C:\xampp\htdocs\chamilo\......\my_file.png
'web' : http://localhost/chamilo/....../my_file.png
'rel' : /chamilo/....../my_file.png ---> This "semi-absolute" type of path, it does not depend on the server's name.

#4

Updated by Yannick Warnier over 10 years ago

  • Status changed from New to Bug resolved
  • Assignee set to Yannick Warnier
  • % Done changed from 0 to 100

Fixed by http://code.google.com/p/chamilo/source/detail?r=b09e388a520435d159e32ae44cf420ae207d7c83&repo=classic and added an entry in changelog about a known issue that might occur in some very specific cases.

Also available in: Atom PDF