mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 14:41:29 +01:00
Allow groups to have lavatars
This commit is contained in:
parent
7e25d8fdda
commit
5027e075d7
@ -441,12 +441,11 @@ class Accounts
|
|||||||
$accounts[] = [
|
$accounts[] = [
|
||||||
'value' => $account['account_id'],
|
'value' => $account['account_id'],
|
||||||
'label' => $displayName,
|
'label' => $displayName,
|
||||||
]+($account['account_id'] <= 0 ? [] : [ // there is currently no avatar for groups, no need to ask server about it
|
|
||||||
'icon' => Framework::link('/api/avatar.php', [
|
'icon' => Framework::link('/api/avatar.php', [
|
||||||
'account_id' => $account['account_id'],
|
'account_id' => $account['account_id'],
|
||||||
'modified' => $account['account_modified'],
|
'modified' => $account['account_modified'],
|
||||||
]),
|
]),
|
||||||
]);
|
];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -2710,7 +2710,8 @@ class Contacts extends Contacts\Storage
|
|||||||
|
|
||||||
if (substr($contact_id,0,8) == 'account:')
|
if (substr($contact_id,0,8) == 'account:')
|
||||||
{
|
{
|
||||||
$contact_id = $GLOBALS['egw']->accounts->id2name(substr($contact_id,8),'person_id');
|
$id = substr($contact_id, 8);
|
||||||
|
$contact_id = $GLOBALS['egw']->accounts->id2name(substr($contact_id, 8), 'person_id');
|
||||||
}
|
}
|
||||||
|
|
||||||
$contact = $this->read($contact_id);
|
$contact = $this->read($contact_id);
|
||||||
@ -2720,7 +2721,15 @@ class Contacts extends Contacts\Storage
|
|||||||
!(($contact['files'] & \EGroupware\Api\Contacts::FILES_BIT_PHOTO) && // new SQL in VFS
|
!(($contact['files'] & \EGroupware\Api\Contacts::FILES_BIT_PHOTO) && // new SQL in VFS
|
||||||
($size = filesize($url= \EGroupware\Api\Link::vfs_path('addressbook', $contact_id, \EGroupware\Api\Contacts::FILES_PHOTO)))))
|
($size = filesize($url= \EGroupware\Api\Link::vfs_path('addressbook', $contact_id, \EGroupware\Api\Contacts::FILES_PHOTO)))))
|
||||||
{
|
{
|
||||||
if (is_array($contact))
|
if(!$contact_id && $id < 0)
|
||||||
|
{
|
||||||
|
$group = $GLOBALS['egw']->accounts->read($id);
|
||||||
|
$contact = array(
|
||||||
|
'id' => $id,
|
||||||
|
'n_given' => $group['account_firstname']
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if(is_array($contact))
|
||||||
{
|
{
|
||||||
header('Content-type: image/jpeg');
|
header('Content-type: image/jpeg');
|
||||||
$contact['jpegphoto'] = \EGroupware\Api\avatar::lavatar(array(
|
$contact['jpegphoto'] = \EGroupware\Api\avatar::lavatar(array(
|
||||||
|
Loading…
Reference in New Issue
Block a user