View Issue Details

IDProjectCategoryView StatusLast Update
0013788mantisbtplug-inspublic2016-06-12 00:42
Reporterleemouse Assigned Tovboctor  
PrioritylowSeverityfeatureReproducibilityN/A
Status closedResolutionfixed 
Product Version1.2.8 
Target Version1.3.0-rc.2Fixed in Version1.3.0-rc.2 
Summary0013788: Add EVENT_USER_DISPLAY_AVATAR to enable plugins to use LDAP and Social Networks
Description

It's a feature request.
When user authenticate on LDAP server, mantis can fetch avatar image from LDAP (attribute photo for example).

Tagsavatar

Relationships

related to 0008257 acknowledged store avatar local 
has duplicate 0010546 closedvboctor Add plugin event for EVENT_USER_DISPLAY_AVATAR 
has duplicate 0019319 closedvboctor Add support for own gravatar site 
related to 0020641 closedvboctor When $g_show_avatar = OFF, no avatar should be displayed 
related to 0020642 closedvboctor Avatar settings should be moved to plugin config page 

Activities

rombert

rombert

2012-01-23 03:00

reporter   ~0030998

What exactly do you store in your LDAP user's profile - link to an image , bytes ?

atrol

atrol

2012-01-23 03:40

developer   ~0030999

Found this: http://www.openldap.org/doc/admin24/schema.html
Search for 13.2.4.2. x-my-Photo

leemouse

leemouse

2012-01-23 03:46

reporter   ~0031000

I exactly store octet stream (bytes) in my LDAP user's profile.
In LDAP schema object "inetOrgPerson" has attribute "jpegPhoto".
Attribute "jpegPhoto" in object "inetOrgPerson" has type "RFC2798: a JPEG image".
But, if support this is very hard, I can store URL to avatar image.

rombert

rombert

2012-01-23 04:01

reporter   ~0031001

I think this will require some rethinking of the user image handling, as it is more or less set towards gravatar. I do not plan to handle this in the short term, but I wanted to clarify the requirements.

leemouse

leemouse

2012-01-23 05:51

reporter   ~0031002

O, minimal requirements is very simple.
In config file of mantis we set variable, for example, "g_ldap_avatar_attr_name".
And another variable "g_avatar_source" to value "LDAP" or "LDAP" or "GRAVATAR".
And another variable "g_avatar_style" to value "JPEG" or "URL".
Administrator of LDAP server provide values of attribute with image to user's profiles.
Mantis (in case "g_avatar_source = LDAP") search attribute and handle fetched value appropriate "g_avatar_style".

vboctor

vboctor

2012-01-27 03:26

manager   ~0031050

How about the following requirements:

  1. Support plugins that provide avatars. Gravatar and LDAP become just a couple of these. Others can include Twitter, Facebook, etc.

  2. SOAP API should provide a way for clients to get the avatar independent of the plugin(s) used.

  3. I wonder if we should support chaining multiple plugins, so based on user settings, the avatars can come from different providers.

leemouse

leemouse

2012-01-27 03:49

reporter   ~0031053

Yes, vboctor, your solution is the best! :-)

rombert

rombert

2012-01-27 04:29

reporter   ~0031056

(In reply to comment 0013788:0031050)

How about the following requirements:

  1. Support plugins that provide avatars. Gravatar and LDAP become just a couple
    of these. Others can include Twitter, Facebook, etc.

Yup, sounds like something to move out of core to plugins.

  1. SOAP API should provide a way for clients to get the avatar independent of
    the plugin(s) used.

+1

  1. I wonder if we should support chaining multiple plugins, so based on user
    settings, the avatars can come from different providers.

As long as we allow a plugin to return multiple avatars we can always design a chaining avatar plugin which combines individual avatar plugins. So less complexity to core in handling chaining. I'm considering the same pattern for a (blue-sky, 2050-style) federated login sources for MantisBT.

vboctor

vboctor

2016-01-24 21:17

manager   ~0052369

PR: https://github.com/mantisbt/mantisbt/pull/711

Related Changesets

MantisBT: master f28e25ba

2016-01-24 16:13

vboctor


Details Diff
Support avatar plugins

Add the necessary events to enable development of avatar providers
for scenarios like retrieving avatars from local file syste, LDAP,
social identities, etc.

As a proof of the events and a sample, this change also refactors
Gravatar integration into a core plugin.

Fixes 0013788
Affected Issues
0013788
mod - admin/schema.php Diff File
mod - config_defaults_inc.php Diff File
add - core/classes/Avatar.class.php Diff File
mod - core/classes/TimelineEvent.class.php Diff File
mod - core/events_inc.php Diff File
mod - core/http_api.php Diff File
mod - core/print_api.php Diff File
mod - core/user_api.php Diff File
mod - docbook/Developers_Guide/en-US/Events_Reference_Account.xml Diff File
mod - docbook/Developers_Guide/en-US/Events_Reference_Output.xml Diff File
add - images/avatar.png Diff File
add - plugins/Gravatar/Gravatar.php Diff File
add - plugins/Gravatar/lang/strings_english.txt Diff File

MantisBT: master 1ef60566

2016-02-27 19:37

vboctor


Details Diff
Support avatar plugins

Add the necessary events to enable development of avatar providers
for scenarios like retrieving avatars from local file system, LDAP,
social identities, etc.

As a proof of the events, sample, and feature parity with previous
implementation, this change also refactors Gravatar integration into a
core plugin.

Fixes 0013788
Affected Issues
0013788
mod - .gitignore Diff File
mod - admin/schema.php Diff File
mod - config_defaults_inc.php Diff File
add - core/classes/Avatar.class.php Diff File
mod - core/classes/TimelineEvent.class.php Diff File
mod - core/events_inc.php Diff File
mod - core/http_api.php Diff File
mod - core/install_helper_functions_api.php Diff File
mod - core/print_api.php Diff File
mod - core/user_api.php Diff File
mod - docbook/Developers_Guide/en-US/Events_Reference_Account.xml Diff File
add - images/avatar.png Diff File
add - plugins/Gravatar/Gravatar.php Diff File
add - plugins/Gravatar/README.md Diff File
add - plugins/Gravatar/lang/strings_english.txt Diff File

MantisBT: master 341e1baf

2016-04-21 07:32

vboctor


Details Diff
Rendering avatars for deleted users triggers error

Fixes 0013788
Affected Issues
0013788
mod - core/classes/Avatar.class.php Diff File