mirror of
https://github.com/pierre42100/ComunicAPI
synced 2024-11-27 15:59:29 +00:00
Can change group visibility.
This commit is contained in:
parent
44181ee5c7
commit
e8d8fffbd1
@ -138,6 +138,13 @@ class GroupsController {
|
|||||||
$settings->set_id($groupID);
|
$settings->set_id($groupID);
|
||||||
$settings->set_name(postString("name", 3));
|
$settings->set_name(postString("name", 3));
|
||||||
|
|
||||||
|
//Get group visibility
|
||||||
|
$visiblity = postString("visibility", 3);
|
||||||
|
$levels = array_flip(self::GROUPS_VISIBILITY_LEVELS);
|
||||||
|
if(!isset($levels[$visiblity]))
|
||||||
|
Rest_fatal_error(400, "Unrecognized group visibility level!");
|
||||||
|
$settings->set_visibility($levels[$visiblity]);
|
||||||
|
|
||||||
//Try to save the new settings of the group
|
//Try to save the new settings of the group
|
||||||
if(!components()->groups->set_settings($settings))
|
if(!components()->groups->set_settings($settings))
|
||||||
Rest_fatal_error(500, "An error occured while trying to update group settings!");
|
Rest_fatal_error(500, "An error occured while trying to update group settings!");
|
||||||
|
@ -336,6 +336,9 @@ class GroupsComponent {
|
|||||||
if($settings->has_logo())
|
if($settings->has_logo())
|
||||||
$data["path_logo"] = $settings->get_logo();
|
$data["path_logo"] = $settings->get_logo();
|
||||||
|
|
||||||
|
if($settings->has_visibility())
|
||||||
|
$data["visibility"] = $settings->get_visibility();
|
||||||
|
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@ class GroupInfo extends BaseUniqueObject {
|
|||||||
private $number_members = -1;
|
private $number_members = -1;
|
||||||
private $logo;
|
private $logo;
|
||||||
private $membership_level = -1;
|
private $membership_level = -1;
|
||||||
private $visiblity;
|
private $visiblity = -1;
|
||||||
|
|
||||||
|
|
||||||
//Get and set the name of group
|
//Get and set the name of group
|
||||||
|
Loading…
Reference in New Issue
Block a user