Small fixes

This commit is contained in:
RainLoop Team 2015-02-20 02:13:27 +04:00
parent cc6626c374
commit 276e8c48e8
10 changed files with 67 additions and 39 deletions

View file

@ -46,6 +46,7 @@
'Filters': 'FILTERS', 'Filters': 'FILTERS',
'AttachmentThumbnails': 'ATTACHMENT_THUMBNAILS', 'AttachmentThumbnails': 'ATTACHMENT_THUMBNAILS',
'Templates': 'TEMPLATES', 'Templates': 'TEMPLATES',
'AutoLogout': 'AUTOLOGOUT',
'AdditionalAccounts': 'ADDITIONAL_ACCOUNTS' 'AdditionalAccounts': 'ADDITIONAL_ACCOUNTS'
}; };

View file

@ -106,7 +106,7 @@
*/ */
Plugins.prototype.addSettingsViewModel = function (SettingsViewModelClass, sTemplate, sLabelName, sRoute) 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) 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]); require('Knoin/Knoin').addSettingsViewModel(aView[0], aView[1], aView[2], aView[3]);
}); });
}; };

View file

@ -65,8 +65,11 @@
'SettingsFilters', 'SETTINGS_LABELS/LABEL_FILTERS_NAME', 'filters'); 'SettingsFilters', 'SETTINGS_LABELS/LABEL_FILTERS_NAME', 'filters');
} }
kn.addSettingsViewModel(require('Settings/User/Security'), if (Settings.capa(Enums.Capa.AutoLogout) || Settings.capa(Enums.Capa.TwoFactor))
'SettingsSecurity', 'SETTINGS_LABELS/LABEL_SECURITY_NAME', 'security'); {
kn.addSettingsViewModel(require('Settings/User/Security'),
'SettingsSecurity', 'SETTINGS_LABELS/LABEL_SECURITY_NAME', 'security');
}
if ((Settings.settingsGet('AllowGoogleSocial') && Settings.settingsGet('AllowGoogleSocialAuth')) || if ((Settings.settingsGet('AllowGoogleSocial') && Settings.settingsGet('AllowGoogleSocialAuth')) ||
Settings.settingsGet('AllowFacebookSocial') || Settings.settingsGet('AllowFacebookSocial') ||

View file

@ -23,6 +23,7 @@
*/ */
function SecurityUserSettings() function SecurityUserSettings()
{ {
this.capaAutoLogout = Settings.capa(Enums.Capa.AutoLogout);
this.capaTwoFactor = Settings.capa(Enums.Capa.TwoFactor); this.capaTwoFactor = Settings.capa(Enums.Capa.TwoFactor);
this.autoLogout = SettinsStore.autoLogout; this.autoLogout = SettinsStore.autoLogout;
@ -212,21 +213,24 @@
Remote.getTwoFactor(this.onResult); Remote.getTwoFactor(this.onResult);
} }
var self = this; if (this.capaAutoLogout)
{
var self = this;
_.delay(function () { _.delay(function () {
var var
f0 = Utils.settingsSaveHelperSimpleFunction(self.autoLogout.trigger, self) f0 = Utils.settingsSaveHelperSimpleFunction(self.autoLogout.trigger, self)
; ;
self.autoLogout.subscribe(function (sValue) { self.autoLogout.subscribe(function (sValue) {
Remote.saveSettings(f0, { Remote.saveSettings(f0, {
'AutoLogout': Utils.pInt(sValue) 'AutoLogout': Utils.pInt(sValue)
});
}); });
});
}); });
}
}; };
module.exports = SecurityUserSettings; module.exports = SecurityUserSettings;

View file

@ -2,7 +2,7 @@
"name": "RainLoop", "name": "RainLoop",
"title": "RainLoop Webmail", "title": "RainLoop Webmail",
"version": "1.8.1", "version": "1.8.1",
"release": "263", "release": "266",
"description": "Simple, modern & fast web-based email client", "description": "Simple, modern & fast web-based email client",
"homepage": "http://rainloop.net", "homepage": "http://rainloop.net",
"main": "gulpfile.js", "main": "gulpfile.js",
@ -36,7 +36,7 @@
"plugins" "plugins"
], ],
"readmeFilename": "README.md", "readmeFilename": "README.md",
"ownCloudPackageVersion": "3.1", "ownCloudPackageVersion": "3.2",
"engines": { "engines": {
"node": ">= 0.10.0" "node": ">= 0.10.0"
}, },

View file

@ -1589,6 +1589,11 @@ class Actions
$aResult['UseThreads'] = (bool) $oSettingsLocal->GetConf('UseThreads', $aResult['UseThreads']); $aResult['UseThreads'] = (bool) $oSettingsLocal->GetConf('UseThreads', $aResult['UseThreads']);
$aResult['ReplySameFolder'] = (bool) $oSettingsLocal->GetConf('ReplySameFolder', $aResult['ReplySameFolder']); $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)) if ($this->GetCapa(false, \RainLoop\Enumerations\Capa::USER_BACKGROUND, $oAccount))
{ {
$aResult['UserBackgroundName'] = (string) $oSettings->GetConf('UserBackgroundName', $aResult['UserBackgroundName']); $aResult['UserBackgroundName'] = (string) $oSettings->GetConf('UserBackgroundName', $aResult['UserBackgroundName']);
@ -1644,7 +1649,7 @@ class Actions
} }
$sPluginsLink = ''; $sPluginsLink = '';
if (0 < $this->Plugins()->Count()) if (0 < $this->Plugins()->Count() && $this->Plugins()->HaveJs($bAdmin))
{ {
$sPluginsLink = './?/Plugins/0/'.($bAdmin ? 'Admin' : 'User').'/'.$sStaticCache.'/'; $sPluginsLink = './?/Plugins/0/'.($bAdmin ? 'Admin' : 'User').'/'.$sStaticCache.'/';
} }
@ -7672,6 +7677,11 @@ class Actions
$aResult[] = \RainLoop\Enumerations\Capa::OPEN_PGP; $aResult[] = \RainLoop\Enumerations\Capa::OPEN_PGP;
} }
if (!\RainLoop\Utils::IsOwnCloud())
{
$aResult[] = \RainLoop\Enumerations\Capa::AUTOLOGOUT;
}
return $aResult; return $aResult;
} }

