|
|
|
File Attachments:
|
1.
hash.php (0.8 kB)
2.
newhash.php (0.8 kB)
|
|
Issue Links:
|
Dependency
|
|
This issue will help resolve:
|
|
MDL-11776
user profile pictures no longer display
|
|
|
|
|
MDLSITE-180
Cannot upload image to 'picture of' in 'edit profile'
|
|
|
|
|
|
This issue will be resolved by:
|
|
MDL-10905
Backup misses files if a directory name evaluates to false (eg. "0")
|
|
|
|
|
Relates
|
|
|
|
This issue has been marked as being related by:
|
|
MDL-14550
backup\backuplib.php user_files_check_backup() is invalid
|
|
|
|
|
MDL-13763
1.9 user pictures loading from old location
|
|
|
|
|
|
|
| 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
|
|
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 :-)
|
|
Description
|
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 :-) |
Show » |
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
]
|
made changes - 22/Feb/07 08:33 AM
|
Attachment
|
|
hash.php
[ 10810
]
|
made changes - 07/Oct/07 07:15 AM
|
Attachment
|
|
newhash.php
[ 12010
]
|
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
]
|
made changes - 11/Oct/07 02:41 PM
|
Fix Version/s
|
1.8.3
[ 10230
]
|
|
|
Fix Version/s
|
|
1.8.4
[ 10242
]
|
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
]
|
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
|
made changes - 14/Oct/07 05:35 AM
|
Link
|
|
This issue will be resolved by MDL-10905
[ MDL-10905
]
|
made changes - 15/Oct/07 01:57 PM
|
Resolution
|
|
Fixed
[ 1
]
|
|
Status
|
Reopened
[ 4
]
|
Resolved
[ 5
]
|
made changes - 16/Oct/07 12:23 AM
|
Link
|
|
This issue will help resolve MDL-11776
[ MDL-11776
]
|
made changes - 21/Oct/07 04:56 AM
|
Resolution
|
Fixed
[ 1
]
|
|
|
Status
|
Resolved
[ 5
]
|
Reopened
[ 4
]
|
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
]
|
made changes - 04/Mar/08 10:29 AM
|
Link
|
|
This issue has been marked as being related by MDL-13763
[ MDL-13763
]
|
made changes - 25/Apr/08 07:45 AM
|
Link
|
|
This issue has been marked as being related by MDL-14550
[ MDL-14550
]
|
made changes - 30/Apr/08 02:58 AM
|
Status
|
Resolved
[ 5
]
|
Closed
[ 6
]
|
made changes - 30/Apr/08 02:58 AM
|
QA Assignee
|
nicolasconnault
|
skodak
|
|