mirror of
https://github.com/nextcloud/server.git
synced 2024-08-10 02:11:09 +02:00
only add the possibility to import ssl root certificates to the personal
setting if the user can mount external storages
This commit is contained in:
parent
4105d17133
commit
573177d176
@ -104,6 +104,17 @@ $clients = array(
|
|||||||
'ios' => $config->getSystemValue('customclient_ios', $defaults->getiOSClientUrl())
|
'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
|
// Return template
|
||||||
$tmpl = new OC_Template( 'settings', 'personal', 'user');
|
$tmpl = new OC_Template( 'settings', 'personal', 'user');
|
||||||
$tmpl->assign('usage', OC_Helper::humanFileSize($storageInfo['used']));
|
$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('enableAvatars', $config->getSystemValue('enable_avatars', true));
|
||||||
$tmpl->assign('avatarChangeSupported', OC_User::canUserChangeAvatar(OC_User::getUser()));
|
$tmpl->assign('avatarChangeSupported', OC_User::canUserChangeAvatar(OC_User::getUser()));
|
||||||
$tmpl->assign('certs', $certificateManager->listCertificates());
|
$tmpl->assign('certs', $certificateManager->listCertificates());
|
||||||
|
$tmpl->assign('showCertificates', $enableCertImport);
|
||||||
$tmpl->assign('urlGenerator', $urlGenerator);
|
$tmpl->assign('urlGenerator', $urlGenerator);
|
||||||
|
|
||||||
// Get array of group ids for this user
|
// Get array of group ids for this user
|
||||||
@ -157,7 +169,11 @@ $formsMap = array_map(function($form){
|
|||||||
$formsAndMore = array_merge($formsAndMore, $formsMap);
|
$formsAndMore = array_merge($formsAndMore, $formsMap);
|
||||||
|
|
||||||
// add bottom hardcoded forms from the template
|
// 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->assign('forms', $formsAndMore);
|
||||||
$tmpl->printPage();
|
$tmpl->printPage();
|
||||||
|
@ -205,6 +205,7 @@ if($_['passwordChangeSupported']) {
|
|||||||
<?php }
|
<?php }
|
||||||
};?>
|
};?>
|
||||||
|
|
||||||
|
<?php if($_['showCertificates']) : ?>
|
||||||
<div id="ssl-root-certificates" class="section">
|
<div id="ssl-root-certificates" class="section">
|
||||||
<h2><?php p($l->t('SSL root certificates')); ?></h2>
|
<h2><?php p($l->t('SSL root certificates')); ?></h2>
|
||||||
<table id="sslCertificate" class="grid">
|
<table id="sslCertificate" class="grid">
|
||||||
@ -242,6 +243,7 @@ if($_['passwordChangeSupported']) {
|
|||||||
<input type="button" id="rootcert_import_button" value="<?php p($l->t('Import root certificate')); ?>"/>
|
<input type="button" id="rootcert_import_button" value="<?php p($l->t('Import root certificate')); ?>"/>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
<div class="section">
|
<div class="section">
|
||||||
<h2><?php p($l->t('Version'));?></h2>
|
<h2><?php p($l->t('Version'));?></h2>
|
||||||
|
Loading…
Reference in New Issue
Block a user