diff --git a/dev/Common/Enums.js b/dev/Common/Enums.js index a732ffd5a..a3628b601 100644 --- a/dev/Common/Enums.js +++ b/dev/Common/Enums.js @@ -46,6 +46,7 @@ 'Filters': 'FILTERS', 'AttachmentThumbnails': 'ATTACHMENT_THUMBNAILS', 'Templates': 'TEMPLATES', + 'AutoLogout': 'AUTOLOGOUT', 'AdditionalAccounts': 'ADDITIONAL_ACCOUNTS' }; diff --git a/dev/Common/Plugins.js b/dev/Common/Plugins.js index 1829ccfff..8a24e26b1 100644 --- a/dev/Common/Plugins.js +++ b/dev/Common/Plugins.js @@ -106,7 +106,7 @@ */ Plugins.prototype.addSettingsViewModel = function (SettingsViewModelClass, sTemplate, sLabelName, sRoute) { - this.aViewModelsHooks.push([SettingsViewModelClass, sTemplate, sLabelName, sRoute]); + this.aUserViewModelsHooks.push([SettingsViewModelClass, sTemplate, sLabelName, sRoute]); }; /** @@ -122,7 +122,7 @@ Plugins.prototype.runSettingsViewModelHooks = function (bAdmin) { - _.each(bAdmin ? this.aAdminViewModelsHooks : this.aViewModelsHooks, function (aView) { + _.each(bAdmin ? this.aAdminViewModelsHooks : this.aUserViewModelsHooks, function (aView) { require('Knoin/Knoin').addSettingsViewModel(aView[0], aView[1], aView[2], aView[3]); }); }; diff --git a/dev/Screen/User/Settings.js b/dev/Screen/User/Settings.js index 50bf00084..ecd5359fc 100644 --- a/dev/Screen/User/Settings.js +++ b/dev/Screen/User/Settings.js @@ -65,8 +65,11 @@ 'SettingsFilters', 'SETTINGS_LABELS/LABEL_FILTERS_NAME', 'filters'); } - kn.addSettingsViewModel(require('Settings/User/Security'), - 'SettingsSecurity', 'SETTINGS_LABELS/LABEL_SECURITY_NAME', 'security'); + if (Settings.capa(Enums.Capa.AutoLogout) || Settings.capa(Enums.Capa.TwoFactor)) + { + kn.addSettingsViewModel(require('Settings/User/Security'), + 'SettingsSecurity', 'SETTINGS_LABELS/LABEL_SECURITY_NAME', 'security'); + } if ((Settings.settingsGet('AllowGoogleSocial') && Settings.settingsGet('AllowGoogleSocialAuth')) || Settings.settingsGet('AllowFacebookSocial') || diff --git a/dev/Settings/User/Security.js b/dev/Settings/User/Security.js index e4f119a36..e5da546da 100644 --- a/dev/Settings/User/Security.js +++ b/dev/Settings/User/Security.js @@ -23,6 +23,7 @@ */ function SecurityUserSettings() { + this.capaAutoLogout = Settings.capa(Enums.Capa.AutoLogout); this.capaTwoFactor = Settings.capa(Enums.Capa.TwoFactor); this.autoLogout = SettinsStore.autoLogout; @@ -212,21 +213,24 @@ Remote.getTwoFactor(this.onResult); } - var self = this; + if (this.capaAutoLogout) + { + var self = this; - _.delay(function () { + _.delay(function () { - var - f0 = Utils.settingsSaveHelperSimpleFunction(self.autoLogout.trigger, self) - ; + var + f0 = Utils.settingsSaveHelperSimpleFunction(self.autoLogout.trigger, self) + ; - self.autoLogout.subscribe(function (sValue) { - Remote.saveSettings(f0, { - 'AutoLogout': Utils.pInt(sValue) + self.autoLogout.subscribe(function (sValue) { + Remote.saveSettings(f0, { + 'AutoLogout': Utils.pInt(sValue) + }); }); - }); - }); + }); + } }; module.exports = SecurityUserSettings; diff --git a/package.json b/package.json index fd80e98ee..f318da47c 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "RainLoop", "title": "RainLoop Webmail", "version": "1.8.1", - "release": "263", + "release": "266", "description": "Simple, modern & fast web-based email client", "homepage": "http://rainloop.net", "main": "gulpfile.js", @@ -36,7 +36,7 @@ "plugins" ], "readmeFilename": "README.md", - "ownCloudPackageVersion": "3.1", + "ownCloudPackageVersion": "3.2", "engines": { "node": ">= 0.10.0" }, diff --git a/rainloop/v/0.0.0/app/libraries/RainLoop/Actions.php b/rainloop/v/0.0.0/app/libraries/RainLoop/Actions.php index 75798510e..01e2d2b9d 100644 --- a/rainloop/v/0.0.0/app/libraries/RainLoop/Actions.php +++ b/rainloop/v/0.0.0/app/libraries/RainLoop/Actions.php @@ -1589,6 +1589,11 @@ class Actions $aResult['UseThreads'] = (bool) $oSettingsLocal->GetConf('UseThreads', $aResult['UseThreads']); $aResult['ReplySameFolder'] = (bool) $oSettingsLocal->GetConf('ReplySameFolder', $aResult['ReplySameFolder']); + if (!$this->GetCapa(false, \RainLoop\Enumerations\Capa::AUTOLOGOUT, $oAccount)) + { + $aResult['AutoLogout'] = 0; + } + if ($this->GetCapa(false, \RainLoop\Enumerations\Capa::USER_BACKGROUND, $oAccount)) { $aResult['UserBackgroundName'] = (string) $oSettings->GetConf('UserBackgroundName', $aResult['UserBackgroundName']); @@ -1644,7 +1649,7 @@ class Actions } $sPluginsLink = ''; - if (0 < $this->Plugins()->Count()) + if (0 < $this->Plugins()->Count() && $this->Plugins()->HaveJs($bAdmin)) { $sPluginsLink = './?/Plugins/0/'.($bAdmin ? 'Admin' : 'User').'/'.$sStaticCache.'/'; } @@ -7672,6 +7677,11 @@ class Actions $aResult[] = \RainLoop\Enumerations\Capa::OPEN_PGP; } + if (!\RainLoop\Utils::IsOwnCloud()) + { + $aResult[] = \RainLoop\Enumerations\Capa::AUTOLOGOUT; + } + return $aResult; } diff --git a/rainloop/v/0.0.0/app/libraries/RainLoop/Enumerations/Capa.php b/rainloop/v/0.0.0/app/libraries/RainLoop/Enumerations/Capa.php index 8a5cef54a..8cf16ca35 100644 --- a/rainloop/v/0.0.0/app/libraries/RainLoop/Enumerations/Capa.php +++ b/rainloop/v/0.0.0/app/libraries/RainLoop/Enumerations/Capa.php @@ -16,4 +16,5 @@ class Capa const ATTACHMENT_THUMBNAILS = 'ATTACHMENT_THUMBNAILS'; const ADDITIONAL_ACCOUNTS = 'ADDITIONAL_ACCOUNTS'; const TEMPLATES = 'TEMPLATES'; + const AUTOLOGOUT = 'AUTOLOGOUT'; } diff --git a/rainloop/v/0.0.0/app/libraries/RainLoop/Plugins/Manager.php b/rainloop/v/0.0.0/app/libraries/RainLoop/Plugins/Manager.php index e361381d4..a4ecfb7ca 100644 --- a/rainloop/v/0.0.0/app/libraries/RainLoop/Plugins/Manager.php +++ b/rainloop/v/0.0.0/app/libraries/RainLoop/Plugins/Manager.php @@ -222,6 +222,23 @@ class Manager return $sResult; } + /** + * @param bool $bAdminScope = false + * + * @return bool + */ + public function HaveJs($bAdminScope = false) + { + $bResult = false; + + if ($this->bIsEnabled) + { + $bResult = $bAdminScope ? 0 < \count($this->aAdminJs) : 0 < \count($this->aJs); + } + + return $bResult; + } + /** * @param bool $bAdminScope = false * diff --git a/rainloop/v/0.0.0/app/templates/Views/User/Login.html b/rainloop/v/0.0.0/app/templates/Views/User/Login.html index ec2c08e32..adef613d1 100644 --- a/rainloop/v/0.0.0/app/templates/Views/User/Login.html +++ b/rainloop/v/0.0.0/app/templates/Views/User/Login.html @@ -66,26 +66,18 @@
- - - - - - - - - - - - - - + + + + + +
-