From c062322d0f00df5d3d094367b872f2b5ceadd668 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bj=C3=B6rn=20Schie=C3=9Fle?= Date: Wed, 5 Jun 2013 13:51:28 +0200 Subject: [PATCH] only show personal settings if the recovery feature is enabled or if no private key is set --- apps/files_encryption/settings-personal.php | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/apps/files_encryption/settings-personal.php b/apps/files_encryption/settings-personal.php index 3aa8b399355..fddc3ea5eee 100644 --- a/apps/files_encryption/settings-personal.php +++ b/apps/files_encryption/settings-personal.php @@ -21,12 +21,19 @@ $privateKeySet = ($session->getPrivateKey() !== false) ? true : false; $recoveryAdminEnabled = OC_Appconfig::getValue('files_encryption', 'recoveryAdminEnabled'); $recoveryEnabledForUser = $util->recoveryEnabledForUser(); -\OCP\Util::addscript('files_encryption', 'settings-personal'); -\OCP\Util::addScript('settings', 'personal'); +$result = false; -$tmpl->assign('recoveryEnabled', $recoveryAdminEnabled); -$tmpl->assign('recoveryEnabledForUser', $recoveryEnabledForUser); -$tmpl->assign('privateKeySet', $privateKeySet); +if ($recoveryAdminEnabled || !$privateKeySet) { -return $tmpl->fetchPage(); + \OCP\Util::addscript('files_encryption', 'settings-personal'); + \OCP\Util::addScript('settings', 'personal'); + + $tmpl->assign('recoveryEnabled', $recoveryAdminEnabled); + $tmpl->assign('recoveryEnabledForUser', $recoveryEnabledForUser); + $tmpl->assign('privateKeySet', $privateKeySet); + + $result = $tmpl->fetchPage(); +} + +return $result; -- 2.39.5