Skip to content

ENH: Avatar injection #1446

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

Draft
wants to merge 6 commits into
base: dev
Choose a base branch
from

Conversation

johnhenley
Copy link
Collaborator

@johnhenley johnhenley commented Jun 26, 2025

Description of PR...

Adds an avatar injection service (currently using Gravatar) to look for new avatars for forums users who have not set up their own DNN profile picture/avatar. A new scheduler item is added (currently runs hourly but can be adjusted like any other DNN scheduler item) to look for avatars in batches of 50 at a time. The last refresh date/time is stored and avatars are checked again after 90 days.

Changes made

  • ForumSettings.ascx.cs: Added dropdowns for selecting avatar refresh types (currently Gravatar and "Disabled").
  • AvatarRefreshQueue.cs: Introduced a new service for periodic avatar updates (currently just using Gravatar).
  • 09.01.00.SqlDataProvider: Enhanced database schema with new fields for avatar management.
  • Utilities.cs: Added a method for generating SHA-256 hashes for email addresses used in Gravatar lookups.
  • IAvatarProvider.cs/GravatarAvatarProvider.cs/AvatarRefreshQueue.cs: Adds provider to retrieve avatars from Gravatar.

How did you test these updates?

Local install

New Scheduler Item

image

New Module Setting

image

Admin Log updated when a gravatar is updated

image

Sample users (before)

image

Sample users (after)

image


PR Template Checklist

  • Fixes Bug
  • Feature solution
  • Other
  • Requires documentation updates
  • I've updated the documentation already

Please mark which issue is solved

Close #347
Close #1410
Close #1411
Close #1412

- Updated SQL script to modify the database schema for avatar refresh.
- Added `LastAvatarRefresh` property in `ForumUserInfo` to track avatar refresh times.
- Updated `DnnCommunityForums.dnn` with a new SQL data provider script for version 09.01.00.
- Implemented dropdown controls for avatar refresh type in `ForumSettings.ascx`.
- Introduced new localization entries for avatar refresh settings in multiple languages.
- Defined new setting keys for avatar refresh in `Globals.cs`.
- Developed avatar refresh logic in `AvatarRefreshQueue` and created `GravatarAvatarProvider` for fetching avatars.
- Added `IAvatarProvider` interface for avatar provider contract.
- Added unit tests for `GetMd5Hash` in `UtilitiesTests.cs`.
@johnhenley johnhenley added this to the 09.01.00 milestone Jun 26, 2025
@johnhenley johnhenley self-assigned this Jun 26, 2025
@johnhenley johnhenley added the enhancement New feature or request label Jun 26, 2025
@johnhenley johnhenley changed the title Dev91/issues/avatar injection 347 1410 1411 1412 ENH: Avatar injection Jun 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
1 participant