Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib/ocs
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2012-08-01 00:19:11 +0400
committerBart Visscher <bartv@thisnet.nl>2012-08-01 00:19:11 +0400
commit28537037ae27a8e766d3c4ef129422dc02b45d5f (patch)
treeae1adc68e1114357b27a86546d2f2969cdf02338 /lib/ocs
parentc2bdb5c71640567e0be3c2fc7e4d32af1469a55e (diff)
Fixup OCS modules
Diffstat (limited to 'lib/ocs')
-rw-r--r--lib/ocs/activity.php3
-rw-r--r--lib/ocs/cloud.php53
-rw-r--r--lib/ocs/config.php3
-rw-r--r--lib/ocs/person.php4
-rw-r--r--lib/ocs/privatedata.php22
5 files changed, 39 insertions, 46 deletions
diff --git a/lib/ocs/activity.php b/lib/ocs/activity.php
index 3b090376e72..07b571665ec 100644
--- a/lib/ocs/activity.php
+++ b/lib/ocs/activity.php
@@ -5,7 +5,4 @@ class OC_OCS_Activity {
public static function activityGet($parameters){
// TODO
}
-
}
-
-?> \ No newline at end of file
diff --git a/lib/ocs/cloud.php b/lib/ocs/cloud.php
index d0cd72e98c5..2f2aad714a3 100644
--- a/lib/ocs/cloud.php
+++ b/lib/ocs/cloud.php
@@ -2,8 +2,8 @@
class OC_OCS_Cloud {
- public static function systemwebapps($parameters){
- $login = OC_OCS::checkpassword();
+ public static function getSystemWebApps($parameters){
+ OC_Util::checkLoggedIn();
$apps = OC_App::getEnabledApps();
$values = array();
foreach($apps as $app) {
@@ -16,9 +16,10 @@ class OC_OCS_Cloud {
return $values;
}
- public static function getQuota($parameters){
- $login=OC_OCS::checkpassword();
- if(OC_Group::inGroup($login, 'admin') or ($login==$parameters['user'])) {
+ public static function getUserQuota($parameters){
+ OC_Util::checkLoggedIn();
+ $user = OC_User::getUser();
+ if(OC_Group::inGroup($user, 'admin') or ($user==$parameters['user'])) {
if(OC_User::userExists($parameters['user'])){
// calculate the disc space
@@ -47,9 +48,10 @@ class OC_OCS_Cloud {
}
}
- public static function setQuota($parameters){
- $login=OC_OCS::checkpassword();
- if(OC_Group::inGroup($login, 'admin')) {
+ public static function setUserQuota($parameters){
+ OC_Util::checkLoggedIn();
+ $user = OC_User::getUser();
+ if(OC_Group::inGroup($user, 'admin')) {
// todo
// not yet implemented
@@ -63,8 +65,8 @@ class OC_OCS_Cloud {
}
}
- public static function getPublickey($parameters){
- $login=OC_OCS::checkpassword();
+ public static function getUserPublickey($parameters){
+ OC_Util::checkLoggedIn();
if(OC_User::userExists($parameters['user'])){
// calculate the disc space
@@ -75,23 +77,20 @@ class OC_OCS_Cloud {
}
}
- public static function getPrivatekey($parameters){
- $login=OC_OCS::checkpassword();
- if(OC_Group::inGroup($login, 'admin') or ($login==$parameters['user'])) {
+ public static function getUserPrivatekey($parameters){
+ OC_Util::checkLoggedIn();
+ $user = OC_User::getUser();
+ if(OC_Group::inGroup($user, 'admin') or ($user==$parameters['user'])) {
- if(OC_User::userExists($user)){
- // calculate the disc space
- $txt='this is the private key of '.$parameters['user'];
- echo($txt);
- }else{
- echo self::generateXml('', 'fail', 300, 'User does not exist');
- }
- }else{
- echo self::generateXml('', 'fail', 300, 'You don´t have permission to access this ressource.');
- }
+ if(OC_User::userExists($user)){
+ // calculate the disc space
+ $txt='this is the private key of '.$parameters['user'];
+ echo($txt);
+ }else{
+ echo self::generateXml('', 'fail', 300, 'User does not exist');
+ }
+ }else{
+ echo self::generateXml('', 'fail', 300, 'You don´t have permission to access this ressource.');
+ }
}
-
-
}
-
-?> \ No newline at end of file
diff --git a/lib/ocs/config.php b/lib/ocs/config.php
index b736abe3b9c..06103cbeb4f 100644
--- a/lib/ocs/config.php
+++ b/lib/ocs/config.php
@@ -10,7 +10,4 @@ class OC_OCS_Config {
$xml['ssl'] = 'false';
return $xml;
}
-
}
-
-?> \ No newline at end of file
diff --git a/lib/ocs/person.php b/lib/ocs/person.php
index f4e4be5ee09..629a7c2e6c7 100644
--- a/lib/ocs/person.php
+++ b/lib/ocs/person.php
@@ -14,9 +14,5 @@ class OC_OCS_Person {
}else{
return 101;
}
-
}
-
}
-
-?> \ No newline at end of file
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;
}
}
-
}
-
-?>