src/snac/server/ServerExecutor.php
/**
     * List Users
     *
     * Calls through to DBUser to ask for the list of users
     *
     * @param  string[] $input Input array from the client
     * @return string[]        Response to send to the client including the list of Users
     */
List Users
Calls through to DBUser to ask for the list of users

@param  string[] $input Input array from the client
@return string[]        Response to send to the client including the list of Users
List Users Calls through to DBUser to ask for the list of users @param string [] $input Input array from the client @return string [] Response to send to the client including the list of Users
public function listUsers(&$input) {
        $getAll = true;
        if (isset($input["filter"])) {
            if ($input["filter"] == "active")
                $getAll = false;
        }
        $allUsers = $this->uStore->listUsers($getAll);
        $response = array();
        if (count($allUsers) > 0) {
            $response["users"] = array();
            foreach ($allUsers as $user) {
                array_push($response["users"], $user->toArray());
            }
            usort($response["users"], function($a, $b) {
                if (!isset($a["fullName"]) && isset($b["fullName"]))
                    return 1;
                else if (isset($a["fullName"]) && !isset($b["fullName"]))
                    return -1;
                else if (!isset($a["fullName"]) && !isset($b["fullName"]))
                    return 0;
                return $a["fullName"] <=> $b["fullName"];
            });
            $response["result"] = "success";
        } else {
            $response["result"] = "failure";
        }
        return $response;
    }
public function listUsers ( & $ input ) { $ getAll = true ; if ( isset ( $ input [ " filter " ] ) ) { if ( $ input [ " filter " ] == " active " ) $ getAll = false ; } $ allUsers = $ this -> uStore -> listUsers ( $ getAll ) ; $ response = array ( ) ; if ( count ( $ allUsers ) > 0 ) { $ response [ " users " ] = array ( ) ; foreach ( $ allUsers as $ user ) { array_push ( $ response [ " users " ] , $ user -> toArray ( ) ) ; } usort ( $ response [ " users " ] , function ( $ a , $ b ) { if ( ! isset ( $ a [ " fullName " ] ) && isset ( $ b [ " fullName " ] ) ) return 1 ; else if ( isset ( $ a [ " fullName " ] ) && ! isset ( $ b [ " fullName " ] ) ) return - 1 ; else if ( ! isset ( $ a [ " fullName " ] ) && ! isset ( $ b [ " fullName " ] ) ) return 0 ; return $ a [ " fullName " ] <=> $ b [ " fullName " ] ; } ) ; $ response [ " result " ] = " success " ; } else { $ response [ " result " ] = " failure " ; } return $ response ; }
List Users
 Calls through to DBUser to ask for the list of users
List Users Calls through to DBUser to ask for the list of users
// default sort by name