summaryrefslogtreecommitdiffstats
path: root/files/ajax/move.php
diff options
context:
space:
mode:
Diffstat (limited to 'files/ajax/move.php')
-rw-r--r--files/ajax/move.php15
1 files changed, 4 insertions, 11 deletions
diff --git a/files/ajax/move.php b/files/ajax/move.php
index 4224cbce6d0..8a56a015486 100644
--- a/files/ajax/move.php
+++ b/files/ajax/move.php
@@ -3,14 +3,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
$dir = $_GET["dir"];
@@ -19,9 +12,9 @@ $target = $_GET["target"];
if(OC_Files::move($dir,$file,$target,$file)){
- echo json_encode( array( "status" => 'success', "data" => array( "dir" => $dir, "files" => $file )));
+ OC_JSON::success(array("data" => array( "dir" => $dir, "files" => $file )));
}else{
- echo json_encode( array( "status" => 'error', "data" => array( "message" => "Could move $file" )));
+ OC_JSON::error(array("data" => array( "message" => "Could move $file" )));
}
-?> \ No newline at end of file
+?>