From 1c653c7cb1f588ed72fe2f87e9f9cd4dd22e4b06 Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Sun, 16 Oct 2022 09:29:32 +0200 Subject: [PATCH] only show link to customer when user is admin in Domain::domainWithCustomerLink callback Signed-off-by: Michael Kaufmann --- lib/Froxlor/UI/Callbacks/Domain.php | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/lib/Froxlor/UI/Callbacks/Domain.php b/lib/Froxlor/UI/Callbacks/Domain.php index 80a82e57..c35d4b60 100644 --- a/lib/Froxlor/UI/Callbacks/Domain.php +++ b/lib/Froxlor/UI/Callbacks/Domain.php @@ -36,13 +36,15 @@ class Domain { $linker = UI::getLinker(); $result = '' . $attributes['data'] . ''; - $result .= ' (' . $attributes['fields']['loginname'] . ')'; + if ((int)UI::getCurrentUser()['adminsession'] == 1) { + $result .= ' (' . $attributes['fields']['loginname'] . ')'; + } return $result; } @@ -185,12 +187,12 @@ class Domain // shared certificates (e.g. subdomain if domain where certificate is specified) elseif ($attributes['fields']['domain_hascert'] == 2) { $result['icon'] .= ' text-warning'; - $result['title'] .= "\n".lng('panel.ssleditor_infoshared'); + $result['title'] .= "\n" . lng('panel.ssleditor_infoshared'); } // no certificate specified, using global fallbacks (IPs and Ports or if empty SSL settings) elseif ($attributes['fields']['domain_hascert'] == 0) { $result['icon'] .= ' text-danger'; - $result['title'] .= "\n".lng('panel.ssleditor_infoglobal'); + $result['title'] .= "\n" . lng('panel.ssleditor_infoglobal'); } $result['visible'] = [Domain::class, 'canEditSSL']; @@ -203,7 +205,7 @@ class Domain if (isset($attributes['fields']['ipsandports']) && !empty($attributes['fields']['ipsandports'])) { $iplist = ""; foreach ($attributes['fields']['ipsandports'] as $ipport) { - $iplist .= $ipport['ip'].':'.$ipport['port'].'
'; + $iplist .= $ipport['ip'] . ':' . $ipport['port'] . '
'; } return $iplist; }