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

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2015-08-04 18:50:30 +0300
committerBjoern Schiessle <schiessle@owncloud.com>2015-08-04 19:08:04 +0300
commit573177d1768dd69dde94106919a61344f4146794 (patch)
tree8178dafb76c6139dd9bf009ef6980d5c59aab989 /settings/personal.php
parent4105d17133a372547396c2f4862f98423f5564e0 (diff)
only add the possibility to import ssl root certificates to the personal
setting if the user can mount external storages
Diffstat (limited to 'settings/personal.php')
-rw-r--r--settings/personal.php18
1 files changed, 17 insertions, 1 deletions
diff --git a/settings/personal.php b/settings/personal.php
index 8823102e01a..203c9f68af8 100644
--- a/settings/personal.php
+++ b/settings/personal.php
@@ -104,6 +104,17 @@ $clients = array(
'ios' => $config->getSystemValue('customclient_ios', $defaults->getiOSClientUrl())
);
+// only show root certificate import if external storages are enabled
+$enableCertImport = false;
+$externalStorageEnabled = \OC::$server->getAppManager()->isEnabledForUser('files_external');
+if ($externalStorageEnabled) {
+ $backends = OC_Mount_Config::getPersonalBackends();
+ if (!empty($backends)) {
+ $enableCertImport = true;
+ }
+}
+
+
// Return template
$tmpl = new OC_Template( 'settings', 'personal', 'user');
$tmpl->assign('usage', OC_Helper::humanFileSize($storageInfo['used']));
@@ -120,6 +131,7 @@ $tmpl->assign('displayName', OC_User::getDisplayName());
$tmpl->assign('enableAvatars', $config->getSystemValue('enable_avatars', true));
$tmpl->assign('avatarChangeSupported', OC_User::canUserChangeAvatar(OC_User::getUser()));
$tmpl->assign('certs', $certificateManager->listCertificates());
+$tmpl->assign('showCertificates', $enableCertImport);
$tmpl->assign('urlGenerator', $urlGenerator);
// Get array of group ids for this user
@@ -157,7 +169,11 @@ $formsMap = array_map(function($form){
$formsAndMore = array_merge($formsAndMore, $formsMap);
// add bottom hardcoded forms from the template
-$formsAndMore[]= array( 'anchor' => 'ssl-root-certificates', 'section-name' => $l->t('SSL root certificates') );
+if($enableCertImport) {
+ $formsAndMore[]= array( 'anchor' => 'ssl-root-certificates', 'section-name' => $l->t('SSL root certificates') );
+}
+
+
$tmpl->assign('forms', $formsAndMore);
$tmpl->printPage();