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

github.com/nextcloud/privacy.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Controller/AdminController.php')
-rw-r--r--lib/Controller/AdminController.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/Controller/AdminController.php b/lib/Controller/AdminController.php
index b13e81b..f8bfaca 100644
--- a/lib/Controller/AdminController.php
+++ b/lib/Controller/AdminController.php
@@ -98,4 +98,17 @@ class AdminController extends Controller {
return new JSONResponse([], Http::STATUS_OK);
}
+ /**
+ * @param string $enabled
+ * @return JSONResponse
+ */
+ public function setFullDiskEncryption(string $enabled):JSONResponse {
+ $allowedValues = ['0', '1'];
+ if (!\in_array($enabled, $allowedValues, true)) {
+ return new JSONResponse([], HTTP::STATUS_NOT_ACCEPTABLE);
+ }
+
+ $this->config->setAppValue('privacy', 'fullDiskEncryptionEnabled', $enabled);
+ return new JSONResponse([], HTTP::STATUS_OK);
+ }
}