"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 = "

User List

\n"; $content .= "\n"; exit(page_renderer::render_main("User List - $settings->sitename", $content)); }); add_help_section("18-user-list", "User list", "

$settings->sitename has a page that lists all the users on the site. You can access it here: user list.

"); } ]); ?>