From ce2fb9d7f21f1af74e0b26b3617fb676846996b0 Mon Sep 17 00:00:00 2001 From: the-djmaze <> Date: Tue, 21 Feb 2023 10:22:59 +0100 Subject: [PATCH] Many AppData properties to JavaScript camelCase --- dev/App/User.js | 4 +- dev/Model/Message.js | 2 +- dev/Settings/Admin/Branding.js | 6 +- dev/Settings/Admin/Contacts.js | 2 +- dev/Settings/Admin/General.js | 4 +- dev/Settings/Admin/Login.js | 4 +- dev/Settings/Admin/Packages.js | 2 +- dev/Settings/Admin/Security.js | 2 +- dev/Settings/User/General.js | 4 +- dev/Sieve/View/Filter.js | 2 +- dev/Stores/Theme.js | 4 +- dev/View/Popup/Compose.js | 2 +- dev/View/User/Login.js | 8 +-- dev/boot.js | 2 +- .../0.0.0/app/libraries/RainLoop/Actions.php | 56 +++++++++++-------- .../app/libraries/RainLoop/Actions/User.php | 2 +- .../app/libraries/RainLoop/ActionsAdmin.php | 24 ++++---- .../libraries/RainLoop/Providers/Settings.php | 2 +- .../app/libraries/RainLoop/ServiceActions.php | 2 +- .../0.0.0/app/libraries/RainLoop/Settings.php | 10 +++- .../Views/Admin/AdminSettingsPackages.html | 4 +- 21 files changed, 82 insertions(+), 66 deletions(-) diff --git a/dev/App/User.js b/dev/App/User.js index da75c23eb..baf510850 100644 --- a/dev/App/User.js +++ b/dev/App/User.js @@ -268,13 +268,13 @@ export class AppUser extends AbstractApp { navigator.registerProtocolHandler?.( 'mailto', location.protocol + '//' + location.host + location.pathname + '?mailto&to=%s', - (SettingsGet('Title') || 'SnappyMail') + (SettingsGet('title') || 'SnappyMail') ); } catch (e) { console.error(e); } - setTimeout(() => mailToHelper(SettingsGet('MailToEmail')), 500); + setTimeout(() => mailToHelper(SettingsGet('mailToEmail')), 500); } else { this.logout(); } diff --git a/dev/Model/Message.js b/dev/Model/Message.js index 8e9db97c1..b13a18344 100644 --- a/dev/Model/Message.js +++ b/dev/Model/Message.js @@ -427,7 +427,7 @@ export class MessageModel extends AbstractModel { hasImages = true; }, attr = 'data-x-src', - src, useProxy = !!SettingsGet('UseLocalProxyForExternalImages'); + src, useProxy = !!SettingsGet('useLocalProxyForExternalImages'); body.querySelectorAll('img[' + attr + ']').forEach(node => { src = node.getAttribute(attr); if (isValid(src)) { diff --git a/dev/Settings/Admin/Branding.js b/dev/Settings/Admin/Branding.js index c8ad7aea1..52a673d46 100644 --- a/dev/Settings/Admin/Branding.js +++ b/dev/Settings/Admin/Branding.js @@ -3,8 +3,8 @@ import { AbstractViewSettings } from 'Knoin/AbstractViews'; export class AdminSettingsBranding extends AbstractViewSettings { constructor() { super(); - this.addSetting('Title'); - this.addSetting('LoadingDescription'); - this.addSetting('FaviconUrl'); + this.addSetting('title'); + this.addSetting('loadingDescription'); + this.addSetting('faviconUrl'); } } diff --git a/dev/Settings/Admin/Contacts.js b/dev/Settings/Admin/Contacts.js index ea2495624..4c42f047c 100644 --- a/dev/Settings/Admin/Contacts.js +++ b/dev/Settings/Admin/Contacts.js @@ -22,7 +22,7 @@ export class AdminSettingsContacts extends AbstractViewSettings { this.testContactsErrorMessage(''); }); - this.addSettings(['ContactsEnable','ContactsSync']); + this.addSettings(['contactsEnable','contactsSync']); addObservablesTo(this, { testing: false, diff --git a/dev/Settings/Admin/General.js b/dev/Settings/Admin/General.js index 44781aba0..52e08d714 100644 --- a/dev/Settings/Admin/General.js +++ b/dev/Settings/Admin/General.js @@ -33,7 +33,7 @@ export class AdminSettingsGeneral extends AbstractViewSettings { this.theme = ThemeStore.theme; this.themes = ThemeStore.themes; - this.addSettings(['AllowLanguagesOnSettings']); + this.addSettings(['allowLanguagesOnSettings']); addObservablesTo(this, { capaThemes: SettingsCapa('Themes'), @@ -60,7 +60,7 @@ export class AdminSettingsGeneral extends AbstractViewSettings { this.addSetting('AttachmentLimit'); this.addSetting('Theme', value => changeTheme(value, this.themeTrigger)); - this.uploadData = SettingsGet('PhpUploadSizes'); + this.uploadData = SettingsGet('phpUploadSizes'); this.uploadDataDesc = (this.uploadData?.upload_max_filesize || this.uploadData?.post_max_size) ? [ diff --git a/dev/Settings/Admin/Login.js b/dev/Settings/Admin/Login.js index 686607252..47da49bf8 100644 --- a/dev/Settings/Admin/Login.js +++ b/dev/Settings/Admin/Login.js @@ -3,7 +3,7 @@ import { AbstractViewSettings } from 'Knoin/AbstractViews'; export class AdminSettingsLogin extends AbstractViewSettings { constructor() { super(); - this.addSetting('LoginDefaultDomain'); - this.addSettings(['DetermineUserLanguage','DetermineUserDomain','AllowLanguagesOnLogin']); + this.addSetting('loginDefaultDomain'); + this.addSettings(['determineUserLanguage','determineUserDomain','allowLanguagesOnLogin']); } } diff --git a/dev/Settings/Admin/Packages.js b/dev/Settings/Admin/Packages.js index ef8b6ffa4..76286d5e6 100644 --- a/dev/Settings/Admin/Packages.js +++ b/dev/Settings/Admin/Packages.js @@ -15,7 +15,7 @@ export class AdminSettingsPackages extends AbstractViewSettings { constructor() { super(); - this.addSettings(['EnabledPlugins']); + this.addSettings(['pluginsEnable']); addObservablesTo(this, { packagesError: '' diff --git a/dev/Settings/Admin/Security.js b/dev/Settings/Admin/Security.js index 3b99c16ab..185ea0c77 100644 --- a/dev/Settings/Admin/Security.js +++ b/dev/Settings/Admin/Security.js @@ -10,7 +10,7 @@ export class AdminSettingsSecurity extends AbstractViewSettings { constructor() { super(); - this.addSettings(['UseLocalProxyForExternalImages']); + this.addSettings(['useLocalProxyForExternalImages']); this.weakPassword = rl.app.weakPassword; diff --git a/dev/Settings/User/General.js b/dev/Settings/User/General.js index 95f72d8a3..5c9914138 100644 --- a/dev/Settings/User/General.js +++ b/dev/Settings/User/General.js @@ -34,7 +34,7 @@ export class UserSettingsGeneral extends AbstractViewSettings { this.soundNotification = SMAudio.notifications; this.notificationSound = ko.observable(SettingsGet('NotificationSound')); - this.notificationSounds = ko.observableArray(SettingsGet('NewMailSounds')); + this.notificationSounds = ko.observableArray(SettingsGet('newMailSounds')); this.desktopNotification = NotificationUserStore.enabled; this.isDesktopNotificationAllowed = NotificationUserStore.allowed; @@ -48,7 +48,7 @@ export class UserSettingsGeneral extends AbstractViewSettings { 'useCheckboxesInList', 'listGrouped', 'useThreads', 'replySameFolder', 'msgDefaultAction', 'allowSpellcheck' ].forEach(name => this[name] = SettingsUserStore[name]); - this.allowLanguagesOnSettings = !!SettingsGet('AllowLanguagesOnSettings'); + this.allowLanguagesOnSettings = !!SettingsGet('allowLanguagesOnSettings'); this.languageTrigger = ko.observable(SaveSettingStatus.Idle); diff --git a/dev/Sieve/View/Filter.js b/dev/Sieve/View/Filter.js index d541a584e..98431cf9a 100644 --- a/dev/Sieve/View/Filter.js +++ b/dev/Sieve/View/Filter.js @@ -84,7 +84,7 @@ export class FilterPopupView extends rl.pluginPopupView { this.defaultOptionsAfterRender = defaultOptionsAfterRender; this.folderSelectList = koComputable(() => folderListOptionsBuilder( - [rl.settings.get('SieveAllowFileintoInbox') ? '' : 'INBOX'], + [rl.settings.get('sieveAllowFileintoInbox') ? '' : 'INBOX'], [['', '']], item => item?.localName() || '' ) diff --git a/dev/Stores/Theme.js b/dev/Stores/Theme.js index d641bc1d3..6914347a0 100644 --- a/dev/Stores/Theme.js +++ b/dev/Stores/Theme.js @@ -23,8 +23,8 @@ export const ThemeStore.themes(isArray(themes) ? themes : []); ThemeStore.theme(SettingsGet('Theme')); if (!ThemeStore.isMobile()) { - ThemeStore.userBackgroundName(SettingsGet('UserBackgroundName')); - ThemeStore.userBackgroundHash(SettingsGet('UserBackgroundHash')); + ThemeStore.userBackgroundName(SettingsGet('userBackgroundName')); + ThemeStore.userBackgroundHash(SettingsGet('userBackgroundHash')); } ThemeStore.fontSansSerif(SettingsGet('fontSansSerif')); ThemeStore.fontSerif(SettingsGet('fontSerif')); diff --git a/dev/View/Popup/Compose.js b/dev/View/Popup/Compose.js index 6d4df0db8..251019b0f 100644 --- a/dev/View/Popup/Compose.js +++ b/dev/View/Popup/Compose.js @@ -1292,7 +1292,7 @@ export class ComposePopupView extends AbstractViewPopup { */ let text = this.oEditor.getData(), encrypted = PgpUserStore.isEncrypted(text), - size = SettingsGet('PhpUploadSizes')['post_max_size'], + size = SettingsGet('phpUploadSizes')['post_max_size'], quota = pInt(size); switch (size.slice(-1)) { case 'G': quota *= 1024; // fallthrough diff --git a/dev/View/User/Login.js b/dev/View/User/Login.js index 02043f385..f2a389186 100644 --- a/dev/View/User/Login.js +++ b/dev/View/User/Login.js @@ -26,7 +26,7 @@ export class LoginUserView extends AbstractViewLogin { super(); addObservablesTo(this, { - loadingDesc: SettingsGet('LoadingDescription'), + loadingDesc: SettingsGet('loadingDescription'), email: SettingsGet('DevEmail'), password: SettingsGet('DevPassword'), @@ -44,7 +44,7 @@ export class LoginUserView extends AbstractViewLogin { signMeType: SignMeUnused }); - this.allowLanguagesOnLogin = !!SettingsGet('AllowLanguagesOnLogin'); + this.allowLanguagesOnLogin = !!SettingsGet('allowLanguagesOnLogin'); this.language = LanguageStore.language; this.languages = LanguageStore.languages; @@ -111,7 +111,7 @@ export class LoginUserView extends AbstractViewLogin { if (valid) { this.submitRequest(true); data.set('Language', this.bSendLanguage ? this.language() : ''); - data.set('SignMe', this.signMe() ? 1 : 0); + data.set('signMe', this.signMe() ? 1 : 0); Remote.request('Login', (iError, oData) => { fireEvent('sm-user-login-response', { @@ -142,7 +142,7 @@ export class LoginUserView extends AbstractViewLogin { onBuild(dom) { super.onBuild(dom); - const signMe = (SettingsGet('SignMe') || '').toLowerCase(); + const signMe = (SettingsGet('signMe') || '').toLowerCase(); switch (signMe) { case 'defaultoff': diff --git a/dev/boot.js b/dev/boot.js index b8a626a2e..6e7d8e31e 100644 --- a/dev/boot.js +++ b/dev/boot.js @@ -58,7 +58,7 @@ window.rl = { }, setTitle: title => - doc.title = (title || '') + (RL_APP_DATA.Title ? (title ? ' - ' : '') + RL_APP_DATA.Title : ''), + doc.title = (title || '') + (RL_APP_DATA.title ? (title ? ' - ' : '') + RL_APP_DATA.title : ''), initData: appData => { RL_APP_DATA = appData; 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 94f0e1034..48924f28a 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php @@ -610,8 +610,8 @@ class Actions $aResult = array( 'Auth' => false, - 'Title' => $oConfig->Get('webmail', 'title', 'SnappyMail Webmail'), - 'LoadingDescription' => $oConfig->Get('webmail', 'loading_description', 'SnappyMail'), + 'title' => $oConfig->Get('webmail', 'title', 'SnappyMail Webmail'), + 'loadingDescription' => $oConfig->Get('webmail', 'loading_description', 'SnappyMail'), 'Plugins' => array(), 'System' => \array_merge( array( @@ -626,7 +626,7 @@ class Actions 'adminAllowed' => (bool)$oConfig->Get('security', 'allow_admin_panel', true) ) : array() ), - 'AllowLanguagesOnLogin' => (bool) $oConfig->Get('login', 'allow_languages_on_login', true) + 'allowLanguagesOnLogin' => (bool) $oConfig->Get('login', 'allow_languages_on_login', true) ); $sLanguage = $oConfig->Get('webmail', 'language', 'en'); @@ -637,16 +637,16 @@ class Actions if ($aResult['Auth']) { $aResult['AdminLogin'] = (string)$oConfig->Get('security', 'admin_login', ''); $aResult['AdminTOTP'] = (string)$oConfig->Get('security', 'admin_totp', ''); - $aResult['EnabledPlugins'] = (bool)$oConfig->Get('plugins', 'enable', false); + $aResult['pluginsEnable'] = (bool)$oConfig->Get('plugins', 'enable', false); - $aResult['LoginDefaultDomain'] = $oConfig->Get('login', 'default_domain', ''); - $aResult['DetermineUserLanguage'] = (bool)$oConfig->Get('login', 'determine_user_language', true); - $aResult['DetermineUserDomain'] = (bool)$oConfig->Get('login', 'determine_user_domain', false); + $aResult['loginDefaultDomain'] = $oConfig->Get('login', 'default_domain', ''); + $aResult['determineUserLanguage'] = (bool)$oConfig->Get('login', 'determine_user_language', true); + $aResult['determineUserDomain'] = (bool)$oConfig->Get('login', 'determine_user_domain', false); $aResult['supportedPdoDrivers'] = \RainLoop\Common\PdoAbstract::getAvailableDrivers(); - $aResult['ContactsEnable'] = (bool)$oConfig->Get('contacts', 'enable', false); - $aResult['ContactsSync'] = (bool)$oConfig->Get('contacts', 'allow_sync', false); + $aResult['contactsEnable'] = (bool)$oConfig->Get('contacts', 'enable', false); + $aResult['contactsSync'] = (bool)$oConfig->Get('contacts', 'allow_sync', false); $aResult['ContactsPdoType'] = Providers\AddressBook\PdoAddressBook::validPdoType($this->oConfig->Get('contacts', 'type', 'sqlite')); $aResult['ContactsPdoDsn'] = (string)$oConfig->Get('contacts', 'pdo_dsn', ''); $aResult['ContactsPdoType'] = (string)$oConfig->Get('contacts', 'type', ''); @@ -654,7 +654,7 @@ class Actions $aResult['ContactsPdoPassword'] = static::APP_DUMMY; $aResult['ContactsSuggestionsLimit'] = (int)$oConfig->Get('contacts', 'suggestions_limit', 20); - $aResult['FaviconUrl'] = $oConfig->Get('webmail', 'favicon_url', ''); + $aResult['faviconUrl'] = $oConfig->Get('webmail', 'favicon_url', ''); $aResult['WeakPassword'] = \is_file(APP_PRIVATE_DATA.'admin_password.txt'); @@ -681,7 +681,6 @@ class Actions 'AccountHash' => $oAccount->Hash(), 'AccountSignMe' => isset($_COOKIE[self::AUTH_SIGN_ME_TOKEN_KEY]), 'MainEmail' => \MailSo\Base\Utils::IdnToUtf8($this->getMainAccountFromToken()->Email()), - 'MailToEmail' => '', 'ContactsIsAllowed' => $this->AddressBookProvider($oAccount)->IsActive(), @@ -714,9 +713,7 @@ class Actions 'ShowUnreadCount' => false, 'UnhideKolabFolders' => false, 'CheckMailInterval' => 15, - 'UserBackgroundName' => '', - 'UserBackgroundHash' => '', - 'SieveAllowFileintoInbox' => (bool)$oConfig->Get('labs', 'sieve_allow_fileinto_inbox', false) + 'sieveAllowFileintoInbox' => (bool)$oConfig->Get('labs', 'sieve_allow_fileinto_inbox', false) ]); $aAttachmentsActions = array(); @@ -753,7 +750,7 @@ class Actions $mMailToData = Utils::DecodeKeyValuesQ($sToken); if (!empty($mMailToData['MailTo']) && 'MailTo' === $mMailToData['MailTo'] && !empty($mMailToData['To'])) { - $aResult['MailToEmail'] = \MailSo\Base\Utils::IdnToUtf8($mMailToData['To']); + $aResult['mailToEmail'] = \MailSo\Base\Utils::IdnToUtf8($mMailToData['To']); } } @@ -764,6 +761,14 @@ class Actions // MainAccount or AdditionalAccount $oSettingsLocal = $this->SettingsProvider(true)->Load($oAccount); if ($oSettingsLocal instanceof Settings) { +/* + foreach ($oSettingsLocal->toArray() as $key => $value) { + $aResult[\lcfirst($key)] = $value; + } + $aResult['junkFolder'] = $aResult['spamFolder']; + unset($aResult['checkableFolder']); + unset($aResult['theme']); +*/ $aResult['SentFolder'] = (string)$oSettingsLocal->GetConf('SentFolder', ''); $aResult['DraftsFolder'] = (string)$oSettingsLocal->GetConf('DraftFolder', ''); $aResult['JunkFolder'] = (string)$oSettingsLocal->GetConf('SpamFolder', ''); @@ -781,6 +786,11 @@ class Actions // MainAccount $oSettings = $this->SettingsProvider()->Load($oAccount); if ($oSettings instanceof Settings) { +/* + foreach ($oSettings->toArray() as $key => $value) { + $aResult[\lcfirst($key)] = $value; + } +*/ if ($oConfig->Get('webmail', 'allow_languages_on_settings', true)) { $sLanguage = (string) $oSettings->GetConf('Language', $sLanguage); } @@ -830,14 +840,14 @@ class Actions $aResult['fontMono'] = $oSettings->GetConf('fontMono', ''); if ($this->GetCapa(Enumerations\Capa::USER_BACKGROUND)) { - $aResult['UserBackgroundName'] = (string)$oSettings->GetConf('UserBackgroundName', $aResult['UserBackgroundName']); - $aResult['UserBackgroundHash'] = (string)$oSettings->GetConf('UserBackgroundHash', $aResult['UserBackgroundHash']); + $aResult['userBackgroundName'] = (string)$oSettings->GetConf('UserBackgroundName', $aResult['UserBackgroundName']); + $aResult['userBackgroundHash'] = (string)$oSettings->GetConf('UserBackgroundHash', $aResult['UserBackgroundHash']); } } - $aResult['NewMailSounds'] = []; + $aResult['newMailSounds'] = []; foreach (\glob(APP_VERSION_ROOT_PATH.'static/sounds/*.mp3') as $file) { - $aResult['NewMailSounds'][] = \basename($file, '.mp3'); + $aResult['newMailSounds'][] = \basename($file, '.mp3'); } } else { @@ -853,13 +863,13 @@ class Actions $aResult['DevPassword'] = ''; } - $aResult['SignMe'] = (string) $oConfig->Get('login', 'sign_me_auto', Enumerations\SignMeType::DEFAULT_OFF); + $aResult['signMe'] = (string) $oConfig->Get('login', 'sign_me_auto', Enumerations\SignMeType::DEFAULT_OFF); } } if ($aResult['Auth']) { - $aResult['UseLocalProxyForExternalImages'] = (bool)$oConfig->Get('labs', 'use_local_proxy_for_external_images', false); - $aResult['AllowLanguagesOnSettings'] = (bool) $oConfig->Get('webmail', 'allow_languages_on_settings', true); + $aResult['useLocalProxyForExternalImages'] = (bool)$oConfig->Get('labs', 'use_local_proxy_for_external_images', false); + $aResult['allowLanguagesOnSettings'] = (bool) $oConfig->Get('webmail', 'allow_languages_on_settings', true); $aResult['Capa'] = $this->Capa($bAdmin, $oAccount); $value = \ini_get('upload_max_filesize'); $upload_max_filesize = \intval($value); @@ -869,7 +879,7 @@ class Actions case 'K': $upload_max_filesize *= 1024; } $aResult['AttachmentLimit'] = \min($upload_max_filesize, ((int) $oConfig->Get('webmail', 'attachment_size_limit', 10)) * 1024 * 1024); - $aResult['PhpUploadSizes'] = array( + $aResult['phpUploadSizes'] = array( 'upload_max_filesize' => $value, 'post_max_size' => \ini_get('post_max_size') ); 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 b42276e2a..45266f4b4 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 @@ -36,7 +36,7 @@ trait User { $sEmail = \MailSo\Base\Utils::Trim($this->GetActionParam('Email', '')); $sPassword = $this->GetActionParam('Password', ''); - $bSignMe = !empty($this->GetActionParam('SignMe', 0)); + $bSignMe = !empty($this->GetActionParam('signMe', 0)); $this->Logger()->AddSecret($sPassword); diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/ActionsAdmin.php b/snappymail/v/0.0.0/app/libraries/RainLoop/ActionsAdmin.php index 7097cf106..a6ac6586b 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/ActionsAdmin.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/ActionsAdmin.php @@ -60,16 +60,16 @@ class ActionsAdmin extends Actions return $self->ValidateTheme($sTheme); }); - $this->setConfigFromParams($oConfig, 'UseLocalProxyForExternalImages', 'labs', 'use_local_proxy_for_external_images', 'bool'); + $this->setConfigFromParams($oConfig, 'useLocalProxyForExternalImages', 'labs', 'use_local_proxy_for_external_images', 'bool'); - $this->setConfigFromParams($oConfig, 'AllowLanguagesOnSettings', 'webmail', 'allow_languages_on_settings', 'bool'); - $this->setConfigFromParams($oConfig, 'AllowLanguagesOnLogin', 'login', 'allow_languages_on_login', 'bool'); + $this->setConfigFromParams($oConfig, 'allowLanguagesOnSettings', 'webmail', 'allow_languages_on_settings', 'bool'); + $this->setConfigFromParams($oConfig, 'allowLanguagesOnLogin', 'login', 'allow_languages_on_login', 'bool'); $this->setConfigFromParams($oConfig, 'AttachmentLimit', 'webmail', 'attachment_size_limit', 'int'); - $this->setConfigFromParams($oConfig, 'LoginDefaultDomain', 'login', 'default_domain', 'string'); + $this->setConfigFromParams($oConfig, 'loginDefaultDomain', 'login', 'default_domain', 'string'); - $this->setConfigFromParams($oConfig, 'ContactsEnable', 'contacts', 'enable', 'bool'); - $this->setConfigFromParams($oConfig, 'ContactsSync', 'contacts', 'allow_sync', 'bool'); + $this->setConfigFromParams($oConfig, 'contactsEnable', 'contacts', 'enable', 'bool'); + $this->setConfigFromParams($oConfig, 'contactsSync', 'contacts', 'allow_sync', 'bool'); $this->setConfigFromParams($oConfig, 'ContactsPdoDsn', 'contacts', 'pdo_dsn', 'string'); $this->setConfigFromParams($oConfig, 'ContactsPdoUser', 'contacts', 'pdo_user', 'string'); $this->setConfigFromParams($oConfig, 'ContactsPdoPassword', 'contacts', 'pdo_password', 'dummy'); @@ -86,14 +86,14 @@ class ActionsAdmin extends Actions $this->setConfigFromParams($oConfig, 'CapaUserBackground', 'webmail', 'allow_user_background', 'bool'); $this->setConfigFromParams($oConfig, 'CapaOpenPGP', 'security', 'openpgp', 'bool'); - $this->setConfigFromParams($oConfig, 'DetermineUserLanguage', 'login', 'determine_user_language', 'bool'); - $this->setConfigFromParams($oConfig, 'DetermineUserDomain', 'login', 'determine_user_domain', 'bool'); + $this->setConfigFromParams($oConfig, 'determineUserLanguage', 'login', 'determine_user_language', 'bool'); + $this->setConfigFromParams($oConfig, 'determineUserDomain', 'login', 'determine_user_domain', 'bool'); - $this->setConfigFromParams($oConfig, 'Title', 'webmail', 'title', 'string'); - $this->setConfigFromParams($oConfig, 'LoadingDescription', 'webmail', 'loading_description', 'string'); - $this->setConfigFromParams($oConfig, 'FaviconUrl', 'webmail', 'favicon_url', 'string'); + $this->setConfigFromParams($oConfig, 'title', 'webmail', 'title', 'string'); + $this->setConfigFromParams($oConfig, 'loadingDescription', 'webmail', 'loading_description', 'string'); + $this->setConfigFromParams($oConfig, 'faviconUrl', 'webmail', 'favicon_url', 'string'); - $this->setConfigFromParams($oConfig, 'EnabledPlugins', 'plugins', 'enable', 'bool'); + $this->setConfigFromParams($oConfig, 'pluginsEnable', 'plugins', 'enable', 'bool'); return $this->DefaultResponse($oConfig->Save()); } diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Providers/Settings.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Providers/Settings.php index d913b36da..822c689c3 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Providers/Settings.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Providers/Settings.php @@ -21,7 +21,7 @@ class Settings extends \RainLoop\Providers\AbstractProvider public function Save(\RainLoop\Model\Account $oAccount, \RainLoop\Settings $oSettings) : bool { - return $this->oDriver->Save($oAccount, $oSettings->DataAsArray()); + return $this->oDriver->Save($oAccount, $oSettings->toArray()); } public function IsActive() : bool diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/ServiceActions.php b/snappymail/v/0.0.0/app/libraries/RainLoop/ServiceActions.php index 7163b1cb7..80d8b9b04 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/ServiceActions.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/ServiceActions.php @@ -638,7 +638,7 @@ class ServiceActions $this->Logger()->Write($sResult, \LOG_INFO, 'APPDATA'); return $sResult; } catch (\Throwable $oException) { - $self->Logger()->WriteExceptionShort($oException); + $this->Logger()->WriteExceptionShort($oException); \MailSo\Base\Http::StatusHeader(500); return $oException->getMessage(); } diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Settings.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Settings.php index f1e8c4683..c4c0d544b 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Settings.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Settings.php @@ -2,7 +2,7 @@ namespace RainLoop; -class Settings +class Settings implements \JsonSerializable { /** * @var array @@ -14,11 +14,17 @@ class Settings $this->aData = $aData; } - public function DataAsArray() : array + public function toArray() : array { return $this->aData; } + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return $this->aData;; + } + /** * @param mixed $mDefValue = null * diff --git a/snappymail/v/0.0.0/app/templates/Views/Admin/AdminSettingsPackages.html b/snappymail/v/0.0.0/app/templates/Views/Admin/AdminSettingsPackages.html index 96f289b6a..b9bc9e544 100644 --- a/snappymail/v/0.0.0/app/templates/Views/Admin/AdminSettingsPackages.html +++ b/snappymail/v/0.0.0/app/templates/Views/Admin/AdminSettingsPackages.html @@ -15,7 +15,7 @@