Auth\Controller\Accounts::deleteGroup PHP Method

deleteGroup() public method

public deleteGroup ( )
    public function deleteGroup()
    {
        if ($this->user["group"] != "admin") {
            return false;
        }
        if ($name = $this->app->param("name", false)) {
            if ($name != "admin") {
                $groups = $this->app->db->getKey("cockpit/settings", "cockpit.acl.groups", []);
                if (isset($groups[$name])) {
                    unset($groups[$name]);
                    $this->app->db->update("cockpit/accounts", ["group" => ""], ["group" => $name]);
                    $this->app->db->setKey("cockpit/settings", "cockpit.acl.groups", $groups);
                }
            }
        }
        $acl = $this->getAcl();
        return json_encode($acl);
    }