Added "verify ssl certificate" setting in Admin panel interface (Security tab)

This commit is contained in:
RainLoop Team 2014-10-18 19:29:09 +04:00
parent d17f249f45
commit 430d36a648
3 changed files with 20 additions and 1 deletions

View file

@ -28,6 +28,8 @@
this.capaOpenPGP = ko.observable(Settings.capa(Enums.Capa.OpenPGP));
this.capaTwoFactorAuth = ko.observable(Settings.capa(Enums.Capa.TwoFactor));
this.verifySslCertificate = ko.observable(!!Settings.settingsGet('VerifySslCertificate'));
this.adminLogin = ko.observable(Settings.settingsGet('AdminLogin'));
this.adminLoginError = ko.observable(false);
this.adminPassword = ko.observable('');
@ -130,6 +132,12 @@
'UseLocalProxyForExternalImages': bValue ? '1' : '0'
});
});
this.verifySslCertificate.subscribe(function (bValue) {
Remote.saveAdminConfig(null, {
'VerifySslCertificate': bValue ? '1' : '0'
});
});
};
SecurityAdminSetting.prototype.onHide = function ()

View file

@ -1148,6 +1148,7 @@ class Actions
$aResult['AdminDomain'] = APP_SITE;
$aResult['UseTokenProtection'] = (bool) $oConfig->Get('security', 'csrf_protection', true);
$aResult['EnabledPlugins'] = (bool) $oConfig->Get('plugins', 'enable', false);
$aResult['VerifySslCertificate'] = !!$oConfig->Get('ssl', 'verify_certificate', false);
$aDrivers = \class_exists('PDO') ? \PDO::getAvailableDrivers() : array();
$aResult['MySqlIsSupported'] = \is_array($aDrivers) ? \in_array('mysql', $aDrivers) : false;
@ -2411,6 +2412,7 @@ class Actions
return $self->ValidateTheme($sTheme);
});
$this->setConfigFromParams($oConfig, 'VerifySslCertificate', 'ssl', 'verify_certificate', 'bool');
$this->setConfigFromParams($oConfig, 'UseLocalProxyForExternalImages', 'labs', 'use_local_proxy_for_external_images', 'bool');
$this->setConfigFromParams($oConfig, 'AllowLanguagesOnSettings', 'webmail', 'allow_languages_on_settings', 'bool');

View file

@ -18,7 +18,6 @@
<i data-bind="css: useLocalProxyForExternalImages() ? 'icon-checkbox-checked' : 'icon-checkbox-unchecked'"></i>
&nbsp;&nbsp;
Use local proxy for external images
<span style="color:red">(beta)</span>
</label>
</div>
</div>
@ -32,6 +31,16 @@
</label>
</div>
</div>
<div class="control-group">
<div class="controls">
<label data-bind="click: function () { verifySslCertificate(!verifySslCertificate()); }">
<i data-bind="css: verifySslCertificate() ? 'icon-checkbox-checked' : 'icon-checkbox-unchecked'"></i>
&nbsp;&nbsp;
Require verification of SSL certificate used (IMAP/SMTP).
<span style="color:red">(beta)</span>
</label>
</div>
</div>
<div class="control-group">
<div class="controls">
<a href="#" target="_blank" class="g-ui-link" data-bind="link: phpInfoLink()">Show PHP information</a>