From cfc7cabbf1eeae92b6953106c1fb35304bb1bd70 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sat, 9 Mar 2019 12:38:15 +0100 Subject: [PATCH] * ActiveDirectory: fix "not a valid GUID" error, when getting an avatar of a group --- api/src/Contacts/Ads.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/api/src/Contacts/Ads.php b/api/src/Contacts/Ads.php index b3cc8a771c..7bc3d61e84 100644 --- a/api/src/Contacts/Ads.php +++ b/api/src/Contacts/Ads.php @@ -177,7 +177,10 @@ class Ads extends Ldap !is_array($_contact_id) && substr($_contact_id,0,8) == 'account:') { $account_id = (int)(is_array($_contact_id) ? $_contact_id['account_id'] : substr($_contact_id,8)); - $_contact_id = $GLOBALS['egw']->accounts->id2name($account_id, 'person_id'); + if ($account_id < 0 || !($_contact_id = $GLOBALS['egw']->accounts->id2name($account_id, 'person_id'))) + { + return false; + } } $contact_id = !is_array($_contact_id) ? $_contact_id : (isset ($_contact_id['id']) ? $_contact_id['id'] : $_contact_id['uid']);