fix ajax responses; re-add statistics link to main-domains for customers

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2022-04-22 13:52:08 +02:00
parent 8c1621cced
commit 68fcfd2cf5
3 changed files with 15 additions and 5 deletions

View File

@@ -63,7 +63,16 @@ class Domain
public static function domainExternalLink(array $attributes)
{
return '<a href="http://' . $attributes['data'] . '" target="_blank">' . $attributes['data'] . '</a>';
$result = '<a href="http://' . $attributes['data'] . '" target="_blank">' . $attributes['data'] . '</a>';
// check for statistics if parentdomainid==0 to show stats-link for customers
if ((int) UI::getCurrentUser()['adminsession'] == 0 && $attributes['fields']['parentdomainid'] == 0) {
$statsapp = 'webalizer';
if (Settings::Get('system.awstats_enabled') == '1') {
$statsapp = 'awstats';
}
$result .= ' <a href="http://' . $attributes['data'] . '/' . $statsapp . '" rel="external" title="' . UI::getLng('domains.statstics') . '"><i class="fa-solid fa-chart-line text-secondary"></i></a>';
}
return $result;
}
public static function canEdit(array $attributes): bool