View Issue Details

IDProjectCategoryView StatusLast Update
0013788mantisbtplug-inspublic2016-06-12 00:42
ReporterleemouseAssigned 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

developer   ~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

developer   ~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

developer   ~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 21:13:07

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
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-28 00:37:43

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
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 11:32:14

vboctor

Details Diff
Rendering avatars for deleted users triggers error

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

Issue History

Date Modified Username Field Change
2012-01-22 23:42 leemouse New Issue
2012-01-23 03:00 rombert Note Added: 0030998
2012-01-23 03:00 rombert Status new => feedback
2012-01-23 03:00 rombert Description Updated View Revisions
2012-01-23 03:40 atrol Note Added: 0030999
2012-01-23 03:46 leemouse Note Added: 0031000
2012-01-23 03:46 leemouse Status feedback => new
2012-01-23 04:01 rombert Note Added: 0031001
2012-01-23 04:01 rombert Priority normal => low
2012-01-23 05:51 leemouse Note Added: 0031002
2012-01-27 03:26 vboctor Note Added: 0031050
2012-01-27 03:49 leemouse Note Added: 0031053
2012-01-27 04:29 rombert Note Added: 0031056
2016-01-24 03:13 vboctor Assigned To => vboctor
2016-01-24 03:13 vboctor Status new => assigned
2016-01-24 03:13 vboctor Relationship added has duplicate 0010546
2016-01-24 03:14 vboctor Relationship added related to 0019319
2016-01-24 03:16 vboctor Relationship added related to 0008257
2016-01-24 03:19 vboctor Category ldap => plug-ins
2016-01-24 03:19 vboctor Summary Avatar image from LDAP server => Add EVENT_USER_DISPLAY_AVATAR to enable plugins to use LDAP and Social Networks
2016-01-24 03:19 vboctor Description Updated View Revisions
2016-01-24 03:19 vboctor Relationship deleted related to 0019319
2016-01-24 03:20 vboctor Relationship added has duplicate 0019319
2016-01-24 21:17 vboctor Note Added: 0052369
2016-02-28 00:42 vboctor Changeset attached => MantisBT master f28e25ba
2016-02-28 00:42 vboctor Changeset attached => MantisBT master 1ef60566
2016-02-28 00:42 vboctor Status assigned => resolved
2016-02-28 00:42 vboctor Resolution open => fixed
2016-02-28 00:42 vboctor Fixed in Version => 1.3.0-rc.2
2016-02-28 00:42 vboctor Target Version => 1.3.0-rc.2
2016-02-28 05:45 dregad Relationship added related to 0020641
2016-02-28 05:49 dregad Relationship added related to 0020642
2016-03-11 11:58 dregad Tag Attached: avatar
2016-04-21 11:32 vboctor Changeset attached => MantisBT master 341e1baf
2016-06-12 00:42 vboctor Status resolved => closed