From 430d36a64890eed7bb6c2d87980c7d754f0128e1 Mon Sep 17 00:00:00 2001 From: RainLoop Team Date: Sat, 18 Oct 2014 19:29:09 +0400 Subject: [PATCH] Added "verify ssl certificate" setting in Admin panel interface (Security tab) --- dev/Settings/Admin/Security.js | 8 ++++++++ rainloop/v/0.0.0/app/src/RainLoop/Actions.php | 2 ++ .../templates/Views/Admin/AdminSettingsSecurity.html | 11 ++++++++++- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/dev/Settings/Admin/Security.js b/dev/Settings/Admin/Security.js index 816e896a5..f4a7ae6a1 100644 --- a/dev/Settings/Admin/Security.js +++ b/dev/Settings/Admin/Security.js @@ -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 () diff --git a/rainloop/v/0.0.0/app/src/RainLoop/Actions.php b/rainloop/v/0.0.0/app/src/RainLoop/Actions.php index b7397467c..284be4f76 100644 --- a/rainloop/v/0.0.0/app/src/RainLoop/Actions.php +++ b/rainloop/v/0.0.0/app/src/RainLoop/Actions.php @@ -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'); diff --git a/rainloop/v/0.0.0/app/templates/Views/Admin/AdminSettingsSecurity.html b/rainloop/v/0.0.0/app/templates/Views/Admin/AdminSettingsSecurity.html index 0ebb44b51..dfbbe8a48 100644 --- a/rainloop/v/0.0.0/app/templates/Views/Admin/AdminSettingsSecurity.html +++ b/rainloop/v/0.0.0/app/templates/Views/Admin/AdminSettingsSecurity.html @@ -18,7 +18,6 @@    Use local proxy for external images - (beta) @@ -32,6 +31,16 @@ +
+
+ +
+