View file

@ -16,4 +16,5 @@ class Capa
const ATTACHMENT_THUMBNAILS = 'ATTACHMENT_THUMBNAILS'; const ATTACHMENT_THUMBNAILS = 'ATTACHMENT_THUMBNAILS';
const ADDITIONAL_ACCOUNTS = 'ADDITIONAL_ACCOUNTS'; const ADDITIONAL_ACCOUNTS = 'ADDITIONAL_ACCOUNTS';
const TEMPLATES = 'TEMPLATES'; const TEMPLATES = 'TEMPLATES';
const AUTOLOGOUT = 'AUTOLOGOUT';
} }

View file

@ -222,6 +222,23 @@ class Manager
return $sResult; 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 * @param bool $bAdminScope = false
* *

View file

@ -66,26 +66,18 @@
</div> </div>
<div class="controls"> <div class="controls">
<div class="pull-right social-buttons"> <div class="pull-right social-buttons">
<span data-bind="visible: facebookLoginEnabled"> <a href="#" tabindex="-1" class="social-button" data-bind="visible: facebookLoginEnabled, command: facebookCommand, tooltip: 'LOGIN/TITLE_SIGN_IN_FACEBOOK'">
<a href="#" tabindex="-1" class="social-button" data-bind="command: facebookCommand, tooltip: 'LOGIN/TITLE_SIGN_IN_FACEBOOK'"> <i class="icon-facebook-alt"></i>
<i class="icon-facebook-alt"></i> </a>
</a> <a href="#" tabindex="-1" class="social-button" data-bind="visible: googleLoginEnabled, command: googleCommand, tooltip: 'LOGIN/TITLE_SIGN_IN_GOOGLE'">
</span> <i class="icon-google"></i>
<span data-bind="visible: googleLoginEnabled"> </a>
<a href="#" tabindex="-1" class="social-button" data-bind="command: googleCommand, tooltip: 'LOGIN/TITLE_SIGN_IN_GOOGLE'"> <a href="#" tabindex="-1" class="social-button" data-bind="visible: twitterLoginEnabled, command: twitterCommand, tooltip: 'LOGIN/TITLE_SIGN_IN_TWITTER'">
<i class="icon-google"></i> <i class="icon-twitter"></i>
</a> </a>
</span> <a href="#" tabindex="-1" class="language-button" data-bind="visible: allowLanguagesOnLogin() && !socialLoginEnabled(), click: selectLanguage, tooltip: 'POPUPS_LANGUAGES/TITLE_LANGUAGES'">
<span data-bind="visible: twitterLoginEnabled"> <i data-bind="css: langRequest() ? 'icon-spinner animated' : 'icon-world'"></i>
<a href="#" tabindex="-1" class="social-button" data-bind="command: twitterCommand, tooltip: 'LOGIN/TITLE_SIGN_IN_TWITTER'"> </a>
<i class="icon-twitter"></i>
</a>
</span>
<span data-bind="visible: allowLanguagesOnLogin() && !socialLoginEnabled()">
<a href="#" tabindex="-1" class="language-button" data-bind="click: selectLanguage, tooltip: 'POPUPS_LANGUAGES/TITLE_LANGUAGES'">
<i data-bind="css: langRequest() ? 'icon-spinner animated' : 'icon-world'"></i>
</a>
</span>
</div> </div>
<label class="signMeLabel inline" data-bind="click: function () { signMe(!signMe()); }, visible: signMeVisibility"> <label class="signMeLabel inline" data-bind="click: function () { signMe(!signMe()); }, visible: signMeVisibility">
<i data-bind="css: signMe() ? 'checkboxSignMe icon-checkbox-checked' : 'checkboxSignMe icon-checkbox-unchecked'"></i> <i data-bind="css: signMe() ? 'checkboxSignMe icon-checkbox-checked' : 'checkboxSignMe icon-checkbox-unchecked'"></i>

View file

@ -1,5 +1,5 @@
<div class="b-settings-security"> <div class="b-settings-security">
<div class="form-horizontal"> <div class="form-horizontal" data-bind="visible: capaAutoLogout">
<div class="legend"> <div class="legend">
<span class="i18n" data-i18n-text="SETTINGS_SECURITY/LEGEND_SECURITY"></span> <span class="i18n" data-i18n-text="SETTINGS_SECURITY/LEGEND_SECURITY"></span>
</div> </div>
@ -21,8 +21,8 @@
}"></div> }"></div>
</div> </div>
</div> </div>
<br />
</div> </div>
<br />
<div class="form-horizontal" data-bind="visible: capaTwoFactor"> <div class="form-horizontal" data-bind="visible: capaTwoFactor">
<div class="legend"> <div class="legend">
<span class="i18n" data-i18n-text="SETTINGS_SECURITY/LEGEND_TWO_FACTOR_AUTH"></span> <span class="i18n" data-i18n-text="SETTINGS_SECURITY/LEGEND_TWO_FACTOR_AUTH"></span>