gitea/services
Râu Cao f48c0135a6
Fix/improve avatar sync from LDAP (#34573)
This fixes 3 issues I encountered when debugging problems with our LDAP sync:

1. The comparison of the hashed image data in `IsUploadAvatarChanged` is
wrong. It seems to be from before avatar hashing was changed and unified
in #22289. This results in the function always returning `true` for any
avatars, even if they weren't changed.
2. Even if there's no avatar to upload (i.e. no avatar available for the
LDAP entry), the upload function would still be called for every single
user, only to then fail, because the data isn't valid. This is
unnecessary.
3. Another small issue is that the comparison function (and thus hashing
of data) is called for every user, even if there is no avatar attribute
configured at all for the LDAP source. Thus, I switched the condition
nesting, so that no cycles are wasted when avatar sync isn't configured
in the first place.

I also added a trace log for when there is actually a new avatar being
uploaded for an existing user, which is now only shown when that is
actually the case.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-06-02 10:05:47 -07:00
..
actions Fix actions skipped commit status indicator (#34507) 2025-05-28 11:36:21 -04:00
agit Option to delay conflict checking of old pull requests until page view (#27779) 2025-04-24 19:26:57 +00:00
asymkey Cache GPG keys, emails and users when list commits (#34086) 2025-04-09 16:34:38 +00:00
attachment Enable testifylint rules (#34075) 2025-03-31 01:53:48 -04:00
auth Fix/improve avatar sync from LDAP (#34573) 2025-06-02 10:05:47 -07:00
automerge Option to delay conflict checking of old pull requests until page view (#27779) 2025-04-24 19:26:57 +00:00
context Performance optimization for tags synchronization (#34355) 2025-05-22 13:54:42 -07:00
contexttest Add API endpoint to request contents of multiple files simultaniously (#34139) 2025-04-22 01:20:11 +08:00
convert Fix actions skipped commit status indicator (#34507) 2025-05-28 11:36:21 -04:00
cron Use default Git timeout when checking repo health (#33593) 2025-02-14 15:13:56 +00:00
doctor Fix doctor deleting orphaned issues attachments (#34142) 2025-05-30 05:06:03 +00:00
externalaccount Enable addtional linters (#34085) 2025-04-01 10:14:01 +00:00
feed Fix notify watch failure when the content is too long (#34233) 2025-04-20 02:49:57 +00:00
forms Enforce two-factor auth (2FA: TOTP or WebAuthn) (#34187) 2025-04-28 15:31:59 -07:00
git Split GetLatestCommitStatus as two functions (#34535) 2025-05-26 19:00:22 +00:00
gitdiff Mark parent directory as viewed when all files are viewed (#33958) 2025-04-15 22:35:22 +08:00
indexer Update issue indexer after merging a PR (#30715) 2024-05-08 14:45:15 +00:00
issue Fix doctor deleting orphaned issues attachments (#34142) 2025-05-30 05:06:03 +00:00
lfs Enable addtional linters (#34085) 2025-04-01 10:14:01 +00:00
mailer Enable addtional linters (#34085) 2025-04-01 10:14:01 +00:00
markup Refactor Git Attribute & performance optimization (#34154) 2025-04-11 21:41:29 +08:00
migrations Fix possible nil description of pull request when migrating from CodeCommit (#34541) 2025-05-27 11:25:34 -07:00
mirror Only git operations should update `last changed` of a repository (#34388) 2025-05-11 19:18:46 +00:00
notify Add workflow_job webhook (#33694) 2025-03-11 10:40:38 -07:00
oauth2_provider Enable addtional linters (#34085) 2025-04-01 10:14:01 +00:00
org Fix remove org user failure on mssql (#34449) 2025-05-14 02:33:56 +08:00
packages Fix package upload temp path (#34196) 2025-04-14 18:55:02 +08:00
projects Enable addtional linters (#34085) 2025-04-01 10:14:01 +00:00
pull Always use an empty line to separate the commit message and trailer (#34512) 2025-06-02 06:29:16 +00:00
release Enable testifylint rules (#34075) 2025-03-31 01:53:48 -04:00
repository Fix some trivial problems (#34579) 2025-06-02 15:22:43 +00:00
secrets Added Description Field for Secrets and Variables (#33526) 2025-03-17 19:24:54 +00:00
task Fix bug when migrating repository (#34182) 2025-04-14 04:48:03 +00:00
uinotification
user Enable testifylint rules (#34075) 2025-03-31 01:53:48 -04:00
versioned_migration Add global lock for migrations to make upgrade more safe with multiple replications (#33706) 2025-03-07 21:08:53 +00:00
webhook Change "rejected" to "changes requested" in 3rd party PR review notification (#34481) 2025-05-15 23:56:26 -04:00
webtheme Improve theme display (#30671) 2025-03-08 21:38:11 +00:00
wiki Only git operations should update `last changed` of a repository (#34388) 2025-05-11 19:18:46 +00:00