Drop useless "disable settings screen"

This commit is contained in:
djmaze 2021-09-23 11:05:19 +02:00
parent 8010229d6b
commit 3c8cdcbb07
10 changed files with 51 additions and 67 deletions

View file

@ -892,8 +892,7 @@ class AppUser extends AbstractApp {
startScreens([ startScreens([
MailBoxUserScreen, MailBoxUserScreen,
Settings.capa(Capa.Settings) ? SettingsUserScreen : null SettingsUserScreen
// false ? AboutUserScreen : null
]); ]);
this.hideLoading(); this.hideLoading();

View file

@ -12,7 +12,6 @@ export const Capa = {
MessageActions: 'MESSAGE_ACTIONS', MessageActions: 'MESSAGE_ACTIONS',
AttachmentsActions: 'ATTACHMENTS_ACTIONS', AttachmentsActions: 'ATTACHMENTS_ACTIONS',
DangerousActions: 'DANGEROUS_ACTIONS', DangerousActions: 'DANGEROUS_ACTIONS',
Settings: 'SETTINGS',
Themes: 'THEMES', Themes: 'THEMES',
UserBackground: 'USER_BACKGROUND', UserBackground: 'USER_BACKGROUND',
Sieve: 'SIEVE', Sieve: 'SIEVE',

View file

@ -21,7 +21,6 @@ export class SystemDropDownUserView extends AbstractViewRight {
super('SystemDropDown'); super('SystemDropDown');
this.allowAccounts = Settings.capa(Capa.AdditionalAccounts); this.allowAccounts = Settings.capa(Capa.AdditionalAccounts);
this.allowSettings = Settings.capa(Capa.Settings);
this.accountEmail = AccountUserStore.email; this.accountEmail = AccountUserStore.email;
@ -58,7 +57,7 @@ export class SystemDropDownUserView extends AbstractViewRight {
} }
settingsClick() { settingsClick() {
this.allowSettings && rl.route.setHash(settings()); rl.route.setHash(settings());
} }
settingsHelp() { settingsHelp() {

View file

@ -1153,41 +1153,40 @@ class Actions
$aResult['HideUnsubscribed'] = (bool)$oSettingsLocal->GetConf('HideUnsubscribed', $aResult['HideUnsubscribed']); $aResult['HideUnsubscribed'] = (bool)$oSettingsLocal->GetConf('HideUnsubscribed', $aResult['HideUnsubscribed']);
} }
if ($this->GetCapa(false, Enumerations\Capa::SETTINGS, $oAccount)) { if ($oSettings instanceof Settings) {
if ($oSettings instanceof Settings) { if ($oConfig->Get('webmail', 'allow_languages_on_settings', true)) {
if ($oConfig->Get('webmail', 'allow_languages_on_settings', true)) { $sLanguage = (string)$oSettings->GetConf('Language', $sLanguage);
$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 ($oSettingsLocal instanceof Settings) { $aResult['EditorDefaultType'] = (string)$oSettings->GetConf('EditorDefaultType', $aResult['EditorDefaultType']);
$aResult['UseThreads'] = (bool)$oSettingsLocal->GetConf('UseThreads', $aResult['UseThreads']); $aResult['ShowImages'] = (bool)$oSettings->GetConf('ShowImages', $aResult['ShowImages']);
$aResult['ReplySameFolder'] = (bool)$oSettingsLocal->GetConf('ReplySameFolder', $aResult['ReplySameFolder']); $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'] = []; $aResult['NewMailSounds'] = [];
foreach (\glob(APP_VERSION_ROOT_PATH.'static/sounds/*.mp3') as $file) { foreach (\glob(APP_VERSION_ROOT_PATH.'static/sounds/*.mp3') as $file) {
$aResult['NewMailSounds'][] = \basename($file, '.mp3'); $aResult['NewMailSounds'][] = \basename($file, '.mp3');
@ -1913,32 +1912,28 @@ class Actions
$aResult[] = Enumerations\Capa::QUOTA; $aResult[] = Enumerations\Capa::QUOTA;
} }
if ($oConfig->Get('capa', 'settings', true)) { if ($oConfig->Get('webmail', 'allow_additional_accounts', false)) {
$aResult[] = Enumerations\Capa::SETTINGS; $aResult[] = Enumerations\Capa::ADDITIONAL_ACCOUNTS;
}
if ($oConfig->Get('webmail', 'allow_additional_accounts', false)) { if ($oConfig->Get('webmail', 'allow_additional_identities', false)) {
$aResult[] = Enumerations\Capa::ADDITIONAL_ACCOUNTS; $aResult[] = Enumerations\Capa::IDENTITIES;
} }
if ($oConfig->Get('webmail', 'allow_additional_identities', false)) { if ($oConfig->Get('webmail', 'allow_themes', false)) {
$aResult[] = Enumerations\Capa::IDENTITIES; $aResult[] = Enumerations\Capa::THEMES;
} }
if ($oConfig->Get('webmail', 'allow_themes', false)) { if ($oConfig->Get('webmail', 'allow_user_background', false)) {
$aResult[] = Enumerations\Capa::THEMES; $aResult[] = Enumerations\Capa::USER_BACKGROUND;
} }
if ($oConfig->Get('webmail', 'allow_user_background', false)) { if ($oConfig->Get('security', 'openpgp', false)) {
$aResult[] = Enumerations\Capa::USER_BACKGROUND; $aResult[] = Enumerations\Capa::OPEN_PGP;
} }
if ($oConfig->Get('security', 'openpgp', false)) { if ($bAdmin || ($oAccount && $oAccount->Domain()->UseSieve())) {
$aResult[] = Enumerations\Capa::OPEN_PGP; $aResult[] = Enumerations\Capa::SIEVE;
}
if ($bAdmin || ($oAccount && $oAccount->Domain()->UseSieve())) {
$aResult[] = Enumerations\Capa::SIEVE;
}
} }
if ($oConfig->Get('capa', 'attachments_actions', false)) { if ($oConfig->Get('capa', 'attachments_actions', false)) {

View file

@ -13,7 +13,6 @@ trait Localization
$sLanguage = $oConfig->Get('webmail', 'language', 'en'); $sLanguage = $oConfig->Get('webmail', 'language', 'en');
if ($oAccount = $this->getAccountFromToken(false)) { if ($oAccount = $this->getAccountFromToken(false)) {
if ($oConfig->Get('webmail', 'allow_languages_on_settings', true) if ($oConfig->Get('webmail', 'allow_languages_on_settings', true)
&& $this->GetCapa(false, \RainLoop\Enumerations\Capa::SETTINGS, $oAccount)
&& ($oSettings = $this->SettingsProvider()->Load($oAccount))) { && ($oSettings = $this->SettingsProvider()->Load($oAccount))) {
$sLanguage = $oSettings->GetConf('Language', $sLanguage); $sLanguage = $oSettings->GetConf('Language', $sLanguage);
} }

View file

@ -13,7 +13,6 @@ trait Themes
$sTheme = $this->Config()->Get('webmail', 'theme', 'Default'); $sTheme = $this->Config()->Get('webmail', 'theme', 'Default');
if (!$bAdmin if (!$bAdmin
&& ($oAccount = $this->getAccountFromToken(false)) && ($oAccount = $this->getAccountFromToken(false))
&& $this->GetCapa(false, \RainLoop\Enumerations\Capa::SETTINGS, $oAccount)
&& $this->GetCapa(false, \RainLoop\Enumerations\Capa::THEMES, $oAccount) && $this->GetCapa(false, \RainLoop\Enumerations\Capa::THEMES, $oAccount)
&& ($oSettingsLocal = $this->SettingsProvider(true)->Load($oAccount))) { && ($oSettingsLocal = $this->SettingsProvider(true)->Load($oAccount))) {
$sTheme = (string) $oSettingsLocal->GetConf('Theme', $sTheme); $sTheme = (string) $oSettingsLocal->GetConf('Theme', $sTheme);

View file

@ -297,10 +297,6 @@ trait User
public function DoSettingsUpdate() : array public function DoSettingsUpdate() : array
{ {
$oAccount = $this->getAccountFromToken(); $oAccount = $this->getAccountFromToken();
if (!$this->GetCapa(false, Capa::SETTINGS, $oAccount))
{
return $this->FalseResponse(__FUNCTION__);
}
$self = $this; $self = $this;
$oConfig = $this->Config(); $oConfig = $this->Config();

View file

@ -187,7 +187,6 @@ class Application extends \RainLoop\Config\AbstractConfig
'capa' => array( 'capa' => array(
'contacts' => array(true), 'contacts' => array(true),
'settings' => array(true),
'quota' => array(true), 'quota' => array(true),
'search' => array(true), 'search' => array(true),
'search_adv' => array(true), 'search_adv' => array(true),

View file

@ -15,7 +15,6 @@ class Capa
const CONTACTS = 'CONTACTS'; const CONTACTS = 'CONTACTS';
const SEARCH = 'SEARCH'; const SEARCH = 'SEARCH';
const SEARCH_ADV = 'SEARCH_ADV'; const SEARCH_ADV = 'SEARCH_ADV';
const SETTINGS = 'SETTINGS';
const QUOTA = 'QUOTA'; const QUOTA = 'QUOTA';
const TEMPLATES = 'TEMPLATES'; const TEMPLATES = 'TEMPLATES';
const MESSAGE_ACTIONS = 'MESSAGE_ACTIONS'; const MESSAGE_ACTIONS = 'MESSAGE_ACTIONS';

View file

@ -42,13 +42,13 @@
<span data-i18n="TOP_TOOLBAR/BUTTON_ADD_ACCOUNT"></span> <span data-i18n="TOP_TOOLBAR/BUTTON_ADD_ACCOUNT"></span>
</a> </a>
</li> </li>
<li class="e-item" role="presentation" data-bind="visible: allowSettings && allowContacts"> <li class="e-item" role="presentation" data-bind="visible: allowContacts">
<a class="e-link menuitem" href="#" tabindex="-1" data-bind="click: contactsClick"> <a class="e-link menuitem" href="#" tabindex="-1" data-bind="click: contactsClick">
<i class="fontastic">📇</i> <i class="fontastic">📇</i>
<span data-i18n="GLOBAL/CONTACTS"></span> <span data-i18n="GLOBAL/CONTACTS"></span>
</a> </a>
</li> </li>
<li class="e-item" role="presentation" data-bind="visible: allowSettings"> <li class="e-item" role="presentation">
<a class="e-link menuitem" href="#" tabindex="-1" data-bind="click: settingsClick"> <a class="e-link menuitem" href="#" tabindex="-1" data-bind="click: settingsClick">
<i class="fontastic"></i> <i class="fontastic"></i>
<span data-i18n="TOP_TOOLBAR/BUTTON_SETTINGS"></span> <span data-i18n="TOP_TOOLBAR/BUTTON_SETTINGS"></span>