fix domain listing for admin-domains
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -64,47 +64,20 @@ if ($page == 'domains' || $page == 'overview') {
|
|||||||
$arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
|
$arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
|
||||||
$searchcode = $paging->getHtmlSearchCode($lng);
|
$searchcode = $paging->getHtmlSearchCode($lng);
|
||||||
$pagingcode = $paging->getHtmlPagingCode($filename . '?page=' . $page . '&s=' . $s);
|
$pagingcode = $paging->getHtmlPagingCode($filename . '?page=' . $page . '&s=' . $s);
|
||||||
$domain_array = array();
|
|
||||||
|
|
||||||
foreach ($result['list'] as $row) {
|
|
||||||
|
|
||||||
formatDomainEntry($row, $idna_convert);
|
|
||||||
|
|
||||||
if (! isset($domain_array[$row['domain']])) {
|
|
||||||
$domain_array[$row['domain']] = $row;
|
|
||||||
} else {
|
|
||||||
$domain_array[$row['domain']] = array_merge($row, $domain_array[$row['domain']]);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isset($row['aliasdomainid']) && $row['aliasdomainid'] != null && isset($row['aliasdomain']) && $row['aliasdomain'] != '') {
|
|
||||||
if (! isset($domain_array[$row['aliasdomain']])) {
|
|
||||||
$domain_array[$row['aliasdomain']] = array();
|
|
||||||
}
|
|
||||||
$domain_array[$row['aliasdomain']]['domainaliasid'] = $row['id'];
|
|
||||||
$domain_array[$row['aliasdomain']]['domainalias'] = $row['domain'];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* We need ksort/krsort here to make sure idna-domains are also sorted correctly
|
|
||||||
*/
|
|
||||||
if ($paging->sortfield == 'd.domain' && $paging->sortorder == 'asc') {
|
|
||||||
ksort($domain_array);
|
|
||||||
} elseif ($paging->sortfield == 'd.domain' && $paging->sortorder == 'desc') {
|
|
||||||
krsort($domain_array);
|
|
||||||
}
|
|
||||||
|
|
||||||
$count = 0;
|
$count = 0;
|
||||||
foreach ($domain_array as $row) {
|
foreach ($result['list'] as $row) {
|
||||||
|
formatDomainEntry($row, $idna_convert);
|
||||||
if (isset($row['domain']) && $row['domain'] != '') {
|
$row['customername'] = \Froxlor\User::getCorrectFullUserDetails($row);
|
||||||
$row['customername'] = \Froxlor\User::getCorrectFullUserDetails($row);
|
$row = \Froxlor\PhpHelper::htmlentitiesArray($row);
|
||||||
$row = \Froxlor\PhpHelper::htmlentitiesArray($row);
|
// display a nice list of IP's if it's not an alias for another domain
|
||||||
// display a nice list of IP's
|
if (isset($row['aliasdomainid']) && $row['aliasdomainid'] != null && isset($row['aliasdomain']) && $row['aliasdomain'] != '') {
|
||||||
|
$row['ipandport'] = sprintf($lng['domains']['isaliasdomainof'], $row['aliasdomain']);
|
||||||
|
} else {
|
||||||
$row['ipandport'] = str_replace("\n", "<br />", $row['ipandport']);
|
$row['ipandport'] = str_replace("\n", "<br />", $row['ipandport']);
|
||||||
eval("\$domains.=\"" . \Froxlor\UI\Template::getTemplate("domains/domains_domain") . "\";");
|
|
||||||
$count ++;
|
|
||||||
}
|
}
|
||||||
|
eval("\$domains.=\"" . \Froxlor\UI\Template::getTemplate("domains/domains_domain") . "\";");
|
||||||
|
$count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
$domainscount = $paging->getEntries();
|
$domainscount = $paging->getEntries();
|
||||||
|
|||||||
@@ -540,7 +540,7 @@ class IpsAndPorts extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour
|
|||||||
));
|
));
|
||||||
|
|
||||||
$result_checkdomain_stmt = Database::prepare("
|
$result_checkdomain_stmt = Database::prepare("
|
||||||
SELECT `id_domain` as `id` FROM `" . TABLE_DOMAINTOIP . "` WHERE `id_ipandports` = :id
|
SELECT `id_domain` FROM `" . TABLE_DOMAINTOIP . "` WHERE `id_ipandports` = :id
|
||||||
");
|
");
|
||||||
$result_checkdomain = Database::pexecute_first($result_checkdomain_stmt, array(
|
$result_checkdomain = Database::pexecute_first($result_checkdomain_stmt, array(
|
||||||
'id' => $id
|
'id' => $id
|
||||||
|
|||||||
@@ -2079,3 +2079,4 @@ $lng['admin']['ownsslvhostsettings'] = 'Own SSL vHost-settings';
|
|||||||
$lng['admin']['ipsandports']['ssl_default_vhostconf_domain'] = 'Default SSL vHost-settings for every domain container';
|
$lng['admin']['ipsandports']['ssl_default_vhostconf_domain'] = 'Default SSL vHost-settings for every domain container';
|
||||||
$lng['customer']['total_diskspace'] = 'Total diskspace (MiB)';
|
$lng['customer']['total_diskspace'] = 'Total diskspace (MiB)';
|
||||||
$lng['admin']['domain_override_tls'] = 'Override system TLS settings';
|
$lng['admin']['domain_override_tls'] = 'Override system TLS settings';
|
||||||
|
$lng['domains']['isaliasdomainof'] = 'Is aliasdomain for %s';
|
||||||
|
|||||||
@@ -1726,3 +1726,4 @@ $lng['admin']['ownsslvhostsettings'] = 'Eigene SSL vHost-Einstellungen';
|
|||||||
$lng['admin']['ipsandports']['ssl_default_vhostconf_domain'] = 'Standard SSL vHost-Einstellungen für jeden Domain-Container';
|
$lng['admin']['ipsandports']['ssl_default_vhostconf_domain'] = 'Standard SSL vHost-Einstellungen für jeden Domain-Container';
|
||||||
$lng['customer']['total_diskspace'] = 'Gesamtspeicherplatz (MiB)';
|
$lng['customer']['total_diskspace'] = 'Gesamtspeicherplatz (MiB)';
|
||||||
$lng['admin']['domain_override_tls'] = 'Überschreibe System TLS Einstellungen';
|
$lng['admin']['domain_override_tls'] = 'Überschreibe System TLS Einstellungen';
|
||||||
|
$lng['domains']['isaliasdomainof'] = 'Ist Aliasdomain für %s';
|
||||||
|
|||||||
@@ -41,8 +41,5 @@
|
|||||||
</a>
|
</a>
|
||||||
</if>
|
</if>
|
||||||
</if>
|
</if>
|
||||||
<if isset($row['domainaliasid']) && $row['domainaliasid'] != 0>
|
|
||||||
<a href="{$linker->getLink(array('section' => 'domains', 'page' => $page, 'searchfield' => 'd.aliasdomain', 'searchtext' => $row['id']))}">{$lng['domains']['hasaliasdomains']}</a>
|
|
||||||
</if>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
Reference in New Issue
Block a user