nextcloud / user_external

👥 External user authentication methods like IMAP, SMB and FTP
https://apps.nextcloud.com/apps/user_external
108 stars 64 forks source link

Errors for undefined variable "groups" in imap.php #88

Closed alanswanson closed 5 years ago

alanswanson commented 5 years ago

Steps to reproduce

  1. Use user_external with IMAP authentication and no domain in username.

Expected behaviour

No errors.

Actual behaviour

Nextcloud logging the following error on every IMAP password check;

_Undefined variable: groups at /var/www/localhost/htdocs/cloud/apps/userexternal/lib/imap.php#101

In lib/imap.php for usernames without domains the groups array/variable is not setup at ($this->groupDomain && $pieces[1]) { $groups[] = $pieces[1]; } and hence $this->storeUser($uid, $groups); needs groups previously defined to null or guarded.

Affected Authentication backend

IMAP

Server configuration

User External App version: 0.6.3 plus pull #83

Operating system: Gentoo

Web server: Cherokee

Database: MariaDB

PHP version: 7.1.30

Nextcloud version: 15.0.8

Updated from an older Nextcloud/ownCloud or fresh install: Updated

Where did you install Nextcloud from: Source

violoncelloCH commented 5 years ago

thank you for reporting @alanswanson as you've already pointed out the lines where this is coming from: would you be willing to create a PR for this?

realizelol commented 5 years ago

have a look at #56

violoncelloCH commented 5 years ago

@realizelol that's something different....

alanswanson commented 5 years ago

The fix in https://github.com/nextcloud/user_external/issues/56#issuecomment-502492778 to _apps/userexternal/lib/imap.php resolved my log errors. (Though I tidied the the curly bracket formatting and spacing.)

violoncelloCH commented 5 years ago

okay I see that was discussed there later as well, but was not part of the original issue description :) a fix for this is waiting to be merged in #90