Issue Details (XML | Word | Printable)

Key: MDL-8605
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Blocker Blocker
Assignee: Nicolas Connault
Reporter: Eloy Lafuente (stronk7)
Votes: 0
Watchers: 9
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

Reduce the number of dirs under the users file area

Created: 22/Feb/07 02:16 AM   Updated: 12/May/09 04:14 PM
Return to search
Component/s: Administration
Affects Version/s: 1.8, 1.9
Fix Version/s: 1.8.4, 1.9, 2.0

File Attachments: 1. File hash.php (0.8 kB)
2. File newhash.php (0.8 kB)

Issue Links:
Dependency
Relates
 

Participants: Andrea Bicciolo, Anthony Borrow, Eloy Lafuente (stronk7), Iñaki Arenaza, Jose Rama, Martin Dougiamas, Nicolas Connault, Oswald Zangerle, Petr Skoda, Red Morris, Ryan Smith and Tim Hunt
Security Level: None
QA Assignee: Petr Skoda
Resolved date: 21/Oct/07
Affected Branches: MOODLE_18_STABLE, MOODLE_19_STABLE
Fixed Branches: MOODLE_18_STABLE, MOODLE_19_STABLE, MOODLE_20_STABLE


 Description  « Hide
Currently (all Moodle versions) under the moodledata/users directory, one dir with the userid is created to store, basically, the avatar of the user. This system has two big drawbacks:

1) BIG sites are beginning to raise the "Max files per dir" OS limit. And usually, this is one hard limit.
2) The structure under each userid directory is pretty plain and we should start to accommodate it for future personal storage.

So, I would propose to:

1) Create one simple algorithm that, based in one number (userid), will return one unique hash of fixed length.
2) Create one function - create_user_dir($userid) - in order to create the user storage area. Such storage area should be created by creating nested subdirs with parts of the hash calculated in step 1 (nor raising, say, 12 bits, per name = 4096 dirs per dir). This function could have one optional parameter ($migrate = false), to allow migration from old user storage areas to the new ones transparently.
3) Create one function - get_user_dir($userid) - in order to get the path to the user storage area. This function should check for the new areas + the current ones in order to keep compatibility.
4) Inside each user storage area, create one "private" dir, where we'll move the avatars. Such "private" dir is intended to store files that are handled by Moodle but without FileManager access for students in the future.
5) Change all current uses of user storage area to use the functions defined above.
6) Document it to allow developers to know how they must handle files in that zone.

Sounds simple. Ciao :-)

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Eloy Lafuente (stronk7) made changes - 22/Feb/07 02:18 AM
Field Original Value New Value
Fix Version/s 1.8 [ 10130 ]
Affects Version/s 1.7.1 [ 10151 ]
Affects Version/s 1.9 [ 10190 ]
Eloy Lafuente (stronk7) made changes - 22/Feb/07 08:33 AM
Attachment hash.php [ 10810 ]
Iñaki Arenaza made changes - 07/Oct/07 07:15 AM
Attachment newhash.php [ 12010 ]
Martin Dougiamas made changes - 11/Oct/07 12:21 PM
Link This issue will help resolve MDLSITE-180 [ MDLSITE-180 ]
Martin Dougiamas made changes - 11/Oct/07 12:42 PM
Priority Major [ 3 ] Blocker [ 1 ]
Fix Version/s 2.0 [ 10122 ]
Assignee Martin Dougiamas [ dougiamas ] Nicolas Connault [ nicolasconnault ]
Fix Version/s 1.8.3 [ 10230 ]
Martin Dougiamas made changes - 11/Oct/07 02:41 PM
Fix Version/s 1.8.3 [ 10230 ]
Fix Version/s 1.8.4 [ 10242 ]
Nicolas Connault made changes - 11/Oct/07 10:02 PM
Resolution Fixed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]
Fix Version/s 1.9 [ 10190 ]
Fix Version/s 1.9.2 [ 10241 ]
Martin Dougiamas made changes - 12/Oct/07 03:40 PM
Status Resolved [ 5 ] Reopened [ 4 ]
Resolution Fixed [ 1 ]
Andrea Bicciolo made changes - 14/Oct/07 05:11 AM
QA Assignee nicolasconnault
Eloy Lafuente (stronk7) made changes - 14/Oct/07 05:35 AM
Link This issue will be resolved by MDL-10905 [ MDL-10905 ]
Nicolas Connault made changes - 15/Oct/07 01:57 PM
Resolution Fixed [ 1 ]
Status Reopened [ 4 ] Resolved [ 5 ]
Martin Dougiamas made changes - 16/Oct/07 12:23 AM
Link This issue will help resolve MDL-11776 [ MDL-11776 ]
Petr Skoda made changes - 21/Oct/07 04:56 AM
Resolution Fixed [ 1 ]
Status Resolved [ 5 ] Reopened [ 4 ]
Petr Skoda made changes - 21/Oct/07 05:05 AM
Status Reopened [ 4 ] Resolved [ 5 ]
Fix Version/s 1.9.2 [ 10241 ]
Fix Version/s 1.9 [ 10190 ]
Resolution Fixed [ 1 ]
Martin Dougiamas made changes - 04/Mar/08 10:29 AM
Link This issue has been marked as being related by MDL-13763 [ MDL-13763 ]
Dan Marsden made changes - 25/Apr/08 07:45 AM
Link This issue has been marked as being related by MDL-14550 [ MDL-14550 ]
Petr Skoda made changes - 30/Apr/08 02:58 AM
Status Resolved [ 5 ] Closed [ 6 ]
Petr Skoda made changes - 30/Apr/08 02:58 AM
QA Assignee nicolasconnault skodak