Can delete user account image

This commit is contained in:
Pierre 2018-05-01 10:59:55 +02:00
parent 471ae35dd4
commit caad9550b2

View File

@ -238,6 +238,25 @@ class SettingsController {
return array("success" => "The new account image has been successfully saved!");
}
/**
* Delete current user account image
*
* @url POST /settings/delete_account_image
*/
public function delete_account_image(){
//Login required
user_login_required();
//Try to delete user account image
if(!components()->accountImage->delete(userID)){
Rest_fatal_error(500, "Could not delete user account image!");
}
//Success
return array("success" => "The account image has been deleted!");
}
/**
* Turn a GeneralSettings object into a valid API object
*