load users config params after login

This commit is contained in:
yuri
2016-12-01 12:29:26 +02:00
parent 014d47d017
commit 0a3a6b3773
5 changed files with 16 additions and 4 deletions
+7 -1
View File
@@ -60,11 +60,17 @@ class App extends \Espo\Core\Controllers\Base
}
$userData['emailAddressList'] = $emailAddressList;
$settings = array();
foreach ($this->getConfig()->get('userItems') as $item) {
$settings[$item] = $this->getConfig()->get($item);
}
return array(
'user' => $userData,
'acl' => $this->getAcl()->getMap(),
'preferences' => $preferences,
'token' => $this->getUser()->get('token')
'token' => $this->getUser()->get('token'),
'settings' => $settings
);
}
@@ -146,6 +146,8 @@ return array ( 'defaultPermissions' =>
),
'userItems' =>
array (
'outboundEmailFromAddress',
'outboundEmailFromName'
),
'isInstalled' => false,
'ldapUserNameAttribute' => 'sAMAccountName',
+5 -1
View File
@@ -61,7 +61,7 @@ Espo.define(
this.setupAjax();
this.settings = new Settings(null, {cache: this.cache});
this.settings = new Settings(null);
this.language = new Language(this.cache);
this.metadata = new Metadata(this.cache);
this.fieldManager = new FieldManager();
@@ -470,8 +470,12 @@ Espo.define(
var preferencesData = options.preferences || null;
var aclData = options.acl || null;
var settingData = options.settings || {};
this.user.set(userData);
this.preferences.set(preferencesData);
this.settings.set(settingData);
this.acl.set(aclData);
if (!this.auth) {
+2 -1
View File
@@ -107,7 +107,8 @@ Espo.define('views/login', 'view', function (Dep) {
},
user: data.user,
preferences: data.preferences,
acl: data.acl
acl: data.acl,
settings: data.settings
});
}.bind(this),
error: function (xhr) {
-1
View File
@@ -51,7 +51,6 @@ Espo.define('views/settings/record/edit', 'views/record/edit', function (Dep) {
this.listenTo(this.model, 'after:save', function () {
this.getConfig().set(this.model.toJSON());
this.getConfig().storeToCache();
}.bind(this));
},