aboutsummaryrefslogtreecommitdiffstats
path: root/apps/encryption/lib/Controller
diff options
context:
space:
mode:
authorBjoern Schiessle <bjoern@schiessle.org>2017-05-30 13:22:27 +0200
committerBjoern Schiessle <bjoern@schiessle.org>2017-07-06 11:47:11 +0200
commit5f75468aa4341672e3a805ab5ce2ae03ba7402cc (patch)
tree1eafc930e978640e8aa4b78797e95fa9085fb934 /apps/encryption/lib/Controller
parent28a7e72868017fb545e8303f32c1204ffc4cc8c1 (diff)
downloadnextcloud-server-5f75468aa4341672e3a805ab5ce2ae03ba7402cc.tar.gz
nextcloud-server-5f75468aa4341672e3a805ab5ce2ae03ba7402cc.zip
improve status messages
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Diffstat (limited to 'apps/encryption/lib/Controller')
-rw-r--r--apps/encryption/lib/Controller/StatusController.php21
1 files changed, 17 insertions, 4 deletions
diff --git a/apps/encryption/lib/Controller/StatusController.php b/apps/encryption/lib/Controller/StatusController.php
index 0776a84ceb4..9ec9fd1234b 100644
--- a/apps/encryption/lib/Controller/StatusController.php
+++ b/apps/encryption/lib/Controller/StatusController.php
@@ -28,6 +28,7 @@ namespace OCA\Encryption\Controller;
use OCA\Encryption\Session;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\DataResponse;
+use OCP\Encryption\IManager;
use OCP\IL10N;
use OCP\IRequest;
@@ -39,20 +40,26 @@ class StatusController extends Controller {
/** @var Session */
private $session;
+ /** @var IManager */
+ private $encryptionManager;
+
/**
* @param string $AppName
* @param IRequest $request
* @param IL10N $l10n
* @param Session $session
+ * @param IManager $encryptionManager
*/
public function __construct($AppName,
IRequest $request,
IL10N $l10n,
- Session $session
+ Session $session,
+ IManager $encryptionManager
) {
parent::__construct($AppName, $request);
$this->l = $l10n;
$this->session = $session;
+ $this->encryptionManager = $encryptionManager;
}
/**
@@ -78,9 +85,15 @@ class StatusController extends Controller {
break;
case Session::NOT_INITIALIZED:
$status = 'interactionNeeded';
- $message = (string)$this->l->t(
- 'Encryption App is enabled, but your keys are not initialized. Please log-out and log-in again.'
- );
+ if ($this->encryptionManager->isEnabled()) {
+ $message = (string)$this->l->t(
+ 'Encryption App is enabled, but your keys are not initialized. Please log-out and log-in again.'
+ );
+ } else {
+ $message = (string)$this->l->t(
+ 'Please enable server side encryption in the admin settings in order to use the encryption module.'
+ );
+ }
break;
case Session::INIT_SUCCESSFUL:
$status = 'success';