AutoLogout always allowed

This commit is contained in:
the-djmaze 2022-10-27 16:05:28 +02:00
parent be8c453cac
commit dec2c1e84c
6 changed files with 5 additions and 19 deletions

View file

@ -41,9 +41,7 @@ export class SettingsUserScreen extends AbstractSettingsScreen {
views.push(UserSettingsFilters); views.push(UserSettingsFilters);
} }
if (SettingsCapa('AutoLogout') || SettingsCapa('OpenPGP') || SettingsCapa('GnuPG')) { views.push(UserSettingsSecurity);
views.push(UserSettingsSecurity);
}
views.push(UserSettingsFolders); views.push(UserSettingsFolders);

View file

@ -21,11 +21,8 @@ export class UserSettingsSecurity extends AbstractViewSettings {
constructor() { constructor() {
super(); super();
this.capaAutoLogout = SettingsCapa('AutoLogout');
this.autoLogout = SettingsUserStore.autoLogout;
let i18nLogout = (key, params) => i18n('SETTINGS_SECURITY/AUTOLOGIN_' + key, params); let i18nLogout = (key, params) => i18n('SETTINGS_SECURITY/AUTOLOGIN_' + key, params);
this.autoLogout = SettingsUserStore.autoLogout;
this.autoLogoutOptions = koComputable(() => { this.autoLogoutOptions = koComputable(() => {
translateTrigger(); translateTrigger();
return [ return [
@ -39,10 +36,7 @@ export class UserSettingsSecurity extends AbstractViewSettings {
{ id: 60 * 10, name: i18nLogout('HOURS_OPTION_NAME', { HOURS: 10 }) } { id: 60 * 10, name: i18nLogout('HOURS_OPTION_NAME', { HOURS: 10 }) }
]; ];
}); });
this.addSetting('AutoLogout');
if (this.capaAutoLogout) {
this.addSetting('AutoLogout');
}
this.gnupgPublicKeys = GnuPGUserStore.publicKeys; this.gnupgPublicKeys = GnuPGUserStore.publicKeys;
this.gnupgPrivateKeys = GnuPGUserStore.privateKeys; this.gnupgPrivateKeys = GnuPGUserStore.privateKeys;

View file

@ -57,7 +57,7 @@ export const SettingsUserStore = new class {
let iAutoLogoutTimer; let iAutoLogoutTimer;
self.delayLogout = (() => { self.delayLogout = (() => {
clearTimeout(iAutoLogoutTimer); clearTimeout(iAutoLogoutTimer);
if (0 < self.autoLogout() && !SettingsGet('AccountSignMe') && SettingsCapa('AutoLogout')) { if (0 < self.autoLogout() && !SettingsGet('AccountSignMe')) {
iAutoLogoutTimer = setTimeout( iAutoLogoutTimer = setTimeout(
rl.app.logout, rl.app.logout,
self.autoLogout() * 60000 self.autoLogout() * 60000

View file

@ -809,10 +809,6 @@ class Actions
$aResult['fontSerif'] = $oSettings->GetConf('fontSerif', ''); $aResult['fontSerif'] = $oSettings->GetConf('fontSerif', '');
$aResult['fontMono'] = $oSettings->GetConf('fontMono', ''); $aResult['fontMono'] = $oSettings->GetConf('fontMono', '');
if (!$this->GetCapa(Enumerations\Capa::AUTOLOGOUT)) {
$aResult['AutoLogout'] = 0;
}
if ($this->GetCapa(Enumerations\Capa::USER_BACKGROUND)) { if ($this->GetCapa(Enumerations\Capa::USER_BACKGROUND)) {
$aResult['UserBackgroundName'] = (string)$oSettings->GetConf('UserBackgroundName', $aResult['UserBackgroundName']); $aResult['UserBackgroundName'] = (string)$oSettings->GetConf('UserBackgroundName', $aResult['UserBackgroundName']);
$aResult['UserBackgroundHash'] = (string)$oSettings->GetConf('UserBackgroundHash', $aResult['UserBackgroundHash']); $aResult['UserBackgroundHash'] = (string)$oSettings->GetConf('UserBackgroundHash', $aResult['UserBackgroundHash']);
@ -1110,7 +1106,6 @@ class Actions
if (!$aResult) { if (!$aResult) {
$oConfig = $this->oConfig; $oConfig = $this->oConfig;
$aResult = array( $aResult = array(
'AutoLogout' => true,
'AdditionalAccounts' => (bool) $oConfig->Get('webmail', 'allow_additional_accounts', false), 'AdditionalAccounts' => (bool) $oConfig->Get('webmail', 'allow_additional_accounts', false),
'AttachmentThumbnails' => (bool) $oConfig->Get('interface', 'show_attachment_thumbnail', true), 'AttachmentThumbnails' => (bool) $oConfig->Get('interface', 'show_attachment_thumbnail', true),
'AttachmentsActions' => (bool) $oConfig->Get('capa', 'attachments_actions', false), 'AttachmentsActions' => (bool) $oConfig->Get('capa', 'attachments_actions', false),

View file

@ -17,5 +17,4 @@ class Capa
const MESSAGE_ACTIONS = 'MessageActions'; const MESSAGE_ACTIONS = 'MessageActions';
const ATTACHMENTS_ACTIONS = 'AttachmentsActions'; const ATTACHMENTS_ACTIONS = 'AttachmentsActions';
const DANGEROUS_ACTIONS = 'DangerousActions'; const DANGEROUS_ACTIONS = 'DangerousActions';
const AUTOLOGOUT = 'AutoLogout';
} }

View file

@ -1,4 +1,4 @@
<div class="form-horizontal" data-bind="visible: capaAutoLogout"> <div class="form-horizontal">
<div class="legend" data-i18n="SETTINGS_SECURITY/LEGEND_SECURITY"></div> <div class="legend" data-i18n="SETTINGS_SECURITY/LEGEND_SECURITY"></div>
<div class="control-group"> <div class="control-group">
<label data-i18n="SETTINGS_SECURITY/LABEL_AUTOLOGOUT"></label> <label data-i18n="SETTINGS_SECURITY/LABEL_AUTOLOGOUT"></label>