private function handle_post($data) { $profile = GroupBackend::fetch_group_profile($this->params["id"]); $displayname = $profile->getDisplayName(); $name = $profile->getName(); if (isset($data->{"display-name"})) { $displayname = $data->{"display-name"}; } if (isset($data->{"group-name"})) { $name = $data->{"group-name"}; } $profile = new GroupProfile($profile->getGroupId(), $name, $displayname); GroupBackend::update_group_profile($profile); return $this->handle_get($data); }
public static function check_group_permission(GroupProfile $profile, $permission) { $query = Database::generate_query("group_permission_check", [$profile->getGroupId()->toString(), $permission]); $result = $query->execute(); $count = $result->count(); $result->close(); return $count >= 1; }
public static function add_user_group(UserProfile $user, GroupProfile $group) { $query = Database::generate_query("user_groups_add", [$user->getUserId()->toString(), $group->getGroupId()->toString()]); $query->execute(); }