MDL-8319 avatar image is now deleted from disk, user/pix.php redirects to default picture if user picture not present(===deleted)
This commit is contained in:
+4
-1
@@ -20,8 +20,11 @@ function useredit_update_user_preference($usernew) {
|
||||
}
|
||||
|
||||
function useredit_update_picture(&$usernew, &$userform) {
|
||||
global $CFG;
|
||||
|
||||
if (isset($usernew->deletepicture) and $usernew->deletepicture) {
|
||||
//TODO - delete the file
|
||||
$location = $CFG->dataroot.'/users/'.$usernew->id;
|
||||
@remove_dir($location);
|
||||
set_field('user', 'picture', 0, 'id', $usernew->id);
|
||||
} else if ($usernew->picture = save_profile_image($usernew->id, $userform->get_um(), 'users')) {
|
||||
set_field('user', 'picture', 1, 'id', $usernew->id);
|
||||
|
||||
Reference in New Issue
Block a user