]> source.dussan.org Git - nextcloud-server.git/commitdiff
only show personal settings if the recovery feature is enabled or if no private key...
authorBjörn Schießle <schiessle@owncloud.com>
Wed, 5 Jun 2013 11:51:28 +0000 (13:51 +0200)
committerBjörn Schießle <schiessle@owncloud.com>
Thu, 13 Jun 2013 11:43:17 +0000 (13:43 +0200)
apps/files_encryption/settings-personal.php

index 3aa8b399355006661df22b0eedf3563a24c7050c..fddc3ea5eee836494eeec89e41114a2a6de86278 100644 (file)
@@ -21,12 +21,19 @@ $privateKeySet = ($session->getPrivateKey() !== false) ? true : false;
 $recoveryAdminEnabled = OC_Appconfig::getValue('files_encryption', 'recoveryAdminEnabled');\r
 $recoveryEnabledForUser = $util->recoveryEnabledForUser();\r
 \r
-\OCP\Util::addscript('files_encryption', 'settings-personal');\r
-\OCP\Util::addScript('settings', 'personal');\r
+$result = false;\r
 \r
-$tmpl->assign('recoveryEnabled', $recoveryAdminEnabled);\r
-$tmpl->assign('recoveryEnabledForUser', $recoveryEnabledForUser);\r
-$tmpl->assign('privateKeySet', $privateKeySet);\r
+if ($recoveryAdminEnabled || !$privateKeySet) {\r
 \r
-return $tmpl->fetchPage();\r
+       \OCP\Util::addscript('files_encryption', 'settings-personal');\r
+       \OCP\Util::addScript('settings', 'personal');\r
+\r
+       $tmpl->assign('recoveryEnabled', $recoveryAdminEnabled);\r
+       $tmpl->assign('recoveryEnabledForUser', $recoveryEnabledForUser);\r
+       $tmpl->assign('privateKeySet', $privateKeySet);\r
+\r
+       $result = $tmpl->fetchPage();\r
+}\r
+\r
+return $result;\r
 \r