Import user thumbnailPhoto from Active-Directory

Infos:

  • Used Zammad version: 5.3.1-1677147662.62001c62.bullseye
  • Used Zammad installation type: (source, package, docker-compose, …)
  • Operating system: Debian GNU/Linux 11 (bullseye)
  • Browser + version: -

Expected behavior:

  • Updated Avatar images from Active-Directory thumbnailPhoto attribute

Actual behavior:

Can't fetch image for '[xxx@xxx.xxx.de](mailto:xxx@xxx.xxx.de)' (maybe no avatar available), http code: 404
Can't fetch image for '[xxx@xxx.xxx.de](mailto:xxx@xxx.xxx.de)' (maybe no avatar available), http code: 404
Can't fetch image for '[xxx@xxx.xxx.de](mailto:xxx@xxx.xxx.de)' (maybe no avatar available), http code: 404
Can't fetch image for '[xxx@xxx.xxx.de](mailto:xxx@xxx.xxx.de)' (maybe no avatar available), http code: 404
...

Steps to reproduce the behavior:

ExternalSync.where(source: 'Ldap::User').pluck(:o_id).each do |user_id|
  user = User.lookup(id: user_id)
  next if user.blank?

  avatar = Avatar.auto_detection(
    object:        'User',
    o_id:          user.id,
    url:           user.email,
    source:        'app',
    updated_by_id: user.updated_by_id,
    created_by_id: user.updated_by_id,
  )

  next if !avatar

  user.update!(image: avatar.store_hash)
end

Hi,

I tried the code from Zammad image service does not replace avatars (LDAP) · Issue #3358 · zammad/zammad (github.com), and I do get an error that the image from Active-Directory could not be found. I don’t know where the problem is.

One image gets successfully imported from LDAP. I checked the image (size, width, and height) and could not find a difference from the other user images. But I discovered that it is not the image from the Attribute thumbnailPhoto. I don’t know where this image comes from… However, I would like to sync the attribute thumbnailPhoto from Active-Directory with Zammd Avatar images.

It would be great to get some feedback.

And I would like a say big thanks for all your work! Zammad is fantastic and works incredibly great for us!!

Or is it possible to set a user image with the Zammad API. I don’t know how to set the body to upload the image.

1 Like

Ok. I used the API to solve the avatar upload. It took way too much time, but it works.

See here: Using Zammd API for Avatar upload - Technical assistance - Zammad - Community

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.