diff --git a/api/src/Auth/Ads.php b/api/src/Auth/Ads.php index 155b34fe35..43e31669aa 100644 --- a/api/src/Auth/Ads.php +++ b/api/src/Auth/Ads.php @@ -216,8 +216,15 @@ class Ads implements Backend if(!$account_id || $GLOBALS['egw_info']['flags']['currentapp'] == 'login') { $admin = false; - $username = $GLOBALS['egw_info']['user']['account_lid']; - $account_id = $GLOBALS['egw_info']['user']['account_id']; + if (!empty($GLOBALS['egw_info']['user']['account_id']) && $GLOBALS['egw_info']['user']['account_id'] > 0) + { + $username = $GLOBALS['egw_info']['user']['account_lid']; + $account_id = $GLOBALS['egw_info']['user']['account_id']; + } + else + { + $username = $GLOBALS['egw']->accounts->id2name($account_id); + } } else {