mirror of
https://github.com/pierre42100/ComunicAPI
synced 2024-12-25 21:18:57 +00:00
Can update registration level
This commit is contained in:
parent
f726b4cc2b
commit
a1d078a461
@ -155,6 +155,13 @@ class GroupsController {
|
||||
Rest_fatal_error(400, "Unrecognized group visibility level!");
|
||||
$settings->set_visibility($levels[$visiblity]);
|
||||
|
||||
//Get group registration level
|
||||
$registration_level = postString("registration_level", 3);
|
||||
$levels = array_flip(self::GROUPS_REGISTRATION_LEVELS);
|
||||
if(!isset($levels[$registration_level]))
|
||||
Reset_fatal_error(400, "Unrecognized group registration level!");
|
||||
$settings->set_registration_level($levels[$registration_level]);
|
||||
|
||||
//Try to save the new settings of the group
|
||||
if(!components()->groups->set_settings($settings))
|
||||
Rest_fatal_error(500, "An error occured while trying to update group settings!");
|
||||
|
@ -430,6 +430,9 @@ class GroupsComponent {
|
||||
|
||||
if($settings->has_visibility())
|
||||
$data["visibility"] = $settings->get_visibility();
|
||||
|
||||
if($settings->has_registration_level())
|
||||
$data["registration_level"] = $settings->get_registration_level();
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user