summaryrefslogtreecommitdiffstats
path: root/lib/ocs/privatedata.php
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2012-07-31 22:19:11 +0200
committerBart Visscher <bartv@thisnet.nl>2012-07-31 22:19:11 +0200
commit28537037ae27a8e766d3c4ef129422dc02b45d5f (patch)
treeae1adc68e1114357b27a86546d2f2969cdf02338 /lib/ocs/privatedata.php
parentc2bdb5c71640567e0be3c2fc7e4d32af1469a55e (diff)
downloadnextcloud-server-28537037ae27a8e766d3c4ef129422dc02b45d5f.tar.gz
nextcloud-server-28537037ae27a8e766d3c4ef129422dc02b45d5f.zip
Fixup OCS modules
Diffstat (limited to 'lib/ocs/privatedata.php')
-rw-r--r--lib/ocs/privatedata.php22
1 files changed, 13 insertions, 9 deletions
diff --git a/lib/ocs/privatedata.php b/lib/ocs/privatedata.php
index 77214046911..1c781dece8a 100644
--- a/lib/ocs/privatedata.php
+++ b/lib/ocs/privatedata.php
@@ -2,8 +2,8 @@
class OC_OCS_Privatedata {
- public static function privatedataGet($parameters){
- // TODO check user auth
+ public static function get($parameters){
+ OC_Util::checkLoggedIn();
$user = OC_User::getUser();
$app = addslashes(strip_tags($parameters['app']));
$key = addslashes(strip_tags($parameters['key']));
@@ -18,15 +18,22 @@ class OC_OCS_Privatedata {
//TODO: replace 'privatedata' with 'attribute' once a new libattice has been released that works with it
}
- public static function privatedataSet($parameters){
- $user = OC_OCS::checkpassword();
+ public static function set($parameters){
+ OC_Util::checkLoggedIn();
+ $user = OC_User::getUser();
+ $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)){
return 100;
}
}
- public static function privatedataDelete($parameteres){
- $user = OC_OCS::checkpassword();
+ public static function delete($parameters){
+ OC_Util::checkLoggedIn();
+ $user = OC_User::getUser();
+ $app = addslashes(strip_tags($parameters['app']));
+ $key = addslashes(strip_tags($parameters['key']));
if($key=="" or $app==""){
return; //key and app are NOT optional here
}
@@ -34,7 +41,4 @@ class OC_OCS_Privatedata {
return 100;
}
}
-
}
-
-?>