"User list", "version" => "0.1.1", "author" => "Starbeamrainbowlabs", "description" => "Adds a 'user-list' action that generates a list of users. Supports json output with 'format=json' in the queyr string.", "id" => "page-user-list", "code" => function() { global $settings; /** * @api {get} ?action=user-list[&format=json] List all users * @apiName UserList * @apiGroup Utility * @apiPermission Anonymous */ /* * ██ ██ ███████ ███████ ██████ ██ ██ ███████ ████████ * ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ * ██ ██ ███████ █████ ██████ █████ ██ ██ ███████ ██ * ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ * ██████ ███████ ███████ ██ ██ ███████ ██ ███████ ██ */ add_action("user-list", function() { global $env, $settings; $userList = array_keys(get_object_vars($settings->users)); if(!empty($_GET["format"]) && $_GET["format"] === "json") { header("content-type: application/json"); exit(json_encode($userList)); } $content = "
$settings->sitename has a page that lists all the users on the site. You can access it here: user list.
"); } ]); ?>