summaryrefslogtreecommitdiffstats
path: root/apps/encryption/lib
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2017-06-23 13:38:33 +0200
committerArthur Schiwon <blizzz@arthur-schiwon.de>2017-06-23 13:38:33 +0200
commit39ca06e6b9bfc85efc6c2f15090b0719b1e4f0ef (patch)
tree651fb3fc44b86cc0d155ed88a87b1c79d0d08410 /apps/encryption/lib
parentc5df6db6318a7cd2dacc85a895b35cd571ad3ac9 (diff)
downloadnextcloud-server-39ca06e6b9bfc85efc6c2f15090b0719b1e4f0ef.tar.gz
nextcloud-server-39ca06e6b9bfc85efc6c2f15090b0719b1e4f0ef.zip
fix setting up encryption section
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'apps/encryption/lib')
-rw-r--r--apps/encryption/lib/Settings/PersonalSection.php18
1 files changed, 16 insertions, 2 deletions
diff --git a/apps/encryption/lib/Settings/PersonalSection.php b/apps/encryption/lib/Settings/PersonalSection.php
index 70e826a6ea1..fd25d25ef8f 100644
--- a/apps/encryption/lib/Settings/PersonalSection.php
+++ b/apps/encryption/lib/Settings/PersonalSection.php
@@ -29,6 +29,7 @@ use OCA\Encryption\Session;
use OCP\IConfig;
use OCP\IL10N;
use OCP\IURLGenerator;
+use OCP\IUserSession;
use OCP\Settings\IIconSection;
class PersonalSection implements IIconSection {
@@ -43,13 +44,23 @@ class PersonalSection implements IIconSection {
private $config;
/** @var Session */
private $session;
+ /** @var IUserSession */
+ private $userSession;
- public function __construct(IURLGenerator $urlGenerator, IL10N $l, Application $app, IConfig $config, Session $session) {
+ public function __construct(
+ IURLGenerator $urlGenerator,
+ IL10N $l,
+ Application $app,
+ IConfig $config,
+ Session $session,
+ IUserSession $userSession
+ ) {
$this->urlGenerator = $urlGenerator;
$this->l = $l;
$this->app = $app;
$this->config = $config;
$this->session = $session;
+ $this->userSession = $userSession;
}
/**
@@ -71,10 +82,13 @@ class PersonalSection implements IIconSection {
* @since 9.1
*/
public function getID() {
+ // we need to return the proper id while installing/upgrading the app
+ $loggedIn = $this->userSession->isLoggedIn();
+
$recoveryAdminEnabled = $this->config->getAppValue('encryption', 'recoveryAdminEnabled');
$privateKeySet = $this->session->isPrivateKeySet();
- if (!$recoveryAdminEnabled && $privateKeySet) {
+ if ($loggedIn && !$recoveryAdminEnabled && $privateKeySet) {
return null;
}
return 'encryption';