diff options
author | Robin <robin@Amaya.(none)> | 2010-05-10 16:55:30 +0200 |
---|---|---|
committer | Robin <robin@Amaya.(none)> | 2010-05-10 16:55:30 +0200 |
commit | 672297531bbd0b161ba393f8eba0ada84310f2ce (patch) | |
tree | 8ecf915a2e09c80bed5691da4909112bb14fde7d /files | |
parent | 898d2489bba0a5e7dd349bed19f9c10a7eb05065 (diff) | |
parent | e0347b7fa6d92d606f88aee5c60ad89f3c45ef84 (diff) | |
download | nextcloud-server-672297531bbd0b161ba393f8eba0ada84310f2ce.tar.gz nextcloud-server-672297531bbd0b161ba393f8eba0ada84310f2ce.zip |
merge
Diffstat (limited to 'files')
-rwxr-xr-x | files/api.php | 52 |
1 files changed, 36 insertions, 16 deletions
diff --git a/files/api.php b/files/api.php index b27228d9676..12bc49dd7f0 100755 --- a/files/api.php +++ b/files/api.php @@ -30,23 +30,43 @@ if(!isset($_POST['action']) and isset($_GET['action'])){ foreach($arguments as &$argument){ $argument=stripslashes($argument); } +global $CONFIG_DATADIRECTORY; ob_clean(); -switch($arguments['action']){ - case 'delete': - OC_FILES::delete($arguments['dir'],$arguments['file']); - break; - case 'rename': - OC_FILES::move($arguments['dir'],$arguments['file'],$arguments['dir'],$arguments['newname']); - break; - case 'new': - OC_FILES::newfile($arguments['dir'],$arguments['name'],$arguments['type']); - break; - case 'move': - OC_FILES::move($arguments['sourcedir'],$arguments['source'],$arguments['targetdir'],$arguments['target']); - break; - case 'get': - OC_FILES::get($arguments['dir'],$arguments['file']); - break; +if($arguments['action']){ + switch($arguments['action']){ + case 'delete': + OC_FILES::delete($arguments['dir'],$arguments['file']); + break; + case 'rename': + OC_FILES::move($arguments['dir'],$arguments['file'],$arguments['dir'],$arguments['newname']); + break; + case 'new': + OC_FILES::newfile($arguments['dir'],$arguments['name'],$arguments['type']); + break; + case 'move': + OC_FILES::move($arguments['sourcedir'],$arguments['source'],$arguments['targetdir'],$arguments['target']); + break; + case 'get': + OC_FILES::get($arguments['dir'],$arguments['file']); + break; + case 'getfiles': + echo json_encode(OC_FILES::getdirectorycontent($CONFIG_DATADIRECTORY.'/'.$arguments['dir'])); + break; + case 'login': + if(OC_USER::login($arguments['username'],$arguments['password'])){ + echo 'true'; + }else{ + echo 'false'; + } + break; + case 'checklogin': + if(OC_USER::isLoggedIn()){ + echo 'true'; + }else{ + echo 'false'; + } + break; + } } ?>
\ No newline at end of file |