diff options
author | Robin Appelman <icewind@owncloud.com> | 2015-12-22 17:42:28 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2016-01-12 12:50:59 +0100 |
commit | c15cab7ed6bf2d3ce9009ca09c7c5f33b252860f (patch) | |
tree | 08d3aefd146ce159b23073958f2fb7e96ace4143 /settings/personal.php | |
parent | 0c0829fbc73ce10ea1a951989c20973b6b5faa16 (diff) | |
download | nextcloud-server-c15cab7ed6bf2d3ce9009ca09c7c5f33b252860f.tar.gz nextcloud-server-c15cab7ed6bf2d3ce9009ca09c7c5f33b252860f.zip |
Allow admins to add system wide root certificates
Diffstat (limited to 'settings/personal.php')
-rw-r--r-- | settings/personal.php | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/settings/personal.php b/settings/personal.php index c4e1c057bf3..54698fd6d54 100644 --- a/settings/personal.php +++ b/settings/personal.php @@ -43,6 +43,7 @@ $urlGenerator = \OC::$server->getURLGenerator(); // Highlight navigation entry OC_Util::addScript( 'settings', 'personal' ); +OC_Util::addScript('settings', 'certificates'); OC_Util::addStyle( 'settings', 'settings' ); \OC_Util::addVendorScript('strengthify/jquery.strengthify'); \OC_Util::addVendorStyle('strengthify/strengthify'); @@ -168,6 +169,17 @@ $formsAndMore[]= ['anchor' => 'clientsbox', 'section-name' => $l->t('Sync client $forms=OC_App::getForms('personal'); + +// add bottom hardcoded forms from the template +if ($enableCertImport) { + $certificatesTemplate = new OC_Template('settings', 'certificates'); + $certificatesTemplate->assign('type', 'personal'); + $certificatesTemplate->assign('uploadRoute', 'settings.Certificate.addPersonalRootCertificate'); + $certificatesTemplate->assign('certs', $certificateManager->listCertificates()); + $certificatesTemplate->assign('urlGenerator', $urlGenerator); + $forms[] = $certificatesTemplate->fetchPage(); +} + $formsMap = array_map(function($form){ if (preg_match('%(<h2(?P<class>[^>]*)>.*?</h2>)%i', $form, $regs)) { $sectionName = str_replace('<h2'.$regs['class'].'>', '', $regs[0]); @@ -188,12 +200,5 @@ $formsMap = array_map(function($form){ $formsAndMore = array_merge($formsAndMore, $formsMap); -// add bottom hardcoded forms from the template -if($enableCertImport) { - $formsAndMore[]= array( 'anchor' => 'ssl-root-certificates', 'section-name' => $l->t('SSL root certificates') ); -} - - - $tmpl->assign('forms', $formsAndMore); $tmpl->printPage(); |