summaryrefslogtreecommitdiffstats
path: root/files/ajax
diff options
context:
space:
mode:
authorRobin Appelman <icewind1991@gmail.com>2011-07-22 06:21:53 +0200
committerRobin Appelman <icewind1991@gmail.com>2011-07-22 06:21:53 +0200
commit4ff2dc30354d923115d2ad4324fd4b5ed87a8028 (patch)
tree3d070f5cc8d894a5b269068e7acc78a2a63f8a08 /files/ajax
parent8eefd42a7dc537ebf28e2a3827e01c42b266dcd1 (diff)
downloadnextcloud-server-4ff2dc30354d923115d2ad4324fd4b5ed87a8028.tar.gz
nextcloud-server-4ff2dc30354d923115d2ad4324fd4b5ed87a8028.zip
finally the missing file for moving files from the web interface
Diffstat (limited to 'files/ajax')
-rw-r--r--files/ajax/move.php27
1 files changed, 27 insertions, 0 deletions
diff --git a/files/ajax/move.php b/files/ajax/move.php
new file mode 100644
index 00000000000..b1ba641c5b1
--- /dev/null
+++ b/files/ajax/move.php
@@ -0,0 +1,27 @@
+<?php
+
+// 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();
+}
+
+// Get data
+$dir = $_GET["dir"];
+$file = $_GET["file"];
+$target = $_GET["target"];
+
+
+if(OC_FILES::move($dir,$file,$target,$file)){
+ echo json_encode( array( "status" => 'success', "data" => array( "dir" => $dir, "files" => $file )));
+}else{
+ echo json_encode( array( "status" => 'error', "data" => array( "message" => "Could move $file" )));
+}
+
+?> \ No newline at end of file