mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-12-28 02:21:06 +08:00
Drop useless "disable settings screen"
This commit is contained in:
parent
8010229d6b
commit
3c8cdcbb07
10 changed files with 51 additions and 67 deletions
|
@ -892,8 +892,7 @@ class AppUser extends AbstractApp {
|
|||
|
||||
startScreens([
|
||||
MailBoxUserScreen,
|
||||
Settings.capa(Capa.Settings) ? SettingsUserScreen : null
|
||||
// false ? AboutUserScreen : null
|
||||
SettingsUserScreen
|
||||
]);
|
||||
this.hideLoading();
|
||||
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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)) {
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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),
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -42,13 +42,13 @@
|
|||
<span data-i18n="TOP_TOOLBAR/BUTTON_ADD_ACCOUNT"></span>
|
||||
</a>
|
||||
</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">
|
||||
<i class="fontastic">📇</i>
|
||||
<span data-i18n="GLOBAL/CONTACTS"></span>
|
||||
</a>
|
||||
</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">
|
||||
<i class="fontastic">⚙</i>
|
||||
<span data-i18n="TOP_TOOLBAR/BUTTON_SETTINGS"></span>
|
||||
|
|
Loading…
Reference in a new issue