Can update posts creation level of a group

This commit is contained in:
Pierre HUBERT 2018-07-16 08:52:41 +02:00
parent 18c5f2e64c
commit fd1b08b74c
2 changed files with 10 additions and 0 deletions

View File

@ -184,6 +184,13 @@ class GroupsController {
Reset_fatal_error(400, "Unrecognized group registration level!");
$settings->set_registration_level($levels[$registration_level]);
//Get group posts creation levels
$postsLevel = postString("posts_level", 3);
$levels = array_flip(self::GROUPS_POSTS_LEVELS);
if(!isset($levels[$postsLevel]))
Rest_fatal_error(400, "Unrecognized group posts level!");
$settings->set_posts_level($levels[$postsLevel]);
//Get and check group virtual directory
$virtualDirectory = postString("virtual_directory", 0);
if($virtualDirectory != ""){

View File

@ -667,6 +667,9 @@ class GroupsComponent {
if($settings->has_registration_level())
$data["registration_level"] = $settings->get_registration_level();
if($settings->has_posts_level())
$data["posts_level"] = $settings->get_posts_level();
$data["virtual_directory"] =
$settings->has_virtual_directory() ? $settings->get_virtual_directory() : "";