mirror of
https://github.com/pierre42100/ComunicAPI
synced 2024-11-27 15:59:29 +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!");
|
Rest_fatal_error(400, "Unrecognized group visibility level!");
|
||||||
$settings->set_visibility($levels[$visiblity]);
|
$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
|
//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!");
|
||||||
|
@ -431,6 +431,9 @@ class GroupsComponent {
|
|||||||
if($settings->has_visibility())
|
if($settings->has_visibility())
|
||||||
$data["visibility"] = $settings->get_visibility();
|
$data["visibility"] = $settings->get_visibility();
|
||||||
|
|
||||||
|
if($settings->has_registration_level())
|
||||||
|
$data["registration_level"] = $settings->get_registration_level();
|
||||||
|
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user