summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/ajax/userautocomplete.php
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2011-09-23 22:22:59 +0200
committerBart Visscher <bartv@thisnet.nl>2011-09-25 22:19:28 +0200
commit17e631bc5e327514596ce8761fe7f93d414a8717 (patch)
treea2e6bed923a493988028adafaaebcab5b9bfbd39 /apps/files_sharing/ajax/userautocomplete.php
parentdbddec9160338818009ec7020cec5a2b298aae7e (diff)
downloadnextcloud-server-17e631bc5e327514596ce8761fe7f93d414a8717.tar.gz
nextcloud-server-17e631bc5e327514596ce8761fe7f93d414a8717.zip
Use OC_JSON for json responses
Create OC_JSON class, for single point of creating json responses. No real logic change, this just cleans up the code a bit.
Diffstat (limited to 'apps/files_sharing/ajax/userautocomplete.php')
-rw-r--r--apps/files_sharing/ajax/userautocomplete.php8
1 files changed, 3 insertions, 5 deletions
diff --git a/apps/files_sharing/ajax/userautocomplete.php b/apps/files_sharing/ajax/userautocomplete.php
index 6da7afb659c..a3158cf72d6 100644
--- a/apps/files_sharing/ajax/userautocomplete.php
+++ b/apps/files_sharing/ajax/userautocomplete.php
@@ -3,10 +3,8 @@ $RUNTIME_NOAPPS = true;
require_once('../../../lib/base.php');
-if (!OC_User::isLoggedIn()) {
- echo json_encode(array("status" => "error", "data" => array("message" => "Authentication error")));
- exit();
-}
+OC_JSON::checkLoggedIn();
+
$users = array();
$ocusers = OC_User::getUsers();
$self = OC_User::getUser();
@@ -23,6 +21,6 @@ foreach ($groups as $group) {
$users[] = "<option value='".$group."'>".$group."</option>";
}
$users[] = "</optgroup>";
-echo json_encode($users);
+OC_JSON::encodedPrint($users);
?>