* Preferences: use push to ask every affected client to reload preferences, if affected

This commit is contained in:
Ralf Becker
2020-07-31 09:47:49 +02:00
parent a562cdf502
commit 33e88d25ae
4 changed files with 28 additions and 5 deletions

View File

@ -411,7 +411,7 @@ class Accounts
/**
* Get an account as json, returns only whitelisted fields:
* - 'account_id','account_lid','person_id','account_status',
* - 'account_id','account_lid','person_id','account_status','memberships'
* - 'account_firstname','account_lastname','account_email','account_fullname','account_phone'
*
* @param int|string $id
@ -420,11 +420,12 @@ class Accounts
function json($id)
{
static $keys = array(
'account_id','account_lid','person_id','account_status',
'account_id','account_lid','person_id','account_status','memberships',
'account_firstname','account_lastname','account_email','account_fullname','account_phone',
);
if (($account = $this->read($id)))
{
if (isset($account['memberships'])) $account['memberships'] = array_keys($account['memberships']);
$account = array_intersect_key($account, array_flip($keys));
}
// for current user, add the apps available to him