Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors in log in ContactsIntegration.php #10079

Open
sergiupapuc opened this issue Aug 31, 2024 · 1 comment
Open

Errors in log in ContactsIntegration.php #10079

sergiupapuc opened this issue Aug 31, 2024 · 1 comment

Comments

@sergiupapuc
Copy link

sergiupapuc commented Aug 31, 2024

Steps to reproduce

1.open app
2.
3.

Expected behavior

...no errors in log system

Actual behavior

Errors in log system

Mail app version

3.7.8

Mailserver or service

Imap

Operating system

Ubuntu 24.04

PHP engine version

PHP 8.3

Web server

Apache (supported)

Database

MariaDB

Additional info

{"reqId":"Unh0z9Djrslu1KU2o6Zq","level":3,"time":"2024-08-31T12:44:18+00:00","remoteAddr":"2a02:2f04:d40d:6100:16fb:96d0:a431:2555","user":"015D1767-5A9A-415C-ABA1-E4A3CD2183D7","app":"PHP","method":"GET","url":"/index.php/apps/mail/api/autoComplete?term=sergiupapuc%40senat.ro","message":"foreach() argument must be of type array|object, null given at /var/www/nextcloud/apps/mail/lib/Service/ContactsIntegration.php#93","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36","version":"29.0.5.1","data":{"app":"PHP"},"id":"66d313047ef79"}

{"reqId":"Unh0z9Djrslu1KU2o6Zq","level":3,"time":"2024-08-31T12:44:18+00:00","remoteAddr":"2a02:2f04:d40d:6100:16fb:96d0:a431:2555","user":"015D1767-5A9A-415C-ABA1-E4A3CD2183D7","app":"PHP","method":"GET","url":"/index.php/apps/mail/api/autoComplete?term=sergiupapuc%40senat.ro","message":"Undefined variable $userGroups at /var/www/nextcloud/apps/mail/lib/Service/ContactsIntegration.php#93","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36","version":"29.0.5.1","data":{"app":"PHP"},"id":"66d313047ef80"}
@joshtrichards joshtrichards changed the title Errors in log Errors in log in ContactsIntegration.php Sep 9, 2024
@joshtrichards
Copy link
Member

foreach ($result as $r) {
$isSystemUser = isset($r['isLocalSystemBook']) && $r['isLocalSystemBook'];
$isInSameGroup = false;
if ($isSystemUser && $shareeEnumerationInGroupOnly) {
foreach ($userGroups as $userGroup) {
if ($this->groupManager->isInGroup($r['UID'], $userGroup)) {
$isInSameGroup = true;
break;
}
}

if ($shareeEnumeration && $shareeEnumerationInGroupOnly) {
$user = $this->userManager->get($userId);
if ($user === null) {
return [];
}
$userGroups = $this->groupManager->getUserGroupIds($user);
}

// If 'Allow username autocompletion in share dialog' is disabled in the admin sharing settings, then we must not
// auto-complete system users
$shareeEnumeration = $this->config->getAppValue('core', 'shareapi_allow_share_dialog_user_enumeration', 'no') === 'yes';
$shareeEnumerationInGroupOnly = $this->config->getAppValue('core', 'shareapi_restrict_user_enumeration_to_group', 'no') === 'yes';

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants