From 0d0377ebfb123e079822632ae4bc6855a11eb117 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Tue, 12 Jan 2016 12:58:45 +0100 Subject: [PATCH] Add a config option to enable certificate management --- config/config.sample.php | 5 +++++ settings/admin.php | 14 ++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/config/config.sample.php b/config/config.sample.php index 7ba3977fe3..8e0d89f93d 100644 --- a/config/config.sample.php +++ b/config/config.sample.php @@ -846,6 +846,11 @@ $CONFIG = array( 'config' => '/absolute/location/of/openssl.cnf', ), +/** + * Allow the configuration of system wide trusted certificates + */ +'enable_certificate_management' => false, + /** * Memory caching backend configuration * diff --git a/settings/admin.php b/settings/admin.php index 7bd3760b6c..7416e798a8 100644 --- a/settings/admin.php +++ b/settings/admin.php @@ -158,12 +158,14 @@ $template->assign('OutdatedCacheWarning', $outdatedCaches); // add hardcoded forms from the template $forms = OC_App::getForms('admin'); -$certificatesTemplate = new OC_Template('settings', 'certificates'); -$certificatesTemplate->assign('type', 'admin'); -$certificatesTemplate->assign('uploadRoute', 'settings.Certificate.addSystemRootCertificate'); -$certificatesTemplate->assign('certs', $certificateManager->listCertificates()); -$certificatesTemplate->assign('urlGenerator', $urlGenerator); -$forms[] = $certificatesTemplate->fetchPage(); +if ($config->getSystemValue('enable_certificate_management', false)) { + $certificatesTemplate = new OC_Template('settings', 'certificates'); + $certificatesTemplate->assign('type', 'admin'); + $certificatesTemplate->assign('uploadRoute', 'settings.Certificate.addSystemRootCertificate'); + $certificatesTemplate->assign('certs', $certificateManager->listCertificates()); + $certificatesTemplate->assign('urlGenerator', $urlGenerator); + $forms[] = $certificatesTemplate->fetchPage(); +} $formsAndMore = array(); if ($request->getServerProtocol() !== 'https' || !OC_Util::isAnnotationsWorking() ||