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:
@@ -36,6 +36,7 @@ class Domain
|
|||||||
{
|
{
|
||||||
$linker = UI::getLinker();
|
$linker = UI::getLinker();
|
||||||
$result = '<a href="https://' . $attributes['data'] . '" target="_blank">' . $attributes['data'] . '</a>';
|
$result = '<a href="https://' . $attributes['data'] . '" target="_blank">' . $attributes['data'] . '</a>';
|
||||||
|
if ((int)UI::getCurrentUser()['adminsession'] == 1) {
|
||||||
$result .= ' (<a href="' . $linker->getLink([
|
$result .= ' (<a href="' . $linker->getLink([
|
||||||
'section' => 'customers',
|
'section' => 'customers',
|
||||||
'page' => 'customers',
|
'page' => 'customers',
|
||||||
@@ -43,6 +44,7 @@ class Domain
|
|||||||
'sort' => $attributes['fields']['loginname'],
|
'sort' => $attributes['fields']['loginname'],
|
||||||
'id' => $attributes['fields']['customerid'],
|
'id' => $attributes['fields']['customerid'],
|
||||||
]) . '">' . $attributes['fields']['loginname'] . '</a>)';
|
]) . '">' . $attributes['fields']['loginname'] . '</a>)';
|
||||||
|
}
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -185,12 +187,12 @@ class Domain
|
|||||||
// shared certificates (e.g. subdomain if domain where certificate is specified)
|
// shared certificates (e.g. subdomain if domain where certificate is specified)
|
||||||
elseif ($attributes['fields']['domain_hascert'] == 2) {
|
elseif ($attributes['fields']['domain_hascert'] == 2) {
|
||||||
$result['icon'] .= ' text-warning';
|
$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)
|
// no certificate specified, using global fallbacks (IPs and Ports or if empty SSL settings)
|
||||||
elseif ($attributes['fields']['domain_hascert'] == 0) {
|
elseif ($attributes['fields']['domain_hascert'] == 0) {
|
||||||
$result['icon'] .= ' text-danger';
|
$result['icon'] .= ' text-danger';
|
||||||
$result['title'] .= "\n".lng('panel.ssleditor_infoglobal');
|
$result['title'] .= "\n" . lng('panel.ssleditor_infoglobal');
|
||||||
}
|
}
|
||||||
|
|
||||||
$result['visible'] = [Domain::class, 'canEditSSL'];
|
$result['visible'] = [Domain::class, 'canEditSSL'];
|
||||||
@@ -203,7 +205,7 @@ class Domain
|
|||||||
if (isset($attributes['fields']['ipsandports']) && !empty($attributes['fields']['ipsandports'])) {
|
if (isset($attributes['fields']['ipsandports']) && !empty($attributes['fields']['ipsandports'])) {
|
||||||
$iplist = "";
|
$iplist = "";
|
||||||
foreach ($attributes['fields']['ipsandports'] as $ipport) {
|
foreach ($attributes['fields']['ipsandports'] as $ipport) {
|
||||||
$iplist .= $ipport['ip'].':'.$ipport['port'].'<br>';
|
$iplist .= $ipport['ip'] . ':' . $ipport['port'] . '<br>';
|
||||||
}
|
}
|
||||||
return $iplist;
|
return $iplist;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user