mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 00:16:46 +02:00
Small bugfix with uploading new user images
This commit is contained in:
parent
f74dcc5e08
commit
b913b369e8
2 changed files with 3 additions and 3 deletions
|
@ -49,7 +49,7 @@
|
|||
$usernew->firstname = strip_tags($usernew->firstname);
|
||||
$usernew->lastname = strip_tags($usernew->lastname);
|
||||
|
||||
if (find_form_errors($user, $usernew, $err) ) {
|
||||
if (find_form_errors($user, $usernew, $err)) {
|
||||
if ($filename = valid_uploaded_file($imagefile)) {
|
||||
$usernew->picture = save_user_image($user->id, $filename);
|
||||
}
|
||||
|
|
|
@ -88,8 +88,8 @@ function save_user_image($userid, $filename) {
|
|||
$badpermissions = true;
|
||||
}
|
||||
}
|
||||
if (!file_exists("$CFG->dataroot/users/$user->id")) {
|
||||
if (! mkdir("$CFG->dataroot/users/$user->id", 0777)) {
|
||||
if (!file_exists("$CFG->dataroot/users/$userid")) {
|
||||
if (! mkdir("$CFG->dataroot/users/$userid", 0777)) {
|
||||
$badpermissions = true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue