src/snac/client/webui/WebUIExecutor.php
/**
     * Save Group Information
     *
     * Asks the server to update a group's information.
     *
     * @param string[] $input Post/Get inputs from the webui
     * @return string[] The web ui's response to the client (array ready for json_encode)
     */
Save Group Information
Asks the server to update a group's information.

@param string[] $input Post/Get inputs from the webui
@return string[] The web ui's response to the client (array ready for json_encode)
Save Group Information Asks the server to update a group ' s information . @param string [] $input Post / Get inputs from the webui @return string [] The web ui ' s response to the client ( array ready for json_encode )
public function saveGroup(&$input) {
        $group = new \snac\data\Group();
        if (isset($input["groupid"]) && $input["groupid"] != "")
            $group->setID($input["groupid"]);
        $group->setLabel($input["groupName"]);
        $group->setDescription($input["groupDescription"]);
        $users = array();
        foreach ($input as $key => $value) {
            if (strstr($key, "userid_")) {
                $userAdd = new \snac\data\User();
                $userAdd->setUserID($value);
                array_push($users, $userAdd->toArray());
            }
        }
        $this->logger->addDebug("Updated the Group Object", $group->toArray());
        $request = array("command"=>"update_group");
        $request["group_update"] = $group->toArray();
        $request["users_update"] = $users;
        $serverResponse = $this->connect->query($request);
        $response = array();
        $response["server_debug"] = $serverResponse;
        if (!is_array($serverResponse)) {
            $this->logger->addDebug("server's response: $serverResponse");
        } else {
            if (isset($serverResponse["result"]))
                $response["result"] = $serverResponse["result"];
            if (isset($serverResponse["error"])) {
                $response["error"] = $serverResponse["error"];
            }
            if (isset($serverResponse["group_update"])) {
                $response["group_update"] = $serverResponse["group_update"];
            }
        }
        return $response;
    }
public function saveGroup ( & $ input ) { $ group = new \ snac \ data \ Group ( ) ; if ( isset ( $ input [ " groupid " ] ) && $ input [ " groupid " ] != " " ) $ group -> setID ( $ input [ " groupid " ] ) ; $ group -> setLabel ( $ input [ " groupName " ] ) ; $ group -> setDescription ( $ input [ " groupDescription " ] ) ; $ users = array ( ) ; foreach ( $ input as $ key => $ value ) { if ( strstr ( $ key , " userid_ " ) ) { $ userAdd = new \ snac \ data \ User ( ) ; $ userAdd -> setUserID ( $ value ) ; array_push ( $ users , $ userAdd -> toArray ( ) ) ; } } $ this -> logger -> addDebug ( " Updated the Group Object " , $ group -> toArray ( ) ) ; $ request = array ( " command " => " update_group " ) ; $ request [ " group_update " ] = $ group -> toArray ( ) ; $ request [ " users_update " ] = $ users ; $ serverResponse = $ this -> connect -> query ( $ request ) ; $ response = array ( ) ; $ response [ " server_debug " ] = $ serverResponse ; if ( ! is_array ( $ serverResponse ) ) { $ this -> logger -> addDebug ( " server's response:  $ serverResponse " ) ; } else { if ( isset ( $ serverResponse [ " result " ] ) ) $ response [ " result " ] = $ serverResponse [ " result " ] ; if ( isset ( $ serverResponse [ " error " ] ) ) { $ response [ " error " ] = $ serverResponse [ " error " ] ; } if ( isset ( $ serverResponse [ " group_update " ] ) ) { $ response [ " group_update " ] = $ serverResponse [ " group_update " ] ; } } return $ response ; }
Save Group Information
 Asks the server to update a group's information.
Save Group Information Asks the server to update a group ' s information .
// Create a list of shadow user objects to put in this group // Build a data structure to send to the server // Send the query to the server