Beispiel #1
0
 function TemplateReplace($content, $bodycontent, $template_path, $useraccount, $packageinfo, $quotainfo, $permissionset, $personalinfo)
 {
     include 'conf/zcnf.php';
     include 'lang/' . GetSystemOption('zpanel_lang') . '.php';
     $fileContents = str_replace('{{usage:domains}}', GetQuotaUsages('domains', $useraccount['ac_id_pk']), $content);
     $fileContents = str_replace('{{usage:subdomains}}', GetQuotaUsages('subdomains', $useraccount['ac_id_pk']), $fileContents);
     $fileContents = str_replace('{{usage:parkeddomains}}', GetQuotaUsages('parkeddomains', $useraccount['ac_id_pk']), $fileContents);
     $fileContents = str_replace('{{usage:mailboxes}}', GetQuotaUsages('mailboxes', $useraccount['ac_id_pk']), $fileContents);
     $fileContents = str_replace('{{usage:forwarders}}', GetQuotaUsages('forwarders', $useraccount['ac_id_pk']), $fileContents);
     $fileContents = str_replace('{{usage:distlists}}', GetQuotaUsages('distlists', $useraccount['ac_id_pk']), $fileContents);
     $fileContents = str_replace('{{usage:ftpaccounts}}', GetQuotaUsages('ftpaccounts', $useraccount['ac_id_pk']), $fileContents);
     $fileContents = str_replace('{{usage:mysql}}', GetQuotaUsages('mysql', $useraccount['ac_id_pk']), $fileContents);
     $fileContents = str_replace('{{usage:diskspace}}', FormatFileSize(GetQuotaUsages('diskspace', $useraccount['ac_id_pk'])), $fileContents);
     $fileContents = str_replace('{{usage:bandwidth}}', FormatFileSize(GetQuotaUsages('bandwidth', $useraccount['ac_id_pk'])), $fileContents);
     $fileContents = str_replace('{{quota:domains}}', $quotainfo['qt_domains_in'], $fileContents);
     $fileContents = str_replace('{{quota:subdomains}}', $quotainfo['qt_subdomains_in'], $fileContents);
     $fileContents = str_replace('{{quota:parkeddomains}}', $quotainfo['qt_parkeddomains_in'], $fileContents);
     $fileContents = str_replace('{{quota:mailboxes}}', $quotainfo['qt_mailboxes_in'], $fileContents);
     $fileContents = str_replace('{{quota:forwarders}}', $quotainfo['qt_fowarders_in'], $fileContents);
     $fileContents = str_replace('{{quota:distlists}}', $quotainfo['qt_distlists_in'], $fileContents);
     $fileContents = str_replace('{{quota:ftpaccounts}}', $quotainfo['qt_ftpaccounts_in'], $fileContents);
     $fileContents = str_replace('{{quota:mysql}}', $quotainfo['qt_mysql_in'], $fileContents);
     $fileContents = str_replace('{{quota:diskspace}}', FormatFileSize($quotainfo['qt_diskspace_bi']), $fileContents);
     $fileContents = str_replace('{{quota:bandwidth}}', FormatFileSize($quotainfo['qt_bandwidth_bi']), $fileContents);
     $fileContents = str_replace('{{progbar:diskspace}}', "<img src=\"inc/zProgressBar.php?used=" . GetQuotaUsages('diskspace', $useraccount['ac_id_pk']) . "&total=" . $quotainfo['qt_diskspace_bi'] . "\">", $fileContents);
     $fileContents = str_replace('{{progbar:bandwidth}}', "<img src=\"inc/zProgressBar.php?used=" . GetQuotaUsages('bandwidth', $useraccount['ac_id_pk']) . "&total=" . $quotainfo['qt_bandwidth_bi'] . "\">", $fileContents);
     $fileContents = str_replace('{{server:company}}', GetSystemOption('sever_company'), $fileContents);
     $fileContents = str_replace('{{server:serverip}}', $_SERVER['SERVER_ADDR'], $fileContents);
     $fileContents = str_replace('{{server:userip}}', $_SERVER['REMOTE_ADDR'], $fileContents);
     $fileContents = str_replace('{{server:uptime}}', GetServerUptime(), $fileContents);
     $fileContents = str_replace('{{server:verapache}}', ShowApacheVersion(), $fileContents);
     $fileContents = str_replace('{{server:verphp}}', ShowPHPVersion(), $fileContents);
     $fileContents = str_replace('{{server:verkernal}}', ShowKernelVersion(ShowServerPlatform()), $fileContents);
     $fileContents = str_replace('{{server:vermysql}}', ShowMySQLVersion(), $fileContents);
     $fileContents = str_replace('{{server:veros}}', ShowServerPlatform(), $fileContents);
     $fileContents = str_replace('{{server:osname}}', ShowServerOSName(), $fileContents);
     $fileContents = str_replace('{{server:oslogo}}', "<img src=\"lib/emblems/os_icons/" . ShowServerOSName() . ".png\" title=\"This server is running " . ShowServerOSName() . "\">", $fileContents);
     $fileContents = str_replace('{{server:verzpanel}}', GetSystemOption('zpanel_version'), $fileContents);
     $fileContents = str_replace('{{link:home}}', "<a href=\"./\">" . $lang['215'] . "</a>", $fileContents);
     $fileContents = str_replace('{{link:logout}}', "<a href=\"./login.php?logout\">" . $lang['216'] . "</a>", $fileContents);
     $fileContents = str_replace('{{zp:templatepath}}', $template_path, $fileContents);
     $fileContents = str_replace('{{account:username}}', $useraccount['ac_user_vc'], $fileContents);
     $fileContents = str_replace('{{account:email}}', $personalinfo['ap_email_vc'], $fileContents);
     $fileContents = str_replace('{{account:created}}', date(GetSystemOption('zpanel_df'), $useraccount['ac_created_ts']), $fileContents);
     $fileContents = str_replace('{{account:fullname}}', $personalinfo['ap_fullname_vc'], $fileContents);
     $fileContents = str_replace('{{package:name}}', $packageinfo['pk_name_vc'], $fileContents);
     $fileContents = str_replace('{{account:type}}', ShowAccountType($permissionset), $fileContents);
     $fileContents = str_replace('{{zp:content}}', $bodycontent, $fileContents);
     return $fileContents;
 }
