mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
More JSON properties to JavaScript camelCase
This commit is contained in:
parent
07f6b7545a
commit
d1823af111
21 changed files with 83 additions and 80 deletions
|
|
@ -27,7 +27,7 @@ export class AdminApp extends AbstractApp {
|
|||
rl.route.root();
|
||||
setTimeout(() => location.href = '/', 1);
|
||||
} else if (SettingsGet('Auth')) {
|
||||
this.weakPassword(SettingsGet('WeakPassword'));
|
||||
this.weakPassword(SettingsGet('weakPassword'));
|
||||
startScreens([SettingsAdminScreen]);
|
||||
} else {
|
||||
startScreens([LoginAdminScreen]);
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ export class AppUser extends AbstractApp {
|
|||
? items.map(oValue => new AccountModel(oValue.email, oValue.name))
|
||||
: []
|
||||
);
|
||||
AccountUserStore.unshift(new AccountModel(SettingsGet('MainEmail'), '', false));
|
||||
AccountUserStore.unshift(new AccountModel(SettingsGet('mainEmail'), '', false));
|
||||
|
||||
items = oData.Result.Identities;
|
||||
IdentityUserStore(isArray(items)
|
||||
|
|
@ -204,7 +204,7 @@ export class AppUser extends AbstractApp {
|
|||
|
||||
refresh() {
|
||||
ThemeStore.populate();
|
||||
LanguageStore.language(SettingsGet('Language'));
|
||||
LanguageStore.language(SettingsGet('language'));
|
||||
changeTheme(SettingsGet('Theme'));
|
||||
this.start();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ export const
|
|||
*/
|
||||
serverRequestRaw = (type, hash) =>
|
||||
BASE + '?/Raw/' + SUB_QUERY_PREFIX + '/'
|
||||
+ '0/' // Settings.get('AccountHash') ?
|
||||
+ '0/' // Settings.get('accountHash') ?
|
||||
+ (type
|
||||
? type + '/' + (hash ? SUB_QUERY_PREFIX + '/' + hash : '')
|
||||
: ''),
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ class RemoteUserFetch extends AbstractFetchRemote {
|
|||
|
||||
let sGetAdd = '';
|
||||
if (folderETag) {
|
||||
params.hash = folderETag + '-' + SettingsGet('AccountHash');
|
||||
params.hash = folderETag + '-' + SettingsGet('accountHash');
|
||||
sGetAdd = 'MessageList/' + SUB_QUERY_PREFIX + '/' + b64EncodeJSONSafe(params);
|
||||
params = {};
|
||||
}
|
||||
|
|
@ -77,7 +77,7 @@ class RemoteUserFetch extends AbstractFetchRemote {
|
|||
sFolderFullName,
|
||||
iUid,
|
||||
AppUserStore.threadsAllowed() && SettingsUserStore.useThreads() ? 1 : 0,
|
||||
SettingsGet('AccountHash')
|
||||
SettingsGet('accountHash')
|
||||
])
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -13,10 +13,10 @@ export class AdminSettingsContacts extends AbstractViewSettings {
|
|||
super();
|
||||
this.defaultOptionsAfterRender = defaultOptionsAfterRender;
|
||||
|
||||
this.addSetting('ContactsPdoDsn');
|
||||
this.addSetting('ContactsPdoUser');
|
||||
this.addSetting('ContactsPdoPassword');
|
||||
this.addSetting('ContactsPdoType', () => {
|
||||
this.addSetting('contactsPdoDsn');
|
||||
this.addSetting('contactsPdoUser');
|
||||
this.addSetting('contactsPdoPassword');
|
||||
this.addSetting('contactsPdoType', () => {
|
||||
this.testContactsSuccess(false);
|
||||
this.testContactsError(false);
|
||||
this.testContactsErrorMessage('');
|
||||
|
|
@ -31,7 +31,7 @@ export class AdminSettingsContacts extends AbstractViewSettings {
|
|||
testContactsErrorMessage: ''
|
||||
});
|
||||
|
||||
this.addSetting('ContactsSuggestionsLimit');
|
||||
this.addSetting('contactsSuggestionsLimit');
|
||||
|
||||
const supportedTypes = SettingsGet('supportedPdoDrivers') || [],
|
||||
types = [{
|
||||
|
|
@ -92,10 +92,10 @@ export class AdminSettingsContacts extends AbstractViewSettings {
|
|||
|
||||
this.testing(false);
|
||||
}, {
|
||||
ContactsPdoType: this.contactsPdoType(),
|
||||
ContactsPdoDsn: this.contactsPdoDsn(),
|
||||
ContactsPdoUser: this.contactsPdoUser(),
|
||||
ContactsPdoPassword: this.contactsPdoPassword()
|
||||
contactsPdoType: this.contactsPdoType(),
|
||||
contactsPdoDsn: this.contactsPdoDsn(),
|
||||
contactsPdoUser: this.contactsPdoUser(),
|
||||
contactsPdoPassword: this.contactsPdoPassword()
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ export class AdminSettingsGeneral extends AbstractViewSettings {
|
|||
|
||||
const aLanguagesAdmin = Settings.app('languagesAdmin');
|
||||
this.languagesAdmin = ko.observableArray(isArray(aLanguagesAdmin) ? aLanguagesAdmin : []);
|
||||
this.languageAdmin = ko.observable(SettingsGet('LanguageAdmin'));
|
||||
this.languageAdmin = ko.observable(SettingsGet('languageAdmin'));
|
||||
|
||||
this.theme = ThemeStore.theme;
|
||||
this.themes = ThemeStore.themes;
|
||||
|
|
@ -53,11 +53,11 @@ export class AdminSettingsGeneral extends AbstractViewSettings {
|
|||
*/
|
||||
|
||||
this.attachmentLimit = ko
|
||||
.observable(SettingsGet('AttachmentLimit') / (1024 * 1024))
|
||||
.observable(SettingsGet('attachmentLimit') / (1024 * 1024))
|
||||
.extend({ debounce: 500 });
|
||||
|
||||
this.addSetting('Language');
|
||||
this.addSetting('AttachmentLimit');
|
||||
this.addSetting('language');
|
||||
this.addSetting('attachmentLimit');
|
||||
this.addSetting('Theme', value => changeTheme(value, this.themeTrigger));
|
||||
|
||||
this.uploadData = SettingsGet('phpUploadSizes');
|
||||
|
|
@ -91,7 +91,7 @@ export class AdminSettingsGeneral extends AbstractViewSettings {
|
|||
this.languageAdminTrigger(SaveSettingStatus.Saving);
|
||||
translatorReload(value, 1)
|
||||
.then(fReloadLanguageHelper(SaveSettingStatus.Success), fReloadLanguageHelper(SaveSettingStatus.Failed))
|
||||
.then(() => Remote.saveSetting('LanguageAdmin', value));
|
||||
.then(() => Remote.saveSetting('languageAdmin', value));
|
||||
},
|
||||
|
||||
capaAdditionalAccounts: fSaveHelper('CapaAdditionalAccounts'),
|
||||
|
|
@ -114,7 +114,7 @@ export class AdminSettingsGeneral extends AbstractViewSettings {
|
|||
showScreenPopup(LanguagesPopupView, [
|
||||
this.languageAdmin,
|
||||
this.languagesAdmin(),
|
||||
SettingsGet('UserLanguageAdmin')
|
||||
SettingsGet('languageUsers')
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ export class AdminSettingsSecurity extends AbstractViewSettings {
|
|||
this.weakPassword = rl.app.weakPassword;
|
||||
|
||||
addObservablesTo(this, {
|
||||
adminLogin: SettingsGet('AdminLogin'),
|
||||
adminLogin: SettingsGet('adminLogin'),
|
||||
adminLoginError: false,
|
||||
adminPassword: '',
|
||||
adminPasswordNew: '',
|
||||
|
|
@ -68,7 +68,7 @@ export class AdminSettingsSecurity extends AbstractViewSettings {
|
|||
capaOpenPGP: value => Remote.saveSetting('CapaOpenPGP', value)
|
||||
});
|
||||
|
||||
this.adminTOTP(SettingsGet('AdminTOTP'));
|
||||
this.adminTOTP(SettingsGet('adminTOTP'));
|
||||
|
||||
decorateKoCommands(this, {
|
||||
saveAdminUserCommand: self => self.adminLogin().trim() && self.adminPassword()
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ export class UserSettingsAccounts /*extends AbstractViewSettings*/ {
|
|||
this.accounts = AccountUserStore;
|
||||
this.loading = AccountUserStore.loading;
|
||||
this.identities = IdentityUserStore;
|
||||
this.mainEmail = SettingsGet('MainEmail');
|
||||
this.mainEmail = SettingsGet('mainEmail');
|
||||
|
||||
this.accountForDeletion = ko.observable(null).askDeleteHelper();
|
||||
this.identityForDeletion = ko.observable(null).askDeleteHelper();
|
||||
|
|
@ -88,7 +88,7 @@ export class UserSettingsAccounts /*extends AbstractViewSettings*/ {
|
|||
|
||||
accountsAndIdentitiesAfterMove() {
|
||||
Remote.request('AccountsAndIdentitiesSortOrder', null, {
|
||||
Accounts: AccountUserStore.getEmailAddresses().filter(v => v != SettingsGet('MainEmail')),
|
||||
Accounts: AccountUserStore.getEmailAddresses().filter(v => v != SettingsGet('mainEmail')),
|
||||
Identities: IdentityUserStore.map(item => (item ? item.id() : ""))
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ export class UserSettingsGeneral extends AbstractViewSettings {
|
|||
this.languageTrigger(SaveSettingStatus.Saving);
|
||||
translatorReload(value)
|
||||
.then(fReloadLanguageHelper(SaveSettingStatus.Success), fReloadLanguageHelper(SaveSettingStatus.Failed))
|
||||
.then(() => Remote.saveSetting('Language', value));
|
||||
.then(() => Remote.saveSetting('language', value));
|
||||
},
|
||||
|
||||
hourCycle: value =>
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@ export const LanguageStore = {
|
|||
populate: function() {
|
||||
const aLanguages = Settings.app('languages');
|
||||
this.languages(isArray(aLanguages) ? aLanguages : []);
|
||||
this.language(SettingsGet('Language'));
|
||||
this.userLanguage(SettingsGet('UserLanguage'));
|
||||
this.language(SettingsGet('language'));
|
||||
this.userLanguage(SettingsGet('userLanguage'));
|
||||
this.hourCycle(SettingsGet('hourCycle'));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { addObservablesTo } from 'External/ko';
|
|||
import { ThemeStore } from 'Stores/Theme';
|
||||
|
||||
export const AppUserStore = {
|
||||
allowContacts: () => !!SettingsGet('ContactsIsAllowed')
|
||||
allowContacts: () => !!SettingsGet('contactsAllowed')
|
||||
};
|
||||
|
||||
addObservablesTo(AppUserStore, {
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ export const SettingsUserStore = new class {
|
|||
let iAutoLogoutTimer;
|
||||
self.delayLogout = (() => {
|
||||
clearTimeout(iAutoLogoutTimer);
|
||||
if (0 < self.autoLogout() && !SettingsGet('AccountSignMe')) {
|
||||
if (0 < self.autoLogout() && !SettingsGet('accountSignMe')) {
|
||||
iAutoLogoutTimer = setTimeout(
|
||||
rl.app.logout,
|
||||
self.autoLogout() * 60000
|
||||
|
|
|
|||
|
|
@ -1005,7 +1005,7 @@ export class ComposePopupView extends AbstractViewPopup {
|
|||
clickElement: dom.querySelector('#composeUploadButton'),
|
||||
dragAndDropElement: dom.querySelector('.b-attachment-place')
|
||||
}),
|
||||
attachmentSizeLimit = pInt(SettingsGet('AttachmentLimit'));
|
||||
attachmentSizeLimit = pInt(SettingsGet('attachmentLimit'));
|
||||
|
||||
oJua
|
||||
.on('onDragEnter', () => {
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ export class LoginUserView extends AbstractViewLogin {
|
|||
|
||||
if (valid) {
|
||||
this.submitRequest(true);
|
||||
data.set('Language', this.bSendLanguage ? this.language() : '');
|
||||
data.set('language', this.bSendLanguage ? this.language() : '');
|
||||
data.set('signMe', this.signMe() ? 1 : 0);
|
||||
Remote.request('Login',
|
||||
(iError, oData) => {
|
||||
|
|
|
|||
|
|
@ -635,8 +635,8 @@ class Actions
|
|||
if ($bAdmin) {
|
||||
$aResult['Auth'] = $this->IsAdminLoggined(false);
|
||||
if ($aResult['Auth']) {
|
||||
$aResult['AdminLogin'] = (string)$oConfig->Get('security', 'admin_login', '');
|
||||
$aResult['AdminTOTP'] = (string)$oConfig->Get('security', 'admin_totp', '');
|
||||
$aResult['adminLogin'] = (string)$oConfig->Get('security', 'admin_login', '');
|
||||
$aResult['adminTOTP'] = (string)$oConfig->Get('security', 'admin_totp', '');
|
||||
$aResult['pluginsEnable'] = (bool)$oConfig->Get('plugins', 'enable', false);
|
||||
|
||||
$aResult['loginDefaultDomain'] = $oConfig->Get('login', 'default_domain', '');
|
||||
|
|
@ -647,20 +647,20 @@ class Actions
|
|||
|
||||
$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', '');
|
||||
$aResult['ContactsPdoUser'] = (string)$oConfig->Get('contacts', 'pdo_user', '');
|
||||
$aResult['ContactsPdoPassword'] = static::APP_DUMMY;
|
||||
$aResult['ContactsSuggestionsLimit'] = (int)$oConfig->Get('contacts', 'suggestions_limit', 20);
|
||||
$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', '');
|
||||
$aResult['contactsPdoUser'] = (string)$oConfig->Get('contacts', 'pdo_user', '');
|
||||
$aResult['contactsPdoPassword'] = static::APP_DUMMY;
|
||||
$aResult['contactsSuggestionsLimit'] = (int)$oConfig->Get('contacts', 'suggestions_limit', 20);
|
||||
|
||||
$aResult['faviconUrl'] = $oConfig->Get('webmail', 'favicon_url', '');
|
||||
|
||||
$aResult['WeakPassword'] = \is_file(APP_PRIVATE_DATA.'admin_password.txt');
|
||||
$aResult['weakPassword'] = \is_file(APP_PRIVATE_DATA.'admin_password.txt');
|
||||
|
||||
$aResult['System']['languagesAdmin'] = \SnappyMail\L10n::getLanguages(true);
|
||||
$aResult['LanguageAdmin'] = $this->ValidateLanguage($oConfig->Get('webmail', 'language_admin', 'en'), '', true);
|
||||
$aResult['UserLanguageAdmin'] = $this->ValidateLanguage($UserLanguageRaw, '', true, true);
|
||||
$aResult['languageAdmin'] = $this->ValidateLanguage($oConfig->Get('webmail', 'language_admin', 'en'), '', true);
|
||||
$aResult['languageUsers'] = $this->ValidateLanguage($UserLanguageRaw, '', true, true);
|
||||
} else {
|
||||
$passfile = APP_PRIVATE_DATA.'admin_password.txt';
|
||||
$sPassword = $oConfig->Get('security', 'admin_password', '');
|
||||
|
|
@ -678,11 +678,11 @@ class Actions
|
|||
$aResult = \array_merge($aResult, [
|
||||
'Auth' => true,
|
||||
'Email' => \MailSo\Base\Utils::IdnToUtf8($oAccount->Email()),
|
||||
'AccountHash' => $oAccount->Hash(),
|
||||
'AccountSignMe' => isset($_COOKIE[self::AUTH_SIGN_ME_TOKEN_KEY]),
|
||||
'MainEmail' => \MailSo\Base\Utils::IdnToUtf8($this->getMainAccountFromToken()->Email()),
|
||||
'accountHash' => $oAccount->Hash(),
|
||||
'accountSignMe' => isset($_COOKIE[self::AUTH_SIGN_ME_TOKEN_KEY]),
|
||||
'mainEmail' => \MailSo\Base\Utils::IdnToUtf8($this->getMainAccountFromToken()->Email()),
|
||||
|
||||
'ContactsIsAllowed' => $this->AddressBookProvider($oAccount)->IsActive(),
|
||||
'contactsAllowed' => $this->AddressBookProvider($oAccount)->IsActive(),
|
||||
|
||||
'ViewHTML' => (bool) $oConfig->Get('defaults', 'view_html', true),
|
||||
'ViewImages' => 'ask',
|
||||
|
|
@ -732,7 +732,7 @@ class Actions
|
|||
)
|
||||
);
|
||||
|
||||
if ($aResult['ContactsIsAllowed'] && $oConfig->Get('contacts', 'allow_sync', false)) {
|
||||
if ($aResult['contactsAllowed'] && $oConfig->Get('contacts', 'allow_sync', false)) {
|
||||
$aData = $this->getContactsSyncData($oAccount) ?: [
|
||||
'Mode' => 0,
|
||||
'Url' => '',
|
||||
|
|
@ -792,7 +792,7 @@ class Actions
|
|||
}
|
||||
*/
|
||||
if ($oConfig->Get('webmail', 'allow_languages_on_settings', true)) {
|
||||
$sLanguage = (string) $oSettings->GetConf('Language', $sLanguage);
|
||||
$sLanguage = (string) $oSettings->GetConf('language', $sLanguage);
|
||||
}
|
||||
$aResult['hourCycle'] = $oSettings->GetConf('hourCycle', '');
|
||||
|
||||
|
|
@ -840,8 +840,8 @@ 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['userBackgroundHash'] = (string)$oSettings->GetConf('UserBackgroundHash', '');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -878,7 +878,7 @@ class Actions
|
|||
case 'M': $upload_max_filesize *= 1024;
|
||||
case 'K': $upload_max_filesize *= 1024;
|
||||
}
|
||||
$aResult['AttachmentLimit'] = \min($upload_max_filesize, ((int) $oConfig->Get('webmail', 'attachment_size_limit', 10)) * 1024 * 1024);
|
||||
$aResult['attachmentLimit'] = \min($upload_max_filesize, ((int) $oConfig->Get('webmail', 'attachment_size_limit', 10)) * 1024 * 1024);
|
||||
$aResult['phpUploadSizes'] = array(
|
||||
'upload_max_filesize' => $value,
|
||||
'post_max_size' => \ini_get('post_max_size')
|
||||
|
|
@ -888,8 +888,8 @@ class Actions
|
|||
|
||||
$aResult['Theme'] = $this->GetTheme($bAdmin);
|
||||
|
||||
$aResult['Language'] = $this->ValidateLanguage($sLanguage, '', false);
|
||||
$aResult['UserLanguage'] = $this->ValidateLanguage($UserLanguageRaw, '', false, true);
|
||||
$aResult['language'] = $this->ValidateLanguage($sLanguage, '', false);
|
||||
$aResult['userLanguage'] = $this->ValidateLanguage($UserLanguageRaw, '', false, true);
|
||||
|
||||
$aResult['PluginsLink'] = $this->oPlugins->HaveJs($bAdmin)
|
||||
? 'Plugins/0/' . ($bAdmin ? 'Admin' : 'User') . '/' . $this->StaticCache() . '/'
|
||||
|
|
|
|||
|
|
@ -202,10 +202,10 @@ trait Accounts
|
|||
if ($this->switchAccount(\trim($this->GetActionParam('Email', '')))) {
|
||||
$oAccount = $this->getAccountFromToken();
|
||||
$aResult['Email'] = $oAccount->Email();
|
||||
$aResult['AccountHash'] = $oAccount->Hash();
|
||||
$aResult['MainEmail'] = ($oAccount instanceof AdditionalAccount)
|
||||
$aResult['accountHash'] = $oAccount->Hash();
|
||||
$aResult['mainEmail'] = ($oAccount instanceof AdditionalAccount)
|
||||
? $oAccount->ParentEmail() : '';
|
||||
$aResult['ContactsIsAllowed'] = $this->AddressBookProvider($oAccount)->IsActive();
|
||||
$aResult['contactsAllowed'] = $this->AddressBookProvider($oAccount)->IsActive();
|
||||
$oSettingsLocal = $this->SettingsProvider(true)->Load($oAccount);
|
||||
if ($oSettingsLocal instanceof \RainLoop\Settings) {
|
||||
$oConfig = $this->Config();
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ trait Localization
|
|||
if ($oAccount = $this->getAccountFromToken(false)) {
|
||||
if ($oConfig->Get('webmail', 'allow_languages_on_settings', true)
|
||||
&& ($oSettings = $this->SettingsProvider()->Load($oAccount))) {
|
||||
$sLanguage = $oSettings->GetConf('Language', $sLanguage);
|
||||
$sLanguage = $oSettings->GetConf('language', $sLanguage);
|
||||
}
|
||||
} else if ($oConfig->Get('login', 'allow_languages_on_login', true) && $oConfig->Get('login', 'determine_user_language', true)) {
|
||||
$sLanguage = $this->ValidateLanguage($this->detectUserLanguage($bAdmin), $sLanguage, false);
|
||||
|
|
|
|||
|
|
@ -51,15 +51,15 @@ trait User
|
|||
|
||||
$this->Plugins()->RunHook('login.success', array($oAccount));
|
||||
|
||||
$sLanguage = $this->GetActionParam('Language', '');
|
||||
$sLanguage = $this->GetActionParam('language', '');
|
||||
if ($oAccount && $sLanguage) {
|
||||
$oSettings = $this->SettingsProvider()->Load($oAccount);
|
||||
if ($oSettings) {
|
||||
$sLanguage = $this->ValidateLanguage($sLanguage);
|
||||
$sCurrentLanguage = $oSettings->GetConf('Language', '');
|
||||
$sCurrentLanguage = $oSettings->GetConf('language', '');
|
||||
|
||||
if ($sCurrentLanguage !== $sLanguage) {
|
||||
$oSettings->SetConf('Language', $sLanguage);
|
||||
$oSettings->SetConf('language', $sLanguage);
|
||||
$this->SettingsProvider()->Save($oAccount, $oSettings);
|
||||
}
|
||||
}
|
||||
|
|
@ -145,11 +145,11 @@ trait User
|
|||
$oSettingsLocal = $this->SettingsProvider(true)->Load($oAccount);
|
||||
|
||||
if ($oConfig->Get('webmail', 'allow_languages_on_settings', true)) {
|
||||
$this->setSettingsFromParams($oSettings, 'Language', 'string', function ($sLanguage) use ($self) {
|
||||
$this->setSettingsFromParams($oSettings, 'language', 'string', function ($sLanguage) use ($self) {
|
||||
return $self->ValidateLanguage($sLanguage);
|
||||
});
|
||||
} else {
|
||||
// $oSettings->SetConf('Language', $this->ValidateLanguage($oConfig->Get('webmail', 'language', 'en')));
|
||||
// $oSettings->SetConf('language', $this->ValidateLanguage($oConfig->Get('webmail', 'language', 'en')));
|
||||
}
|
||||
$this->setSettingsFromParams($oSettings, 'hourCycle', 'string');
|
||||
|
||||
|
|
|
|||
|
|
@ -48,11 +48,11 @@ class ActionsAdmin extends Actions
|
|||
|
||||
$self = $this;
|
||||
|
||||
$this->setConfigFromParams($oConfig, 'Language', 'webmail', 'language', 'string', function ($sLanguage) use ($self) {
|
||||
$this->setConfigFromParams($oConfig, 'language', 'webmail', 'language', 'string', function ($sLanguage) use ($self) {
|
||||
return $self->ValidateLanguage($sLanguage, '', false);
|
||||
});
|
||||
|
||||
$this->setConfigFromParams($oConfig, 'LanguageAdmin', 'webmail', 'language_admin', 'string', function ($sLanguage) use ($self) {
|
||||
$this->setConfigFromParams($oConfig, 'languageAdmin', 'webmail', 'language_admin', 'string', function ($sLanguage) use ($self) {
|
||||
return $self->ValidateLanguage($sLanguage, '', true);
|
||||
});
|
||||
|
||||
|
|
@ -64,18 +64,17 @@ class ActionsAdmin extends Actions
|
|||
|
||||
$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, 'attachmentLimit', 'webmail', 'attachment_size_limit', 'int');
|
||||
|
||||
$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, 'ContactsPdoDsn', 'contacts', 'pdo_dsn', 'string');
|
||||
$this->setConfigFromParams($oConfig, 'ContactsPdoUser', 'contacts', 'pdo_user', 'string');
|
||||
$this->setConfigFromParams($oConfig, 'ContactsPdoPassword', 'contacts', 'pdo_password', 'dummy');
|
||||
$this->setConfigFromParams($oConfig, 'ContactsSuggestionsLimit', 'contacts', 'suggestions_limit', 'int');
|
||||
|
||||
$this->setConfigFromParams($oConfig, 'ContactsPdoType', 'contacts', 'type', 'string', function ($sType) use ($self) {
|
||||
$this->setConfigFromParams($oConfig, 'contactsPdoDsn', 'contacts', 'pdo_dsn', 'string');
|
||||
$this->setConfigFromParams($oConfig, 'contactsPdoUser', 'contacts', 'pdo_user', 'string');
|
||||
$this->setConfigFromParams($oConfig, 'contactsPdoPassword', 'contacts', 'pdo_password', 'dummy');
|
||||
$this->setConfigFromParams($oConfig, 'contactsSuggestionsLimit', 'contacts', 'suggestions_limit', 'int');
|
||||
$this->setConfigFromParams($oConfig, 'contactsPdoType', 'contacts', 'type', 'string', function ($sType) use ($self) {
|
||||
return Providers\AddressBook\PdoAddressBook::validPdoType($sType);
|
||||
});
|
||||
|
||||
|
|
@ -142,10 +141,10 @@ class ActionsAdmin extends Actions
|
|||
$this->IsAdminLoggined();
|
||||
|
||||
$oConfig = $this->Config();
|
||||
$this->setConfigFromParams($oConfig, 'ContactsPdoDsn', 'contacts', 'pdo_dsn', 'string');
|
||||
$this->setConfigFromParams($oConfig, 'ContactsPdoUser', 'contacts', 'pdo_user', 'string');
|
||||
$this->setConfigFromParams($oConfig, 'ContactsPdoPassword', 'contacts', 'pdo_password', 'dummy');
|
||||
$this->setConfigFromParams($oConfig, 'ContactsPdoType', 'contacts', 'type', 'string', function ($sType) {
|
||||
$this->setConfigFromParams($oConfig, 'contactsPdoDsn', 'contacts', 'pdo_dsn', 'string');
|
||||
$this->setConfigFromParams($oConfig, 'contactsPdoUser', 'contacts', 'pdo_user', 'string');
|
||||
$this->setConfigFromParams($oConfig, 'contactsPdoPassword', 'contacts', 'pdo_password', 'dummy');
|
||||
$this->setConfigFromParams($oConfig, 'contactsPdoType', 'contacts', 'type', 'string', function ($sType) {
|
||||
return Providers\AddressBook\PdoAddressBook::validPdoType($sType);
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -578,14 +578,14 @@ class ServiceActions
|
|||
|
||||
$oSettings = $this->SettingsProvider()->Load($oAccount);
|
||||
if ($oSettings) {
|
||||
$sLanguage = isset($aAdditionalOptions['Language']) ?
|
||||
$aAdditionalOptions['Language'] : '';
|
||||
$sLanguage = isset($aAdditionalOptions['language']) ?
|
||||
$aAdditionalOptions['language'] : '';
|
||||
|
||||
if ($sLanguage) {
|
||||
$sLanguage = $this->oActions->ValidateLanguage($sLanguage);
|
||||
if ($sLanguage !== $oSettings->GetConf('Language', '')) {
|
||||
if ($sLanguage !== $oSettings->GetConf('language', '')) {
|
||||
$bNeedToSettings = true;
|
||||
$oSettings->SetConf('Language', $sLanguage);
|
||||
$oSettings->SetConf('language', $sLanguage);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,6 +14,10 @@ class Settings implements \JsonSerializable
|
|||
if (isset($aData['DraftFolder']) && !isset($aData['DraftsFolder'])) {
|
||||
$aData['DraftsFolder'] = $aData['DraftFolder'];
|
||||
}
|
||||
if (isset($aData['Language']) && !isset($aData['language'])) {
|
||||
$aData['language'] = $aData['Language'];
|
||||
unset($aData['Language']);
|
||||
}
|
||||
$this->aData = $aData;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue