diff --git a/src/DataTables/LogDataTable.php b/src/DataTables/LogDataTable.php
index 1cb77e3d..5d105035 100644
--- a/src/DataTables/LogDataTable.php
+++ b/src/DataTables/LogDataTable.php
@@ -234,8 +234,9 @@ class LogDataTable implements DataTableTypeInterface
$img_url = $this->userAvatarHelper->getAvatarSmURL($user);
return sprintf(
- '
%s',
+ '
%s',
$img_url,
+ $this->userAvatarHelper->getAvatarMdURL($user),
$this->urlGenerator->generate('user_info', ['id' => $user->getID()]),
htmlentities($user->getFullName(true))
);
diff --git a/src/Services/UserSystem/UserAvatarHelper.php b/src/Services/UserSystem/UserAvatarHelper.php
index 80ad5d00..95b94dca 100644
--- a/src/Services/UserSystem/UserAvatarHelper.php
+++ b/src/Services/UserSystem/UserAvatarHelper.php
@@ -94,6 +94,27 @@ class UserAvatarHelper
}
}
+ public function getAvatarMdURL(User $user): string
+ {
+ //Check if the user has a master attachment defined (meaning he has explicitly defined a profile picture)
+ if ($user->getMasterPictureAttachment() !== null) {
+ return $this->attachmentURLGenerator->getThumbnailURL($user->getMasterPictureAttachment(), 'thumbnail_sm');
+ }
+
+ //If not check if gravatar is enabled (then use gravatar URL)
+ if ($this->use_gravatar) {
+ return $this->getGravatar($user, 150);
+ }
+
+ try {
+ //Otherwise we can serve the relative path via Asset component
+ return $this->filterService->getUrlOfFilteredImage('/img/default_avatar.png', 'thumbnail_xs');
+ } catch (\Imagine\Exception\RuntimeException $e) {
+ //If the filter fails, we can not serve the thumbnail and fall back to the original image and log an warning
+ return $this->packages->getUrl('/img/default_avatar.png');
+ }
+ }
+
/**
* Get either a Gravatar URL or complete image tag for a specified email address.
diff --git a/templates/helper.twig b/templates/helper.twig
index 8aa78be3..f7a259bc 100644
--- a/templates/helper.twig
+++ b/templates/helper.twig
@@ -169,7 +169,7 @@
{% endmacro %}
{% macro user_icon(user) %}
-
+
{% endmacro %}
{% macro parameters_table(parameters) %}