Skip to content

ID documents of LDAP users are invisible on the account page (INNER JOIN on oc_users) #7861

Description

@tebbiworld

Describe the bug

When identification documents are enabled and users come from an LDAP backend, an uploaded ID document is never shown on the user's account page. The account page reports "not sent yet" ("Noch nicht gesendet") even though the record exists in the database and the file was uploaded successfully. This only affects LDAP users. Local (database-backend) users are unaffected.

To reproduce

  1. Configure Nextcloud with an LDAP user backend.
  2. Enable identification documents in LibreSign.
  3. As an LDAP user, upload an ID document.
  4. Open the LibreSign account page as that user.
  5. The ID document is not shown; status reads "not sent yet".

IdDocsMapper::list() joins the users table with an INNER JOIN when filtering by
userId:

$joinType = !empty($filter['userId']) ? 'join' : 'leftJoin';
$qb->$joinType('id', 'users', 'u', 'id.user_id = u.uid');

LDAP users do not have a row in oc_users, so the INNER JOIN drops their ID
document rows entirely, and the account page shows nothing.

Fix: always use a LEFT JOIN. The WHERE clause on id.user_id still filters the
result correctly, so no rows are wrongly included:

$joinType = 'leftJoin';
$qb->$joinType('id', 'users', 'u', 'id.user_id = u.uid');

Verified: after this change the LDAP user's ID document appears on the account
page as expected.

Expected behavior

No response

Screenshots

No response

Operational System

NethServer 8 (Rocky Linux) running Nextcloud with the LibreSign app

Browser Type and Version

No response

Libresign Version

13.2.6

Nextcloud Server Version

No response

Logs from Nextcloud Server

No errors. The document is uploaded and stored correctly; the row is simply
filtered out by the INNER JOIN on oc_users because LDAP users are not present
in that table.

Logs from Developers tools

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    Status
    0. Needs triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions