Can update group settings

This commit is contained in:
Pierre HUBERT 2018-07-15 19:12:59 +02:00
parent 91943a49ab
commit 39645de9ff
2 changed files with 18 additions and 2 deletions

View File

@ -151,6 +151,16 @@ class GroupsController {
$settings = new GroupSettings(); $settings = new GroupSettings();
$settings->set_id($groupID); $settings->set_id($groupID);
$settings->set_name(postString("name", 3)); $settings->set_name(postString("name", 3));
$settings->set_description(removeHTMLnodes(postString("description", 0)));
//Get group URL
$url = postString("url", 0);
if($url != ""){
if(!filter_var($url, FILTER_VALIDATE_URL))
Rest_fatal_error(401, "Invalid group URL!");
$settings->set_url($url);
}
//Get group visibility //Get group visibility
$visiblity = postString("visibility", 3); $visiblity = postString("visibility", 3);

View File

@ -666,8 +666,14 @@ class GroupsComponent {
if($settings->has_registration_level()) if($settings->has_registration_level())
$data["registration_level"] = $settings->get_registration_level(); $data["registration_level"] = $settings->get_registration_level();
if($settings->has_virtual_directory()) $data["virtual_directory"] =
$data["virtual_directory"] = $settings->get_virtual_directory(); $settings->has_virtual_directory() ? $settings->get_virtual_directory() : "";
$data["description"] =
$settings->has_description() ? $settings->get_description() : "";
$data["url"] =
$settings->has_url() ? $settings->get_url() : "";
return $data; return $data;
} }