From 3c8cdcbb078839ba0958896de48c988c4395a5fe Mon Sep 17 00:00:00 2001 From: djmaze Date: Thu, 23 Sep 2021 11:05:19 +0200 Subject: [PATCH] Drop useless "disable settings screen" --- dev/App/User.js | 3 +- dev/Common/Enums.js | 1 - dev/View/User/SystemDropDown.js | 3 +- .../0.0.0/app/libraries/RainLoop/Actions.php | 99 +++++++++---------- .../RainLoop/Actions/Localization.php | 1 - .../app/libraries/RainLoop/Actions/Themes.php | 1 - .../app/libraries/RainLoop/Actions/User.php | 4 - .../libraries/RainLoop/Config/Application.php | 1 - .../libraries/RainLoop/Enumerations/Capa.php | 1 - .../templates/Views/User/SystemDropDown.html | 4 +- 10 files changed, 51 insertions(+), 67 deletions(-) diff --git a/dev/App/User.js b/dev/App/User.js index 6cfd2f4a6..884245681 100644 --- a/dev/App/User.js +++ b/dev/App/User.js @@ -892,8 +892,7 @@ class AppUser extends AbstractApp { startScreens([ MailBoxUserScreen, - Settings.capa(Capa.Settings) ? SettingsUserScreen : null - // false ? AboutUserScreen : null + SettingsUserScreen ]); this.hideLoading(); diff --git a/dev/Common/Enums.js b/dev/Common/Enums.js index 53e935d3f..00dfddca9 100644 --- a/dev/Common/Enums.js +++ b/dev/Common/Enums.js @@ -12,7 +12,6 @@ export const Capa = { MessageActions: 'MESSAGE_ACTIONS', AttachmentsActions: 'ATTACHMENTS_ACTIONS', DangerousActions: 'DANGEROUS_ACTIONS', - Settings: 'SETTINGS', Themes: 'THEMES', UserBackground: 'USER_BACKGROUND', Sieve: 'SIEVE', diff --git a/dev/View/User/SystemDropDown.js b/dev/View/User/SystemDropDown.js index 671f7b9be..bcf4de763 100644 --- a/dev/View/User/SystemDropDown.js +++ b/dev/View/User/SystemDropDown.js @@ -21,7 +21,6 @@ export class SystemDropDownUserView extends AbstractViewRight { super('SystemDropDown'); this.allowAccounts = Settings.capa(Capa.AdditionalAccounts); - this.allowSettings = Settings.capa(Capa.Settings); this.accountEmail = AccountUserStore.email; @@ -58,7 +57,7 @@ export class SystemDropDownUserView extends AbstractViewRight { } settingsClick() { - this.allowSettings && rl.route.setHash(settings()); + rl.route.setHash(settings()); } settingsHelp() { diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php index 94fcfaad9..cb25763c9 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php @@ -1153,41 +1153,40 @@ class Actions $aResult['HideUnsubscribed'] = (bool)$oSettingsLocal->GetConf('HideUnsubscribed', $aResult['HideUnsubscribed']); } - if ($this->GetCapa(false, Enumerations\Capa::SETTINGS, $oAccount)) { - if ($oSettings instanceof Settings) { - if ($oConfig->Get('webmail', 'allow_languages_on_settings', true)) { - $sLanguage = (string)$oSettings->GetConf('Language', $sLanguage); - } - - $aResult['EditorDefaultType'] = (string)$oSettings->GetConf('EditorDefaultType', $aResult['EditorDefaultType']); - $aResult['ShowImages'] = (bool)$oSettings->GetConf('ShowImages', $aResult['ShowImages']); - $aResult['RemoveColors'] = (bool)$oSettings->GetConf('RemoveColors', $aResult['RemoveColors']); - $aResult['ContactsAutosave'] = (bool)$oSettings->GetConf('ContactsAutosave', $aResult['ContactsAutosave']); - $aResult['MPP'] = (int)$oSettings->GetConf('MPP', $aResult['MPP']); - $aResult['MessageReadDelay'] = (int)$oSettings->GetConf('MessageReadDelay', $aResult['MessageReadDelay']); - $aResult['SoundNotification'] = (bool)$oSettings->GetConf('SoundNotification', $aResult['SoundNotification']); - $aResult['NotificationSound'] = (string)$oSettings->GetConf('NotificationSound', $aResult['NotificationSound']); - $aResult['DesktopNotifications'] = (bool)$oSettings->GetConf('DesktopNotifications', $aResult['DesktopNotifications']); - $aResult['UseCheckboxesInList'] = (bool)$oSettings->GetConf('UseCheckboxesInList', $aResult['UseCheckboxesInList']); - $aResult['AllowDraftAutosave'] = (bool)$oSettings->GetConf('AllowDraftAutosave', $aResult['AllowDraftAutosave']); - $aResult['AutoLogout'] = (int)$oSettings->GetConf('AutoLogout', $aResult['AutoLogout']); - $aResult['Layout'] = (int)$oSettings->GetConf('Layout', $aResult['Layout']); - - if (!$this->GetCapa(false, Enumerations\Capa::AUTOLOGOUT, $oAccount)) { - $aResult['AutoLogout'] = 0; - } - - if ($this->GetCapa(false, Enumerations\Capa::USER_BACKGROUND, $oAccount)) { - $aResult['UserBackgroundName'] = (string)$oSettings->GetConf('UserBackgroundName', $aResult['UserBackgroundName']); - $aResult['UserBackgroundHash'] = (string)$oSettings->GetConf('UserBackgroundHash', $aResult['UserBackgroundHash']); - } + if ($oSettings instanceof Settings) { + if ($oConfig->Get('webmail', 'allow_languages_on_settings', true)) { + $sLanguage = (string)$oSettings->GetConf('Language', $sLanguage); } - if ($oSettingsLocal instanceof Settings) { - $aResult['UseThreads'] = (bool)$oSettingsLocal->GetConf('UseThreads', $aResult['UseThreads']); - $aResult['ReplySameFolder'] = (bool)$oSettingsLocal->GetConf('ReplySameFolder', $aResult['ReplySameFolder']); + $aResult['EditorDefaultType'] = (string)$oSettings->GetConf('EditorDefaultType', $aResult['EditorDefaultType']); + $aResult['ShowImages'] = (bool)$oSettings->GetConf('ShowImages', $aResult['ShowImages']); + $aResult['RemoveColors'] = (bool)$oSettings->GetConf('RemoveColors', $aResult['RemoveColors']); + $aResult['ContactsAutosave'] = (bool)$oSettings->GetConf('ContactsAutosave', $aResult['ContactsAutosave']); + $aResult['MPP'] = (int)$oSettings->GetConf('MPP', $aResult['MPP']); + $aResult['MessageReadDelay'] = (int)$oSettings->GetConf('MessageReadDelay', $aResult['MessageReadDelay']); + $aResult['SoundNotification'] = (bool)$oSettings->GetConf('SoundNotification', $aResult['SoundNotification']); + $aResult['NotificationSound'] = (string)$oSettings->GetConf('NotificationSound', $aResult['NotificationSound']); + $aResult['DesktopNotifications'] = (bool)$oSettings->GetConf('DesktopNotifications', $aResult['DesktopNotifications']); + $aResult['UseCheckboxesInList'] = (bool)$oSettings->GetConf('UseCheckboxesInList', $aResult['UseCheckboxesInList']); + $aResult['AllowDraftAutosave'] = (bool)$oSettings->GetConf('AllowDraftAutosave', $aResult['AllowDraftAutosave']); + $aResult['AutoLogout'] = (int)$oSettings->GetConf('AutoLogout', $aResult['AutoLogout']); + $aResult['Layout'] = (int)$oSettings->GetConf('Layout', $aResult['Layout']); + + if (!$this->GetCapa(false, Enumerations\Capa::AUTOLOGOUT, $oAccount)) { + $aResult['AutoLogout'] = 0; + } + + if ($this->GetCapa(false, Enumerations\Capa::USER_BACKGROUND, $oAccount)) { + $aResult['UserBackgroundName'] = (string)$oSettings->GetConf('UserBackgroundName', $aResult['UserBackgroundName']); + $aResult['UserBackgroundHash'] = (string)$oSettings->GetConf('UserBackgroundHash', $aResult['UserBackgroundHash']); } } + + if ($oSettingsLocal instanceof Settings) { + $aResult['UseThreads'] = (bool)$oSettingsLocal->GetConf('UseThreads', $aResult['UseThreads']); + $aResult['ReplySameFolder'] = (bool)$oSettingsLocal->GetConf('ReplySameFolder', $aResult['ReplySameFolder']); + } + $aResult['NewMailSounds'] = []; foreach (\glob(APP_VERSION_ROOT_PATH.'static/sounds/*.mp3') as $file) { $aResult['NewMailSounds'][] = \basename($file, '.mp3'); @@ -1913,32 +1912,28 @@ class Actions $aResult[] = Enumerations\Capa::QUOTA; } - if ($oConfig->Get('capa', 'settings', true)) { - $aResult[] = Enumerations\Capa::SETTINGS; + if ($oConfig->Get('webmail', 'allow_additional_accounts', false)) { + $aResult[] = Enumerations\Capa::ADDITIONAL_ACCOUNTS; + } - if ($oConfig->Get('webmail', 'allow_additional_accounts', false)) { - $aResult[] = Enumerations\Capa::ADDITIONAL_ACCOUNTS; - } + if ($oConfig->Get('webmail', 'allow_additional_identities', false)) { + $aResult[] = Enumerations\Capa::IDENTITIES; + } - if ($oConfig->Get('webmail', 'allow_additional_identities', false)) { - $aResult[] = Enumerations\Capa::IDENTITIES; - } + if ($oConfig->Get('webmail', 'allow_themes', false)) { + $aResult[] = Enumerations\Capa::THEMES; + } - if ($oConfig->Get('webmail', 'allow_themes', false)) { - $aResult[] = Enumerations\Capa::THEMES; - } + if ($oConfig->Get('webmail', 'allow_user_background', false)) { + $aResult[] = Enumerations\Capa::USER_BACKGROUND; + } - if ($oConfig->Get('webmail', 'allow_user_background', false)) { - $aResult[] = Enumerations\Capa::USER_BACKGROUND; - } + if ($oConfig->Get('security', 'openpgp', false)) { + $aResult[] = Enumerations\Capa::OPEN_PGP; + } - if ($oConfig->Get('security', 'openpgp', false)) { - $aResult[] = Enumerations\Capa::OPEN_PGP; - } - - if ($bAdmin || ($oAccount && $oAccount->Domain()->UseSieve())) { - $aResult[] = Enumerations\Capa::SIEVE; - } + if ($bAdmin || ($oAccount && $oAccount->Domain()->UseSieve())) { + $aResult[] = Enumerations\Capa::SIEVE; } if ($oConfig->Get('capa', 'attachments_actions', false)) { diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Localization.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Localization.php index 1c49e0374..58a979b97 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Localization.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Localization.php @@ -13,7 +13,6 @@ trait Localization $sLanguage = $oConfig->Get('webmail', 'language', 'en'); if ($oAccount = $this->getAccountFromToken(false)) { if ($oConfig->Get('webmail', 'allow_languages_on_settings', true) - && $this->GetCapa(false, \RainLoop\Enumerations\Capa::SETTINGS, $oAccount) && ($oSettings = $this->SettingsProvider()->Load($oAccount))) { $sLanguage = $oSettings->GetConf('Language', $sLanguage); } diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Themes.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Themes.php index a8b46be07..ca10fca57 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Themes.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Themes.php @@ -13,7 +13,6 @@ trait Themes $sTheme = $this->Config()->Get('webmail', 'theme', 'Default'); if (!$bAdmin && ($oAccount = $this->getAccountFromToken(false)) - && $this->GetCapa(false, \RainLoop\Enumerations\Capa::SETTINGS, $oAccount) && $this->GetCapa(false, \RainLoop\Enumerations\Capa::THEMES, $oAccount) && ($oSettingsLocal = $this->SettingsProvider(true)->Load($oAccount))) { $sTheme = (string) $oSettingsLocal->GetConf('Theme', $sTheme); diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/User.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/User.php index 68ee0e6a4..9bdd69d15 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/User.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/User.php @@ -297,10 +297,6 @@ trait User public function DoSettingsUpdate() : array { $oAccount = $this->getAccountFromToken(); - if (!$this->GetCapa(false, Capa::SETTINGS, $oAccount)) - { - return $this->FalseResponse(__FUNCTION__); - } $self = $this; $oConfig = $this->Config(); diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Config/Application.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Config/Application.php index b7866f1ad..9a12da826 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Config/Application.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Config/Application.php @@ -187,7 +187,6 @@ class Application extends \RainLoop\Config\AbstractConfig 'capa' => array( 'contacts' => array(true), - 'settings' => array(true), 'quota' => array(true), 'search' => array(true), 'search_adv' => array(true), diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Enumerations/Capa.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Enumerations/Capa.php index a8f61045e..158736f0d 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Enumerations/Capa.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Enumerations/Capa.php @@ -15,7 +15,6 @@ class Capa const CONTACTS = 'CONTACTS'; const SEARCH = 'SEARCH'; const SEARCH_ADV = 'SEARCH_ADV'; - const SETTINGS = 'SETTINGS'; const QUOTA = 'QUOTA'; const TEMPLATES = 'TEMPLATES'; const MESSAGE_ACTIONS = 'MESSAGE_ACTIONS'; diff --git a/snappymail/v/0.0.0/app/templates/Views/User/SystemDropDown.html b/snappymail/v/0.0.0/app/templates/Views/User/SystemDropDown.html index 6d57fca2b..8d7f6fa6d 100644 --- a/snappymail/v/0.0.0/app/templates/Views/User/SystemDropDown.html +++ b/snappymail/v/0.0.0/app/templates/Views/User/SystemDropDown.html @@ -42,13 +42,13 @@ - -