summaryrefslogtreecommitdiffstats
path: root/apps/files_encryption/lib
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_encryption/lib')
-rwxr-xr-xapps/files_encryption/lib/helper.php9
-rw-r--r--apps/files_encryption/lib/session.php6
-rw-r--r--apps/files_encryption/lib/util.php12
3 files changed, 17 insertions, 10 deletions
diff --git a/apps/files_encryption/lib/helper.php b/apps/files_encryption/lib/helper.php
index bb06a57c714..74a3b96a944 100755
--- a/apps/files_encryption/lib/helper.php
+++ b/apps/files_encryption/lib/helper.php
@@ -111,10 +111,11 @@ class Helper {
public static function adminEnableRecovery($recoveryKeyId, $recoveryPassword) {
$view = new \OC\Files\View('/');
+ $appConfig = \OC::$server->getAppConfig();
if ($recoveryKeyId === null) {
$recoveryKeyId = 'recovery_' . substr(md5(time()), 0, 8);
- \OC_Appconfig::setValue('files_encryption', 'recoveryKeyId', $recoveryKeyId);
+ $appConfig->setValue('files_encryption', 'recoveryKeyId', $recoveryKeyId);
}
if (!$view->is_dir('/owncloud_private_key')) {
@@ -147,7 +148,7 @@ class Helper {
\OC_FileProxy::$enabled = true;
// Set recoveryAdmin as enabled
- \OC_Appconfig::setValue('files_encryption', 'recoveryAdminEnabled', 1);
+ $appConfig->setValue('files_encryption', 'recoveryAdminEnabled', 1);
$return = true;
@@ -155,7 +156,7 @@ class Helper {
$util = new \OCA\Encryption\Util(new \OC_FilesystemView('/'), \OCP\User::getUser());
$return = $util->checkRecoveryPassword($recoveryPassword);
if ($return) {
- \OC_Appconfig::setValue('files_encryption', 'recoveryAdminEnabled', 1);
+ $appConfig->setValue('files_encryption', 'recoveryAdminEnabled', 1);
}
}
@@ -218,7 +219,7 @@ class Helper {
if ($return) {
// Set recoveryAdmin as disabled
- \OC_Appconfig::setValue('files_encryption', 'recoveryAdminEnabled', 0);
+ \OC::$server->getAppConfig()->setValue('files_encryption', 'recoveryAdminEnabled', 0);
}
return $return;
diff --git a/apps/files_encryption/lib/session.php b/apps/files_encryption/lib/session.php
index 25f2198181f..324081beabb 100644
--- a/apps/files_encryption/lib/session.php
+++ b/apps/files_encryption/lib/session.php
@@ -51,11 +51,13 @@ class Session {
}
- $publicShareKeyId = \OC_Appconfig::getValue('files_encryption', 'publicShareKeyId');
+ $appConfig = \OC::$server->getAppConfig();
+
+ $publicShareKeyId = $appConfig->getValue('files_encryption', 'publicShareKeyId');
if ($publicShareKeyId === null) {
$publicShareKeyId = 'pubShare_' . substr(md5(time()), 0, 8);
- \OC_Appconfig::setValue('files_encryption', 'publicShareKeyId', $publicShareKeyId);
+ $appConfig->setValue('files_encryption', 'publicShareKeyId', $publicShareKeyId);
}
if (
diff --git a/apps/files_encryption/lib/util.php b/apps/files_encryption/lib/util.php
index ae3e2a2e15a..13184b50dbf 100644
--- a/apps/files_encryption/lib/util.php
+++ b/apps/files_encryption/lib/util.php
@@ -63,8 +63,10 @@ class Util {
$this->client = $client;
$this->userId = $userId;
- $this->publicShareKeyId = \OC_Appconfig::getValue('files_encryption', 'publicShareKeyId');
- $this->recoveryKeyId = \OC_Appconfig::getValue('files_encryption', 'recoveryKeyId');
+ $appConfig = \OC::$server->getAppConfig();
+
+ $this->publicShareKeyId = $appConfig->getValue('files_encryption', 'publicShareKeyId');
+ $this->recoveryKeyId = $appConfig->getValue('files_encryption', 'recoveryKeyId');
$this->userDir = '/' . $this->userId;
$this->fileFolderName = 'files';
@@ -1113,9 +1115,11 @@ class Util {
*/
public function getSharingUsersArray($sharingEnabled, $filePath, $currentUserId = false) {
+ $appConfig = \OC::$server->getAppConfig();
+
// Check if key recovery is enabled
if (
- \OC_Appconfig::getValue('files_encryption', 'recoveryAdminEnabled')
+ $appConfig->getValue('files_encryption', 'recoveryAdminEnabled')
&& $this->recoveryEnabledForUser()
) {
$recoveryEnabled = true;
@@ -1144,7 +1148,7 @@ class Util {
// Admin UID to list of users to share to
if ($recoveryEnabled) {
// Find recoveryAdmin user ID
- $recoveryKeyId = \OC_Appconfig::getValue('files_encryption', 'recoveryKeyId');
+ $recoveryKeyId = $appConfig->getValue('files_encryption', 'recoveryKeyId');
// Add recoveryAdmin to list of users sharing
$userIds[] = $recoveryKeyId;
}