mirror of
https://github.com/pierre42100/ComunicAPI
synced 2024-11-23 13:59:29 +00:00
Can delete a group logo
This commit is contained in:
parent
1b9d9a2f3e
commit
feeebcbae3
@ -171,6 +171,27 @@ class GroupsController {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a group logo
|
||||
*
|
||||
* @url POST /groups/delete_logo
|
||||
*/
|
||||
public function deleteLogo(){
|
||||
|
||||
//Get the ID of the group (with admin access)
|
||||
$groupID = $this->getPostGroupIDWithAdmin("id");
|
||||
|
||||
//Try to delete group logo
|
||||
if(!components()->groups->deleteLogo($groupID))
|
||||
Rest_fatal_error(500, "An error occurred while trying to delete group logo!");
|
||||
|
||||
//Success
|
||||
return array(
|
||||
"success" => "The group logo has been successfully deleted!",
|
||||
"url" => components()->groups->get_settings($groupID)->get_logo_url()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get and return a group ID specified in the POST request
|
||||
* in which the current user has admin rigths
|
||||
|
@ -249,7 +249,7 @@ class GroupsComponent {
|
||||
return FALSE;
|
||||
|
||||
//Save new information
|
||||
$settings->set_logo("");
|
||||
$settings->set_logo("null");
|
||||
return $this->set_settings($settings);
|
||||
}
|
||||
|
||||
@ -274,7 +274,7 @@ class GroupsComponent {
|
||||
$info->set_number_members($this->countMembers($info->get_id()));
|
||||
$info->set_membership_level($this->getMembershipLevel(userID, $info->get_id()));
|
||||
|
||||
if($data["path_logo"] != null && $data["path_logo"] != "")
|
||||
if($data["path_logo"] != null && $data["path_logo"] != "" && $data["path_logo"] != "null")
|
||||
$info->set_logo($data["path_logo"]);
|
||||
|
||||
return $info;
|
||||
|
Loading…
Reference in New Issue
Block a user