diff --git a/user/edit.html b/user/edit.html index 5357ae49add..4c7ca64d922 100644 --- a/user/edit.html +++ b/user/edit.html @@ -275,7 +275,7 @@ if (isadmin()) { maxbytes, $course->maxbytes); - if (!empty($CFG->gdversion) and $maxbytes and empty($CFG->disableuserimages)) { + if (!empty($CFG->gdversion) and $maxbytes and (empty($CFG->disableuserimages) or isadmin())) { ?> : diff --git a/user/edit.php b/user/edit.php index a02c55f88e4..0b3656e5aea 100644 --- a/user/edit.php +++ b/user/edit.php @@ -138,6 +138,9 @@ $usernew->username = moodle_strtolower($usernew->username); } + if (!empty($_FILES) and !(empty($CFG->disableuserimages) or isadmin())) { + error('Users can not update profile images!'); + } require_once($CFG->dirroot.'/lib/uploadlib.php'); $um = new upload_manager('imagefile',false,false,null,false,0,true,true);