summaryrefslogtreecommitdiffstats
path: root/files/ajax/autocomplete.php
diff options
context:
space:
mode:
Diffstat (limited to 'files/ajax/autocomplete.php')
-rw-r--r--files/ajax/autocomplete.php11
1 files changed, 2 insertions, 9 deletions
diff --git a/files/ajax/autocomplete.php b/files/ajax/autocomplete.php
index 183ee86c788..8d7a5b482bd 100644
--- a/files/ajax/autocomplete.php
+++ b/files/ajax/autocomplete.php
@@ -5,14 +5,7 @@
// Init owncloud
require_once('../../lib/base.php');
-// We send json data
-// header( "Content-Type: application/jsonrequest" );
-
-// Check if we are a user
-if( !OC_User::isLoggedIn()){
- echo json_encode( array( "status" => "error", "data" => array( "message" => "Authentication error" )));
- exit();
-}
+OC_JSON::checkLoggedIn();
// Get data
$query = $_GET['term'];
@@ -58,6 +51,6 @@ if(OC_Filesystem::file_exists($base) and OC_Filesystem::is_dir($base)){
}
}
}
-echo json_encode($files);
+OC_JSON::encodedPrint($files);
?>