mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Many AppData properties to JavaScript camelCase
This commit is contained in:
parent
c53d9adaba
commit
ce2fb9d7f2
21 changed files with 82 additions and 66 deletions
|
|
@ -268,13 +268,13 @@ export class AppUser extends AbstractApp {
|
||||||
navigator.registerProtocolHandler?.(
|
navigator.registerProtocolHandler?.(
|
||||||
'mailto',
|
'mailto',
|
||||||
location.protocol + '//' + location.host + location.pathname + '?mailto&to=%s',
|
location.protocol + '//' + location.host + location.pathname + '?mailto&to=%s',
|
||||||
(SettingsGet('Title') || 'SnappyMail')
|
(SettingsGet('title') || 'SnappyMail')
|
||||||
);
|
);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
setTimeout(() => mailToHelper(SettingsGet('MailToEmail')), 500);
|
setTimeout(() => mailToHelper(SettingsGet('mailToEmail')), 500);
|
||||||
} else {
|
} else {
|
||||||
this.logout();
|
this.logout();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -427,7 +427,7 @@ export class MessageModel extends AbstractModel {
|
||||||
hasImages = true;
|
hasImages = true;
|
||||||
},
|
},
|
||||||
attr = 'data-x-src',
|
attr = 'data-x-src',
|
||||||
src, useProxy = !!SettingsGet('UseLocalProxyForExternalImages');
|
src, useProxy = !!SettingsGet('useLocalProxyForExternalImages');
|
||||||
body.querySelectorAll('img[' + attr + ']').forEach(node => {
|
body.querySelectorAll('img[' + attr + ']').forEach(node => {
|
||||||
src = node.getAttribute(attr);
|
src = node.getAttribute(attr);
|
||||||
if (isValid(src)) {
|
if (isValid(src)) {
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,8 @@ import { AbstractViewSettings } from 'Knoin/AbstractViews';
|
||||||
export class AdminSettingsBranding extends AbstractViewSettings {
|
export class AdminSettingsBranding extends AbstractViewSettings {
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
this.addSetting('Title');
|
this.addSetting('title');
|
||||||
this.addSetting('LoadingDescription');
|
this.addSetting('loadingDescription');
|
||||||
this.addSetting('FaviconUrl');
|
this.addSetting('faviconUrl');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ export class AdminSettingsContacts extends AbstractViewSettings {
|
||||||
this.testContactsErrorMessage('');
|
this.testContactsErrorMessage('');
|
||||||
});
|
});
|
||||||
|
|
||||||
this.addSettings(['ContactsEnable','ContactsSync']);
|
this.addSettings(['contactsEnable','contactsSync']);
|
||||||
|
|
||||||
addObservablesTo(this, {
|
addObservablesTo(this, {
|
||||||
testing: false,
|
testing: false,
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ export class AdminSettingsGeneral extends AbstractViewSettings {
|
||||||
this.theme = ThemeStore.theme;
|
this.theme = ThemeStore.theme;
|
||||||
this.themes = ThemeStore.themes;
|
this.themes = ThemeStore.themes;
|
||||||
|
|
||||||
this.addSettings(['AllowLanguagesOnSettings']);
|
this.addSettings(['allowLanguagesOnSettings']);
|
||||||
|
|
||||||
addObservablesTo(this, {
|
addObservablesTo(this, {
|
||||||
capaThemes: SettingsCapa('Themes'),
|
capaThemes: SettingsCapa('Themes'),
|
||||||
|
|
@ -60,7 +60,7 @@ export class AdminSettingsGeneral extends AbstractViewSettings {
|
||||||
this.addSetting('AttachmentLimit');
|
this.addSetting('AttachmentLimit');
|
||||||
this.addSetting('Theme', value => changeTheme(value, this.themeTrigger));
|
this.addSetting('Theme', value => changeTheme(value, this.themeTrigger));
|
||||||
|
|
||||||
this.uploadData = SettingsGet('PhpUploadSizes');
|
this.uploadData = SettingsGet('phpUploadSizes');
|
||||||
this.uploadDataDesc =
|
this.uploadDataDesc =
|
||||||
(this.uploadData?.upload_max_filesize || this.uploadData?.post_max_size)
|
(this.uploadData?.upload_max_filesize || this.uploadData?.post_max_size)
|
||||||
? [
|
? [
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import { AbstractViewSettings } from 'Knoin/AbstractViews';
|
||||||
export class AdminSettingsLogin extends AbstractViewSettings {
|
export class AdminSettingsLogin extends AbstractViewSettings {
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
this.addSetting('LoginDefaultDomain');
|
this.addSetting('loginDefaultDomain');
|
||||||
this.addSettings(['DetermineUserLanguage','DetermineUserDomain','AllowLanguagesOnLogin']);
|
this.addSettings(['determineUserLanguage','determineUserDomain','allowLanguagesOnLogin']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ export class AdminSettingsPackages extends AbstractViewSettings {
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
this.addSettings(['EnabledPlugins']);
|
this.addSettings(['pluginsEnable']);
|
||||||
|
|
||||||
addObservablesTo(this, {
|
addObservablesTo(this, {
|
||||||
packagesError: ''
|
packagesError: ''
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ export class AdminSettingsSecurity extends AbstractViewSettings {
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
this.addSettings(['UseLocalProxyForExternalImages']);
|
this.addSettings(['useLocalProxyForExternalImages']);
|
||||||
|
|
||||||
this.weakPassword = rl.app.weakPassword;
|
this.weakPassword = rl.app.weakPassword;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ export class UserSettingsGeneral extends AbstractViewSettings {
|
||||||
|
|
||||||
this.soundNotification = SMAudio.notifications;
|
this.soundNotification = SMAudio.notifications;
|
||||||
this.notificationSound = ko.observable(SettingsGet('NotificationSound'));
|
this.notificationSound = ko.observable(SettingsGet('NotificationSound'));
|
||||||
this.notificationSounds = ko.observableArray(SettingsGet('NewMailSounds'));
|
this.notificationSounds = ko.observableArray(SettingsGet('newMailSounds'));
|
||||||
|
|
||||||
this.desktopNotification = NotificationUserStore.enabled;
|
this.desktopNotification = NotificationUserStore.enabled;
|
||||||
this.isDesktopNotificationAllowed = NotificationUserStore.allowed;
|
this.isDesktopNotificationAllowed = NotificationUserStore.allowed;
|
||||||
|
|
@ -48,7 +48,7 @@ export class UserSettingsGeneral extends AbstractViewSettings {
|
||||||
'useCheckboxesInList', 'listGrouped', 'useThreads', 'replySameFolder', 'msgDefaultAction', 'allowSpellcheck'
|
'useCheckboxesInList', 'listGrouped', 'useThreads', 'replySameFolder', 'msgDefaultAction', 'allowSpellcheck'
|
||||||
].forEach(name => this[name] = SettingsUserStore[name]);
|
].forEach(name => this[name] = SettingsUserStore[name]);
|
||||||
|
|
||||||
this.allowLanguagesOnSettings = !!SettingsGet('AllowLanguagesOnSettings');
|
this.allowLanguagesOnSettings = !!SettingsGet('allowLanguagesOnSettings');
|
||||||
|
|
||||||
this.languageTrigger = ko.observable(SaveSettingStatus.Idle);
|
this.languageTrigger = ko.observable(SaveSettingStatus.Idle);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,7 @@ export class FilterPopupView extends rl.pluginPopupView {
|
||||||
this.defaultOptionsAfterRender = defaultOptionsAfterRender;
|
this.defaultOptionsAfterRender = defaultOptionsAfterRender;
|
||||||
this.folderSelectList = koComputable(() =>
|
this.folderSelectList = koComputable(() =>
|
||||||
folderListOptionsBuilder(
|
folderListOptionsBuilder(
|
||||||
[rl.settings.get('SieveAllowFileintoInbox') ? '' : 'INBOX'],
|
[rl.settings.get('sieveAllowFileintoInbox') ? '' : 'INBOX'],
|
||||||
[['', '']],
|
[['', '']],
|
||||||
item => item?.localName() || ''
|
item => item?.localName() || ''
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -23,8 +23,8 @@ export const
|
||||||
ThemeStore.themes(isArray(themes) ? themes : []);
|
ThemeStore.themes(isArray(themes) ? themes : []);
|
||||||
ThemeStore.theme(SettingsGet('Theme'));
|
ThemeStore.theme(SettingsGet('Theme'));
|
||||||
if (!ThemeStore.isMobile()) {
|
if (!ThemeStore.isMobile()) {
|
||||||
ThemeStore.userBackgroundName(SettingsGet('UserBackgroundName'));
|
ThemeStore.userBackgroundName(SettingsGet('userBackgroundName'));
|
||||||
ThemeStore.userBackgroundHash(SettingsGet('UserBackgroundHash'));
|
ThemeStore.userBackgroundHash(SettingsGet('userBackgroundHash'));
|
||||||
}
|
}
|
||||||
ThemeStore.fontSansSerif(SettingsGet('fontSansSerif'));
|
ThemeStore.fontSansSerif(SettingsGet('fontSansSerif'));
|
||||||
ThemeStore.fontSerif(SettingsGet('fontSerif'));
|
ThemeStore.fontSerif(SettingsGet('fontSerif'));
|
||||||
|
|
|
||||||
|
|
@ -1292,7 +1292,7 @@ export class ComposePopupView extends AbstractViewPopup {
|
||||||
*/
|
*/
|
||||||
let text = this.oEditor.getData(),
|
let text = this.oEditor.getData(),
|
||||||
encrypted = PgpUserStore.isEncrypted(text),
|
encrypted = PgpUserStore.isEncrypted(text),
|
||||||
size = SettingsGet('PhpUploadSizes')['post_max_size'],
|
size = SettingsGet('phpUploadSizes')['post_max_size'],
|
||||||
quota = pInt(size);
|
quota = pInt(size);
|
||||||
switch (size.slice(-1)) {
|
switch (size.slice(-1)) {
|
||||||
case 'G': quota *= 1024; // fallthrough
|
case 'G': quota *= 1024; // fallthrough
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ export class LoginUserView extends AbstractViewLogin {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
addObservablesTo(this, {
|
addObservablesTo(this, {
|
||||||
loadingDesc: SettingsGet('LoadingDescription'),
|
loadingDesc: SettingsGet('loadingDescription'),
|
||||||
|
|
||||||
email: SettingsGet('DevEmail'),
|
email: SettingsGet('DevEmail'),
|
||||||
password: SettingsGet('DevPassword'),
|
password: SettingsGet('DevPassword'),
|
||||||
|
|
@ -44,7 +44,7 @@ export class LoginUserView extends AbstractViewLogin {
|
||||||
signMeType: SignMeUnused
|
signMeType: SignMeUnused
|
||||||
});
|
});
|
||||||
|
|
||||||
this.allowLanguagesOnLogin = !!SettingsGet('AllowLanguagesOnLogin');
|
this.allowLanguagesOnLogin = !!SettingsGet('allowLanguagesOnLogin');
|
||||||
|
|
||||||
this.language = LanguageStore.language;
|
this.language = LanguageStore.language;
|
||||||
this.languages = LanguageStore.languages;
|
this.languages = LanguageStore.languages;
|
||||||
|
|
@ -111,7 +111,7 @@ export class LoginUserView extends AbstractViewLogin {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.submitRequest(true);
|
this.submitRequest(true);
|
||||||
data.set('Language', this.bSendLanguage ? this.language() : '');
|
data.set('Language', this.bSendLanguage ? this.language() : '');
|
||||||
data.set('SignMe', this.signMe() ? 1 : 0);
|
data.set('signMe', this.signMe() ? 1 : 0);
|
||||||
Remote.request('Login',
|
Remote.request('Login',
|
||||||
(iError, oData) => {
|
(iError, oData) => {
|
||||||
fireEvent('sm-user-login-response', {
|
fireEvent('sm-user-login-response', {
|
||||||
|
|
@ -142,7 +142,7 @@ export class LoginUserView extends AbstractViewLogin {
|
||||||
onBuild(dom) {
|
onBuild(dom) {
|
||||||
super.onBuild(dom);
|
super.onBuild(dom);
|
||||||
|
|
||||||
const signMe = (SettingsGet('SignMe') || '').toLowerCase();
|
const signMe = (SettingsGet('signMe') || '').toLowerCase();
|
||||||
|
|
||||||
switch (signMe) {
|
switch (signMe) {
|
||||||
case 'defaultoff':
|
case 'defaultoff':
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ window.rl = {
|
||||||
},
|
},
|
||||||
|
|
||||||
setTitle: title =>
|
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 => {
|
initData: appData => {
|
||||||
RL_APP_DATA = appData;
|
RL_APP_DATA = appData;
|
||||||
|
|
|
||||||
|
|
@ -610,8 +610,8 @@ class Actions
|
||||||
|
|
||||||
$aResult = array(
|
$aResult = array(
|
||||||
'Auth' => false,
|
'Auth' => false,
|
||||||
'Title' => $oConfig->Get('webmail', 'title', 'SnappyMail Webmail'),
|
'title' => $oConfig->Get('webmail', 'title', 'SnappyMail Webmail'),
|
||||||
'LoadingDescription' => $oConfig->Get('webmail', 'loading_description', 'SnappyMail'),
|
'loadingDescription' => $oConfig->Get('webmail', 'loading_description', 'SnappyMail'),
|
||||||
'Plugins' => array(),
|
'Plugins' => array(),
|
||||||
'System' => \array_merge(
|
'System' => \array_merge(
|
||||||
array(
|
array(
|
||||||
|
|
@ -626,7 +626,7 @@ class Actions
|
||||||
'adminAllowed' => (bool)$oConfig->Get('security', 'allow_admin_panel', true)
|
'adminAllowed' => (bool)$oConfig->Get('security', 'allow_admin_panel', true)
|
||||||
) : array()
|
) : 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');
|
$sLanguage = $oConfig->Get('webmail', 'language', 'en');
|
||||||
|
|
@ -637,16 +637,16 @@ class Actions
|
||||||
if ($aResult['Auth']) {
|
if ($aResult['Auth']) {
|
||||||
$aResult['AdminLogin'] = (string)$oConfig->Get('security', 'admin_login', '');
|
$aResult['AdminLogin'] = (string)$oConfig->Get('security', 'admin_login', '');
|
||||||
$aResult['AdminTOTP'] = (string)$oConfig->Get('security', 'admin_totp', '');
|
$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['loginDefaultDomain'] = $oConfig->Get('login', 'default_domain', '');
|
||||||
$aResult['DetermineUserLanguage'] = (bool)$oConfig->Get('login', 'determine_user_language', true);
|
$aResult['determineUserLanguage'] = (bool)$oConfig->Get('login', 'determine_user_language', true);
|
||||||
$aResult['DetermineUserDomain'] = (bool)$oConfig->Get('login', 'determine_user_domain', false);
|
$aResult['determineUserDomain'] = (bool)$oConfig->Get('login', 'determine_user_domain', false);
|
||||||
|
|
||||||
$aResult['supportedPdoDrivers'] = \RainLoop\Common\PdoAbstract::getAvailableDrivers();
|
$aResult['supportedPdoDrivers'] = \RainLoop\Common\PdoAbstract::getAvailableDrivers();
|
||||||
|
|
||||||
$aResult['ContactsEnable'] = (bool)$oConfig->Get('contacts', 'enable', false);
|
$aResult['contactsEnable'] = (bool)$oConfig->Get('contacts', 'enable', false);
|
||||||
$aResult['ContactsSync'] = (bool)$oConfig->Get('contacts', 'allow_sync', false);
|
$aResult['contactsSync'] = (bool)$oConfig->Get('contacts', 'allow_sync', false);
|
||||||
$aResult['ContactsPdoType'] = Providers\AddressBook\PdoAddressBook::validPdoType($this->oConfig->Get('contacts', 'type', 'sqlite'));
|
$aResult['ContactsPdoType'] = Providers\AddressBook\PdoAddressBook::validPdoType($this->oConfig->Get('contacts', 'type', 'sqlite'));
|
||||||
$aResult['ContactsPdoDsn'] = (string)$oConfig->Get('contacts', 'pdo_dsn', '');
|
$aResult['ContactsPdoDsn'] = (string)$oConfig->Get('contacts', 'pdo_dsn', '');
|
||||||
$aResult['ContactsPdoType'] = (string)$oConfig->Get('contacts', 'type', '');
|
$aResult['ContactsPdoType'] = (string)$oConfig->Get('contacts', 'type', '');
|
||||||
|
|
@ -654,7 +654,7 @@ class Actions
|
||||||
$aResult['ContactsPdoPassword'] = static::APP_DUMMY;
|
$aResult['ContactsPdoPassword'] = static::APP_DUMMY;
|
||||||
$aResult['ContactsSuggestionsLimit'] = (int)$oConfig->Get('contacts', 'suggestions_limit', 20);
|
$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');
|
$aResult['WeakPassword'] = \is_file(APP_PRIVATE_DATA.'admin_password.txt');
|
||||||
|
|
||||||
|
|
@ -681,7 +681,6 @@ class Actions
|
||||||
'AccountHash' => $oAccount->Hash(),
|
'AccountHash' => $oAccount->Hash(),
|
||||||
'AccountSignMe' => isset($_COOKIE[self::AUTH_SIGN_ME_TOKEN_KEY]),
|
'AccountSignMe' => isset($_COOKIE[self::AUTH_SIGN_ME_TOKEN_KEY]),
|
||||||
'MainEmail' => \MailSo\Base\Utils::IdnToUtf8($this->getMainAccountFromToken()->Email()),
|
'MainEmail' => \MailSo\Base\Utils::IdnToUtf8($this->getMainAccountFromToken()->Email()),
|
||||||
'MailToEmail' => '',
|
|
||||||
|
|
||||||
'ContactsIsAllowed' => $this->AddressBookProvider($oAccount)->IsActive(),
|
'ContactsIsAllowed' => $this->AddressBookProvider($oAccount)->IsActive(),
|
||||||
|
|
||||||
|
|
@ -714,9 +713,7 @@ class Actions
|
||||||
'ShowUnreadCount' => false,
|
'ShowUnreadCount' => false,
|
||||||
'UnhideKolabFolders' => false,
|
'UnhideKolabFolders' => false,
|
||||||
'CheckMailInterval' => 15,
|
'CheckMailInterval' => 15,
|
||||||
'UserBackgroundName' => '',
|
'sieveAllowFileintoInbox' => (bool)$oConfig->Get('labs', 'sieve_allow_fileinto_inbox', false)
|
||||||
'UserBackgroundHash' => '',
|
|
||||||
'SieveAllowFileintoInbox' => (bool)$oConfig->Get('labs', 'sieve_allow_fileinto_inbox', false)
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$aAttachmentsActions = array();
|
$aAttachmentsActions = array();
|
||||||
|
|
@ -753,7 +750,7 @@ class Actions
|
||||||
|
|
||||||
$mMailToData = Utils::DecodeKeyValuesQ($sToken);
|
$mMailToData = Utils::DecodeKeyValuesQ($sToken);
|
||||||
if (!empty($mMailToData['MailTo']) && 'MailTo' === $mMailToData['MailTo'] && !empty($mMailToData['To'])) {
|
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
|
// MainAccount or AdditionalAccount
|
||||||
$oSettingsLocal = $this->SettingsProvider(true)->Load($oAccount);
|
$oSettingsLocal = $this->SettingsProvider(true)->Load($oAccount);
|
||||||
if ($oSettingsLocal instanceof Settings) {
|
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['SentFolder'] = (string)$oSettingsLocal->GetConf('SentFolder', '');
|
||||||
$aResult['DraftsFolder'] = (string)$oSettingsLocal->GetConf('DraftFolder', '');
|
$aResult['DraftsFolder'] = (string)$oSettingsLocal->GetConf('DraftFolder', '');
|
||||||
$aResult['JunkFolder'] = (string)$oSettingsLocal->GetConf('SpamFolder', '');
|
$aResult['JunkFolder'] = (string)$oSettingsLocal->GetConf('SpamFolder', '');
|
||||||
|
|
@ -781,6 +786,11 @@ class Actions
|
||||||
// MainAccount
|
// MainAccount
|
||||||
$oSettings = $this->SettingsProvider()->Load($oAccount);
|
$oSettings = $this->SettingsProvider()->Load($oAccount);
|
||||||
if ($oSettings instanceof Settings) {
|
if ($oSettings instanceof Settings) {
|
||||||
|
/*
|
||||||
|
foreach ($oSettings->toArray() as $key => $value) {
|
||||||
|
$aResult[\lcfirst($key)] = $value;
|
||||||
|
}
|
||||||
|
*/
|
||||||
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);
|
||||||
}
|
}
|
||||||
|
|
@ -830,14 +840,14 @@ class Actions
|
||||||
$aResult['fontMono'] = $oSettings->GetConf('fontMono', '');
|
$aResult['fontMono'] = $oSettings->GetConf('fontMono', '');
|
||||||
|
|
||||||
if ($this->GetCapa(Enumerations\Capa::USER_BACKGROUND)) {
|
if ($this->GetCapa(Enumerations\Capa::USER_BACKGROUND)) {
|
||||||
$aResult['UserBackgroundName'] = (string)$oSettings->GetConf('UserBackgroundName', $aResult['UserBackgroundName']);
|
$aResult['userBackgroundName'] = (string)$oSettings->GetConf('UserBackgroundName', $aResult['UserBackgroundName']);
|
||||||
$aResult['UserBackgroundHash'] = (string)$oSettings->GetConf('UserBackgroundHash', $aResult['UserBackgroundHash']);
|
$aResult['userBackgroundHash'] = (string)$oSettings->GetConf('UserBackgroundHash', $aResult['UserBackgroundHash']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$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');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
@ -853,13 +863,13 @@ class Actions
|
||||||
$aResult['DevPassword'] = '';
|
$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']) {
|
if ($aResult['Auth']) {
|
||||||
$aResult['UseLocalProxyForExternalImages'] = (bool)$oConfig->Get('labs', 'use_local_proxy_for_external_images', false);
|
$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['allowLanguagesOnSettings'] = (bool) $oConfig->Get('webmail', 'allow_languages_on_settings', true);
|
||||||
$aResult['Capa'] = $this->Capa($bAdmin, $oAccount);
|
$aResult['Capa'] = $this->Capa($bAdmin, $oAccount);
|
||||||
$value = \ini_get('upload_max_filesize');
|
$value = \ini_get('upload_max_filesize');
|
||||||
$upload_max_filesize = \intval($value);
|
$upload_max_filesize = \intval($value);
|
||||||
|
|
@ -869,7 +879,7 @@ class Actions
|
||||||
case 'K': $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(
|
$aResult['phpUploadSizes'] = array(
|
||||||
'upload_max_filesize' => $value,
|
'upload_max_filesize' => $value,
|
||||||
'post_max_size' => \ini_get('post_max_size')
|
'post_max_size' => \ini_get('post_max_size')
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ trait User
|
||||||
{
|
{
|
||||||
$sEmail = \MailSo\Base\Utils::Trim($this->GetActionParam('Email', ''));
|
$sEmail = \MailSo\Base\Utils::Trim($this->GetActionParam('Email', ''));
|
||||||
$sPassword = $this->GetActionParam('Password', '');
|
$sPassword = $this->GetActionParam('Password', '');
|
||||||
$bSignMe = !empty($this->GetActionParam('SignMe', 0));
|
$bSignMe = !empty($this->GetActionParam('signMe', 0));
|
||||||
|
|
||||||
$this->Logger()->AddSecret($sPassword);
|
$this->Logger()->AddSecret($sPassword);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -60,16 +60,16 @@ class ActionsAdmin extends Actions
|
||||||
return $self->ValidateTheme($sTheme);
|
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, 'allowLanguagesOnSettings', 'webmail', 'allow_languages_on_settings', 'bool');
|
||||||
$this->setConfigFromParams($oConfig, 'AllowLanguagesOnLogin', 'login', 'allow_languages_on_login', '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, 'loginDefaultDomain', 'login', 'default_domain', 'string');
|
||||||
|
|
||||||
$this->setConfigFromParams($oConfig, 'ContactsEnable', 'contacts', 'enable', 'bool');
|
$this->setConfigFromParams($oConfig, 'contactsEnable', 'contacts', 'enable', 'bool');
|
||||||
$this->setConfigFromParams($oConfig, 'ContactsSync', 'contacts', 'allow_sync', 'bool');
|
$this->setConfigFromParams($oConfig, 'contactsSync', 'contacts', 'allow_sync', 'bool');
|
||||||
$this->setConfigFromParams($oConfig, 'ContactsPdoDsn', 'contacts', 'pdo_dsn', 'string');
|
$this->setConfigFromParams($oConfig, 'ContactsPdoDsn', 'contacts', 'pdo_dsn', 'string');
|
||||||
$this->setConfigFromParams($oConfig, 'ContactsPdoUser', 'contacts', 'pdo_user', 'string');
|
$this->setConfigFromParams($oConfig, 'ContactsPdoUser', 'contacts', 'pdo_user', 'string');
|
||||||
$this->setConfigFromParams($oConfig, 'ContactsPdoPassword', 'contacts', 'pdo_password', 'dummy');
|
$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, 'CapaUserBackground', 'webmail', 'allow_user_background', 'bool');
|
||||||
$this->setConfigFromParams($oConfig, 'CapaOpenPGP', 'security', 'openpgp', 'bool');
|
$this->setConfigFromParams($oConfig, 'CapaOpenPGP', 'security', 'openpgp', 'bool');
|
||||||
|
|
||||||
$this->setConfigFromParams($oConfig, 'DetermineUserLanguage', 'login', 'determine_user_language', 'bool');
|
$this->setConfigFromParams($oConfig, 'determineUserLanguage', 'login', 'determine_user_language', 'bool');
|
||||||
$this->setConfigFromParams($oConfig, 'DetermineUserDomain', 'login', 'determine_user_domain', 'bool');
|
$this->setConfigFromParams($oConfig, 'determineUserDomain', 'login', 'determine_user_domain', 'bool');
|
||||||
|
|
||||||
$this->setConfigFromParams($oConfig, 'Title', 'webmail', 'title', 'string');
|
$this->setConfigFromParams($oConfig, 'title', 'webmail', 'title', 'string');
|
||||||
$this->setConfigFromParams($oConfig, 'LoadingDescription', 'webmail', 'loading_description', 'string');
|
$this->setConfigFromParams($oConfig, 'loadingDescription', 'webmail', 'loading_description', 'string');
|
||||||
$this->setConfigFromParams($oConfig, 'FaviconUrl', 'webmail', 'favicon_url', '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());
|
return $this->DefaultResponse($oConfig->Save());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ class Settings extends \RainLoop\Providers\AbstractProvider
|
||||||
|
|
||||||
public function Save(\RainLoop\Model\Account $oAccount, \RainLoop\Settings $oSettings) : bool
|
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
|
public function IsActive() : bool
|
||||||
|
|
|
||||||
|
|
@ -638,7 +638,7 @@ class ServiceActions
|
||||||
$this->Logger()->Write($sResult, \LOG_INFO, 'APPDATA');
|
$this->Logger()->Write($sResult, \LOG_INFO, 'APPDATA');
|
||||||
return $sResult;
|
return $sResult;
|
||||||
} catch (\Throwable $oException) {
|
} catch (\Throwable $oException) {
|
||||||
$self->Logger()->WriteExceptionShort($oException);
|
$this->Logger()->WriteExceptionShort($oException);
|
||||||
\MailSo\Base\Http::StatusHeader(500);
|
\MailSo\Base\Http::StatusHeader(500);
|
||||||
return $oException->getMessage();
|
return $oException->getMessage();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
namespace RainLoop;
|
namespace RainLoop;
|
||||||
|
|
||||||
class Settings
|
class Settings implements \JsonSerializable
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var array
|
* @var array
|
||||||
|
|
@ -14,11 +14,17 @@ class Settings
|
||||||
$this->aData = $aData;
|
$this->aData = $aData;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function DataAsArray() : array
|
public function toArray() : array
|
||||||
{
|
{
|
||||||
return $this->aData;
|
return $this->aData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\ReturnTypeWillChange]
|
||||||
|
public function jsonSerialize()
|
||||||
|
{
|
||||||
|
return $this->aData;;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param mixed $mDefValue = null
|
* @param mixed $mDefValue = null
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
<div data-bind="component: {
|
<div data-bind="component: {
|
||||||
name: 'Checkbox',
|
name: 'Checkbox',
|
||||||
params: { value: enabledPlugins, label: 'TAB_PACKAGES/LABEL_ENABLE_PLUGINS' }
|
params: { value: pluginsEnable, label: 'TAB_PACKAGES/LABEL_ENABLE_PLUGINS' }
|
||||||
}"></div>
|
}"></div>
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
@ -28,7 +28,7 @@
|
||||||
<div data-bind="template: { name: 'AdminSettingsPackagesTable', data: {f: packagesUpdate} }"></div>
|
<div data-bind="template: { name: 'AdminSettingsPackagesTable', data: {f: packagesUpdate} }"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="packages-installed" data-bind="visible: packagesCurrent().length, css: {'disabled': !enabledPlugins()}">
|
<div id="packages-installed" data-bind="visible: packagesCurrent().length, css: {'disabled': !pluginsEnable()}">
|
||||||
<div class="legend" data-i18n="TAB_PACKAGES/LEGEND_INSTALLED_PACKAGES"></div>
|
<div class="legend" data-i18n="TAB_PACKAGES/LEGEND_INSTALLED_PACKAGES"></div>
|
||||||
<div data-bind="template: { name: 'AdminSettingsPackagesTable', data: {f: packagesCurrent} }"></div>
|
<div data-bind="template: { name: 'AdminSettingsPackagesTable', data: {f: packagesCurrent} }"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue