summaryrefslogtreecommitdiffstats
path: root/lib/ocs
diff options
context:
space:
mode:
authorTom Needham <needham.thomas@gmail.com>2012-12-12 18:06:07 +0000
committerTom Needham <needham.thomas@gmail.com>2012-12-12 18:06:07 +0000
commit3cc34055368114d81e722adea03a2118e78d2aac (patch)
tree67c491904a4af641c9b89238cae76e3803a2bccd /lib/ocs
parent2a4b554ca67ba55c75bbff75777285e550dca84f (diff)
downloadnextcloud-server-3cc34055368114d81e722adea03a2118e78d2aac.tar.gz
nextcloud-server-3cc34055368114d81e722adea03a2118e78d2aac.zip
API: Remove old code. Move remaining methods to OC_OCS_Result.
Diffstat (limited to 'lib/ocs')
-rw-r--r--lib/ocs/cloud.php32
-rw-r--r--lib/ocs/config.php1
-rw-r--r--lib/ocs/privatedata.php6
3 files changed, 10 insertions, 29 deletions
diff --git a/lib/ocs/cloud.php b/lib/ocs/cloud.php
index 720cc0ade39..b5cfbc295e8 100644
--- a/lib/ocs/cloud.php
+++ b/lib/ocs/cloud.php
@@ -17,7 +17,6 @@ class OC_OCS_Cloud {
}
public static function getUserQuota($parameters){
- OC_Util::checkLoggedIn();
$user = OC_User::getUser();
if(OC_Group::inGroup($user, 'admin') or ($user==$parameters['user'])) {
@@ -41,44 +40,25 @@ class OC_OCS_Cloud {
return new OC_OCS_Result($xml);
}else{
- return 300;
+ return new OC_OCS_Result(null, 300);
}
}else{
- return 300;
- }
- }
-
- public static function setUserQuota($parameters){
- OC_Util::checkLoggedIn();
- $user = OC_User::getUser();
- if(OC_Group::inGroup($user, 'admin')) {
-
- // todo
- // not yet implemented
- // add logic here
- error_log('OCS call: user:'.$parameters['user'].' quota:'.$parameters['quota']);
-
- $xml=array();
- return $xml;
- }else{
- return 300;
+ return new OC_OCS_Result(null, 300);
}
}
public static function getUserPublickey($parameters){
- OC_Util::checkLoggedIn();
if(OC_User::userExists($parameters['user'])){
// calculate the disc space
// TODO
- return array();
+ return new OC_OCS_Result(array());
}else{
- return 300;
+ return new OC_OCS_Result(null, 300);
}
}
public static function getUserPrivatekey($parameters){
- OC_Util::checkLoggedIn();
$user = OC_User::getUser();
if(OC_Group::inGroup($user, 'admin') or ($user==$parameters['user'])) {
@@ -87,10 +67,10 @@ class OC_OCS_Cloud {
$txt='this is the private key of '.$parameters['user'];
echo($txt);
}else{
- echo self::generateXml('', 'fail', 300, 'User does not exist');
+ return new OC_OCS_Result(null, 300, 'User does not exist');
}
}else{
- echo self::generateXml('', 'fail', 300, 'You don´t have permission to access this ressource.');
+ return new OC_OCS_Result('null', 300, 'You don´t have permission to access this ressource.');
}
}
}
diff --git a/lib/ocs/config.php b/lib/ocs/config.php
index eb9e470381a..52affcd65ee 100644
--- a/lib/ocs/config.php
+++ b/lib/ocs/config.php
@@ -10,4 +10,5 @@ class OC_OCS_Config {
$xml['ssl'] = 'false';
return new OC_OCS_Result($xml);
}
+
}
diff --git a/lib/ocs/privatedata.php b/lib/ocs/privatedata.php
index 02ca31f2d29..09d636bd733 100644
--- a/lib/ocs/privatedata.php
+++ b/lib/ocs/privatedata.php
@@ -8,7 +8,7 @@ class OC_OCS_Privatedata {
$app = addslashes(strip_tags($parameters['app']));
$key = addslashes(strip_tags($parameters['key']));
$result = OC_OCS::getData($user,$app,$key);
- $xml= array();
+ $xml = array();
foreach($result as $i=>$log) {
$xml[$i]['key']=$log['key'];
$xml[$i]['app']=$log['app'];
@@ -24,7 +24,7 @@ class OC_OCS_Privatedata {
$app = addslashes(strip_tags($parameters['app']));
$key = addslashes(strip_tags($parameters['key']));
$value = OC_OCS::readData('post', 'value', 'text');
- if(OC_OCS::setData($user,$app,$key,$value)){
+ if(OC_Preferences::setValue($user,$app,$key,$value)){
return new OC_OCS_Result(null, 100);
}
}
@@ -37,7 +37,7 @@ class OC_OCS_Privatedata {
if($key=="" or $app==""){
return new OC_OCS_Result(null, 101); //key and app are NOT optional here
}
- if(OC_OCS::deleteData($user,$app,$key)){
+ if(OC_Preferences::deleteKey($user,$app,$key)){
return new OC_OCS_Result(null, 100);
}
}