aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2012-07-31 16:52:21 +0200
committerBjoern Schiessle <schiessle@owncloud.com>2012-07-31 16:52:21 +0200
commitf6863f9e51ca1523e43c92a1ecbfe6f70c090494 (patch)
treeb939ff2685ed79536f85b941954d560ca72008fd
parente4e6574e425b666170ac56238a3bb6c84a2d50e2 (diff)
downloadnextcloud-server-f6863f9e51ca1523e43c92a1ecbfe6f70c090494.tar.gz
nextcloud-server-f6863f9e51ca1523e43c92a1ecbfe6f70c090494.zip
get encryption mode from the settings
-rw-r--r--apps/files_encryption/lib/crypt.php16
1 files changed, 11 insertions, 5 deletions
diff --git a/apps/files_encryption/lib/crypt.php b/apps/files_encryption/lib/crypt.php
index 090b1db0611..fdace3e61dd 100644
--- a/apps/files_encryption/lib/crypt.php
+++ b/apps/files_encryption/lib/crypt.php
@@ -32,13 +32,19 @@ class Crypt {
/**
* @brief return encryption mode client or server side encryption
- * @param string user name
+ * @param string user name (use system wide setting if name=null)
* @return string 'client' or 'server'
*/
- public static function mode($user) {
- //TODO: allow user to set encryption mode and check the selection of the user
- // for the moment I just return 'client' for test purposes
- return 'client';
+ public static function mode($user=null) {
+
+ $mode = \OC_Appconfig::getValue('files_encryption', 'mode', 'unknown');
+
+ if ($mode == 'unknown') {
+ error_log('no encryption mode configured');
+ return false;
+ }
+
+ return $mode;
}
/**