only show link to customer when user is admin in Domain::domainWithCustomerLink callback

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2022-10-16 09:29:32 +02:00
parent 4003c53dc4
commit 1c653c7cb1

View File

@@ -36,6 +36,7 @@ class Domain
{
$linker = UI::getLinker();
$result = '<a href="https://' . $attributes['data'] . '" target="_blank">' . $attributes['data'] . '</a>';
if ((int)UI::getCurrentUser()['adminsession'] == 1) {
$result .= ' (<a href="' . $linker->getLink([
'section' => 'customers',
'page' => 'customers',
@@ -43,6 +44,7 @@ class Domain
'sort' => $attributes['fields']['loginname'],
'id' => $attributes['fields']['customerid'],
]) . '">' . $attributes['fields']['loginname'] . '</a>)';
}
return $result;
}