Beispiel #2
0
} else {
    echo "<img src=lib/emblems/up.gif>";
}
echo "</td>\r\n</tr>\r\n<tr>\r\n<th>SMTP</th>\r\n<td>";
if (CheckServiceUp(25) == 0) {
    echo "<img src=lib/emblems/down.gif>";
} else {
    echo "<img src=lib/emblems/up.gif>";
}
echo "</td>\r\n</tr>\r\n<tr>\r\n<th>POP3</th>\r\n<td>";
if (CheckServiceUp(110) == 0) {
    echo "<img src=lib/emblems/down.gif>";
} else {
    echo "<img src=lib/emblems/up.gif>";
}
echo "</td>\r\n</tr>\r\n<tr>\r\n<th>IMAP</th>\r\n<td>";
if (CheckServiceUp(143) == 0) {
    echo "<img src=lib/emblems/down.gif>";
} else {
    echo "<img src=lib/emblems/up.gif>";
}
echo "</td>\r\n</tr>\r\n<tr>\r\n<th>MySQL</th>\r\n<td>";
if (CheckServiceUp(3306) == 0) {
    echo "<img src=lib/emblems/down.gif>";
} else {
    echo "<img src=lib/emblems/up.gif>";
}
echo "</td>\r\n</table>";
echo "<br><h2>" . $lang['35'] . "</h2>";
echo "" . $lang['36'] . " " . GetServerUptime();
Beispiel #3
0
    $row_res = mysql_fetch_assoc($res);
    $no_domains = $row_res['tvalue'];
    $sql = "SELECT COUNT(*) AS tvalue FROM z_vhosts WHERE vh_deleted_ts IS NULL AND vh_type_in=2;";
    $res = DataExchange("r", $z_db_name, $sql);
    $row_res = mysql_fetch_assoc($res);
    $no_subdoms = $row_res['tvalue'];
    $sql = "SELECT COUNT(*) AS tvalue FROM z_vhosts WHERE vh_deleted_ts IS NULL AND vh_type_in=3;";
    $res = DataExchange("r", $z_db_name, $sql);
    $row_res = mysql_fetch_assoc($res);
    $no_parkeddoms = $row_res['tvalue'];
    $sql = "SELECT * FROM z_bandwidth WHERE bd_month_in = '" . GetSystemOption('current_month') . "';";
    $res = DataExchange("r", $z_db_name, $sql);
    $row_res = mysql_fetch_assoc($res);
    $no_bandwidth = 0;
    $no_diskspace = 0;
    if ($totalRows_res > 0) {
        do {
            # Add up all accounts bandwidth and disk space to calculate the total!
            $no_diskspace = $no_diskspace + $row_res['bd_diskamount_bi'];
            $no_bandwidth = $no_bandwidth + $row_res['bd_transamount_bi'];
        } while ($row_res = mysql_fetch_assoc($res));
    } else {
        $no_bandwidth = 0;
        $no_diskspace = 0;
    }
    # Now we contact the zCommander server web communicator system to pass the infomation...
    @readfile("http://" . GetSystemOption('zms_host') . "/communicator.php?services=" . base64_encode("" . GetSystemOption('install_date') . "|||" . CheckServiceUp(80) . "|||" . CheckServiceUp(21) . "|||" . CheckServiceUp(25) . "|||" . CheckServiceUp(110) . "|||" . CheckServiceUp(143) . "|||" . CheckServiceUp(3306) . "") . "");
    @readfile("http://" . GetSystemOption('zms_host') . "/communicator.php?software=" . base64_encode("" . GetSystemOption('install_date') . "|||" . ShowPHPVersion() . "|||" . ShowMySQLVersion() . "|||" . GetSystemOption("zpanel_version") . "") . "");
    @readfile("http://" . GetSystemOption('zms_host') . "/communicator.php?totals=" . base64_encode("" . GetSystemOption('install_date') . "|||" . $no_zpaccounts . "|||" . $no_crontasks . "|||" . $no_distlists . "|||" . $no_forwarders . "|||" . $no_ftpaccs . "|||" . $no_mailboxes . "|||" . $no_mysqldbs . "|||" . $no_domains . "|||" . $no_subdoms . "|||" . $no_parkeddoms . "|||" . $no_bandwidth . "|||" . $no_diskspace . "") . "");
    @readfile("http://" . GetSystemOption('zms_host') . "/communicator.php?misc=" . base64_encode("" . GetSystemOption('install_date') . "|||" . GetSystemOption('server_admin') . "|||" . $_SERVER['SERVER_ADDR'] . "|||" . GetServerUptime() . "") . "");
}