show std-subdomain (if any) to customer on the dashboard, fixes #1297

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p)
2013-11-28 13:07:53 +01:00
parent 4426ab52d3
commit 6f61c7b5e7
3 changed files with 27 additions and 2 deletions

View File

@@ -49,8 +49,8 @@ if ($page == 'overview') {
$domain_stmt = Database::prepare("SELECT `domain` FROM `" . TABLE_PANEL_DOMAINS . "` $domain_stmt = Database::prepare("SELECT `domain` FROM `" . TABLE_PANEL_DOMAINS . "`
WHERE `customerid` = :customerid WHERE `customerid` = :customerid
AND `parentdomainid` = '0' AND `parentdomainid` = '0'
AND `id` <> :standardsubdomain" AND `id` <> :standardsubdomain
); ");
Database::pexecute($domain_stmt, array("customerid" => $userinfo['customerid'], "standardsubdomain" => $userinfo['standardsubdomain'])); Database::pexecute($domain_stmt, array("customerid" => $userinfo['customerid'], "standardsubdomain" => $userinfo['standardsubdomain']));
$domains = ''; $domains = '';
@@ -62,6 +62,19 @@ if ($page == 'overview') {
natsort($domainArray); natsort($domainArray);
$domains = implode(',<br />', $domainArray); $domains = implode(',<br />', $domainArray);
// standard-subdomain
$stdsubdomain = '';
if ($userinfo['standardsubdomain'] != '0') {
$std_domain_stmt = Database::prepare("
SELECT `domain` FROM `" . TABLE_PANEL_DOMAINS . "`
WHERE `customerid` = :customerid
AND `id` = :standardsubdomain
");
$std_domain = Database::pexecute_first($std_domain_stmt, array("customerid" => $userinfo['customerid'], "standardsubdomain" => $userinfo['standardsubdomain']));
$stdsubdomain = $std_domain['domain'];
}
$userinfo['email'] = $idna_convert->decode($userinfo['email']); $userinfo['email'] = $idna_convert->decode($userinfo['email']);
$yesterday = time() - (60 * 60 * 24); $yesterday = time() - (60 * 60 * 24);
$month = date('M Y', $yesterday); $month = date('M Y', $yesterday);

View File

@@ -21,6 +21,12 @@ $header
<td>{$lng['customer']['domains']}:</td> <td>{$lng['customer']['domains']}:</td>
<td>$domains</td> <td>$domains</td>
</tr> </tr>
<if $stdsubdomain != ''>
<tr>
<td>{$lng['admin']['stdsubdomain']}:</td>
<td>$stdsubdomain</td>
</tr>
</if>
<tr> <tr>
<td>{$lng['customer']['subdomains']} ({$lng['customer']['usedmax']}):</td> <td>{$lng['customer']['subdomains']} ({$lng['customer']['usedmax']}):</td>
<td>{$userinfo['subdomains_used']}/{$userinfo['subdomains']}</td> <td>{$userinfo['subdomains_used']}/{$userinfo['subdomains']}</td>

View File

@@ -188,6 +188,12 @@ $header
<td>{$lng['customer']['domains']}:</td> <td>{$lng['customer']['domains']}:</td>
<td>$domains</td> <td>$domains</td>
</tr> </tr>
<if $stdsubdomain != ''>
<tr>
<td>{$lng['admin']['stdsubdomain']}:</td>
<td>$stdsubdomain</td>
</tr>
</if>
<tr> <tr>
<td>{$lng['customer']['services']}:</td> <td>{$lng['customer']['services']}:</td>
<td>$services_enabled</td> <td>$services_enabled</td>