From 1ce641d1d1983595fb15f29ddcd3f7f4c076a1f3 Mon Sep 17 00:00:00 2001 From: Mark Schouten Date: Thu, 10 Jul 2014 16:17:11 +0200 Subject: [PATCH] Allow users to be returned as a Optionslist --- users.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/users.php b/users.php index 80a9e82..fef9d92 100644 --- a/users.php +++ b/users.php @@ -21,6 +21,15 @@ if (isset($_GET['action'])) { if ($action == "list") { $users = get_all_users(); jtable_respond($users); +} elseif ($action == "listoptions") { + $users = get_all_users(); + $retusers = []; + foreach ($users as $user) { + $retusers[] = array ( + 'DisplayText' => $user['emailaddress'], + 'Value' => $user['emailaddress']); + } + jtable_respond($retusers, 'options'); } elseif ($action == "create" or $action == "update") { if (valid_user($_POST['emailaddress']) === FALSE) { jtable_respond(null, 'error', "Please only use ^[a-z0-9@_.-]+$ for usernames");