summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2014-08-31 15:27:36 +0200
committerRobin Appelman <icewind@owncloud.com>2014-08-31 15:27:36 +0200
commit0a1e5aebf1198cc155862fad8c890121f5f379e9 (patch)
tree6b2a2262ac8382bb5f6400ea3ab78babaac6e4d2
parent73685892ed6f255a916512863cd5549914d071e1 (diff)
downloadnextcloud-server-0a1e5aebf1198cc155862fad8c890121f5f379e9.tar.gz
nextcloud-server-0a1e5aebf1198cc155862fad8c890121f5f379e9.zip
Extend public config interface
-rw-r--r--lib/private/allconfig.php45
-rw-r--r--lib/public/iconfig.php33
2 files changed, 76 insertions, 2 deletions
diff --git a/lib/private/allconfig.php b/lib/private/allconfig.php
index ef8673af231..721ec337ff8 100644
--- a/lib/private/allconfig.php
+++ b/lib/private/allconfig.php
@@ -19,8 +19,8 @@ class AllConfig implements \OCP\IConfig {
* @param string $key the key of the value, under which will be saved
* @param mixed $value the value that should be stored
*/
- public function setSystemValue($key, $value) {
- \OCP\Config::setSystemValue($key, $value);
+ public function setSystemValue($key, $value) {
+ \OCP\Config::setSystemValue($key, $value);
}
/**
@@ -34,6 +34,15 @@ class AllConfig implements \OCP\IConfig {
return \OCP\Config::getSystemValue($key, $default);
}
+ /**
+ * Delete a system wide defined value
+ *
+ * @param string $key the key of the value, under which it was saved
+ */
+ public function deleteSystemValue($key) {
+ \OCP\Config::deleteSystemValue($key);
+ }
+
/**
* Writes a new app wide value
@@ -58,6 +67,16 @@ class AllConfig implements \OCP\IConfig {
return \OCP\Config::getAppValue($appName, $key, $default);
}
+ /**
+ * Delete an app wide defined value
+ *
+ * @param string $appName the appName that we stored the value under
+ * @param string $key the key of the value, under which it was saved
+ */
+ public function deleteAppValue($appName, $key) {
+ \OC_Appconfig::deleteKey($appName, $key);
+ }
+
/**
* Set a user defined value
@@ -83,4 +102,26 @@ class AllConfig implements \OCP\IConfig {
public function getUserValue($userId, $appName, $key, $default = '') {
return \OCP\Config::getUserValue($userId, $appName, $key, $default);
}
+
+ /**
+ * Get the keys of all stored by an app for the user
+ *
+ * @param string $userId the userId of the user that we want to store the value under
+ * @param string $appName the appName that we stored the value under
+ * @return string[]
+ */
+ public function getUserKeys($userId, $appName) {
+ return \OC_Preferences::getKeys($userId, $appName);
+ }
+
+ /**
+ * Delete a user value
+ *
+ * @param string $userId the userId of the user that we want to store the value under
+ * @param string $appName the appName that we stored the value under
+ * @param string $key the key under which the value is being stored
+ */
+ public function deleteUserValue($userId, $appName, $key) {
+ \OC_Preferences::deleteKey($userId, $appName, $key);
+ }
}
diff --git a/lib/public/iconfig.php b/lib/public/iconfig.php
index 4865f8bc85b..755da09ee6b 100644
--- a/lib/public/iconfig.php
+++ b/lib/public/iconfig.php
@@ -51,6 +51,13 @@ interface IConfig {
*/
public function getSystemValue($key, $default = '');
+ /**
+ * Delete a system wide defined value
+ *
+ * @param string $key the key of the value, under which it was saved
+ */
+ public function deleteSystemValue($key);
+
/**
* Writes a new app wide value
@@ -72,6 +79,14 @@ interface IConfig {
*/
public function getAppValue($appName, $key, $default = '');
+ /**
+ * Delete an app wide defined value
+ *
+ * @param string $appName the appName that we stored the value under
+ * @param string $key the key of the value, under which it was saved
+ */
+ public function deleteAppValue($appName, $key);
+
/**
* Set a user defined value
@@ -94,4 +109,22 @@ interface IConfig {
* @return string
*/
public function getUserValue($userId, $appName, $key, $default = '');
+
+ /**
+ * Get the keys of all stored by an app for the user
+ *
+ * @param string $userId the userId of the user that we want to store the value under
+ * @param string $appName the appName that we stored the value under
+ * @return string[]
+ */
+ public function getUserKeys($userId, $appName);
+
+ /**
+ * Delete a user value
+ *
+ * @param string $userId the userId of the user that we want to store the value under
+ * @param string $appName the appName that we stored the value under
+ * @param string $key the key under which the value is being stored
+ */
+ public function deleteUserValue($userId, $appName, $key);
}