Api: Make sure we don't add any unwanted data to account store

Push fallback can piggy-back some data, we don't want it
This commit is contained in:
nathangray 2020-10-05 10:55:34 -06:00
parent f1fdd7e2f1
commit 857943720e

View File

@ -106,9 +106,16 @@ egw.extend('user', egw.MODULE_GLOBAL, function()
if(jQuery.isEmptyObject(accountStore)) if(jQuery.isEmptyObject(accountStore))
{ {
// Synchronous // Synchronous
egw.json('EGroupware\\Api\\Framework::ajax_user_list',[], egw.json("EGroupware\\Api\\Framework::ajax_user_list",[],
function(data) { function(data) {
accountStore = jQuery.extend(true, {}, data||{}); let types = ["accounts", "groups", "owngroups"];
for(let t of types)
{
if(typeof data[t] === "object")
{
accountStore[t] = jQuery.extend(true, [], data[t]||[]);
}
}
}, this, false }, this, false
).sendRequest(false); ).sendRequest(false);
} }