Skip to content

fix(user_ldap): fix lastLogin reading wrong appid and configkey#59415

Merged
susnux merged 1 commit intonextcloud:masterfrom
hamidout:fix/user-ldap-last-login-config-key
Apr 3, 2026
Merged

fix(user_ldap): fix lastLogin reading wrong appid and configkey#59415
susnux merged 1 commit intonextcloud:masterfrom
hamidout:fix/user-ldap-last-login-config-key

Conversation

@hamidout
Copy link
Copy Markdown

@hamidout hamidout commented Apr 3, 2026

Fixes #58421

Summary

fetchDetails() in OfflineUser was using the wrong appid (user_ldap) and key (email) when reading lastLogin via getValueInt(). The value is stored under appid login with key lastLogin (as written by User::updateLastLoginTimestamp()), so this always returned 0 for offline LDAP users.

TODO

  • One-line fix

Checklist

  • Code is properly formatted
  • Sign-off message is added to all commits
  • Tests (unit, integration, api and/or acceptance) are included
  • Screenshots before/after for front-end changes
  • Documentation (manuals or wiki) has been updated or is not required
  • Backports requested where applicable
  • Labels added where applicable
  • Milestone added for target branch/version

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

@hamidout hamidout requested a review from a team as a code owner April 3, 2026 09:40
@hamidout hamidout requested review from Altahrim, icewind1991, nfebe and provokateurin and removed request for a team April 3, 2026 09:40
@susnux susnux modified the milestones: Nextcloud 33.0.3, Nextcloud 34 Apr 3, 2026
@susnux susnux self-assigned this Apr 3, 2026
@susnux
Copy link
Copy Markdown
Contributor

susnux commented Apr 3, 2026

/backport to stable33

Copy link
Copy Markdown
Contributor

@susnux susnux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much for looking into this!
The error message is so unrelated and confusing...

@susnux susnux requested review from CarlSchwan and removed request for nfebe April 3, 2026 11:46
@susnux
Copy link
Copy Markdown
Contributor

susnux commented Apr 3, 2026

@hamidout to be able to merge your PR we need you to sign-off your commit, see:
https://github.com/nextcloud/server/blob/master/.github/CONTRIBUTING.md#sign-your-work

You can do so by e.g. git commit --amend -s

fetchDetails() was calling getValueInt($uid, 'user_ldap', 'email')
instead of getValueInt($uid, 'login', 'lastLogin'), causing lastLogin
to always return 0 for offline LDAP users.

Fixes nextcloud#58421

Signed-off-by: hamid <hamid@webpick.net>
@hamidout hamidout force-pushed the fix/user-ldap-last-login-config-key branch from 6aaa258 to b7d6822 Compare April 3, 2026 12:07
@susnux susnux merged commit 92e4c88 into nextcloud:master Apr 3, 2026
178 checks passed
@welcome
Copy link
Copy Markdown

welcome bot commented Apr 3, 2026

Thanks for your first pull request and welcome to the community! Feel free to keep them coming! If you are looking for issues to tackle then have a look at this selection: https://github.com/nextcloud/server/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: TypeError at lib/private/Config/UserConfig.php line 688

3 participants