Here's another version I wrote up. It's based on WHMCS 4.1.2 version of the template. It turns off the PHP Info link, and adds a few extras (basically the same ones as the other script). It's a little bit shorter and cleaner, as it keeps all of the template code separate, it also loads the existing login.tpl so you don't have to maintain it in an additional place.
Also, if you want to turn off the PHP Info, don't forget to edit the status/index.php file too. Someone can still access the PHP info by going to /status/index.php?action=phpinfo unless you comment out the phpinfo line in the file by putting a // in front of phpinfo();.
PHP Code:
{php}
$query = "SELECT DISTINCT tblservers.name FROM `tblservers` JOIN `tblhosting` ON tblhosting.server=tblservers.id WHERE tblhosting.userid='".$_SESSION["uid"]."' AND tblhosting.domainstatus='Active'";
$result = mysql_query($query);
$servers_new = array();
$server_names = array();
while ($data = mysql_fetch_array($result,MYSQL_ASSOC)) {
$server_names[] .= $data['name'];
}
$servers_old = $this->_tpl_vars[servers];
foreach ($servers_old AS $key=>$value) {
if (in_array($value['name'],$server_names)) $servers_new[] = $value;
}
$this->clear_assign('servers');
$this->assign('servers',$servers_new);
{/php}
{if $loggedin}
<p>{$LANG.serverstatusheadingtext}</p>
<table width="100%" border="0" align="center" cellpadding="10" cellspacing="0" class="data">
<tr>
<th>{$LANG.servername}</th>
<th>HTTP</th>
<th>FTP</th>
<th>POP3</th>
<th>IMAP</th>
<th>SMTP</th>
<th>cPanel</th>
<th>{$LANG.serverstatusserverload}</th>
<th>{$LANG.serverstatusuptime}</th>
</tr>
{foreach key=num item=server from=$servers}
<tr>
<td>{$server.name}</td>
<td>{get_port_status num="$num" port="80"}</td>
<td>{get_port_status num="$num" port="21"}</td>
<td>{get_port_status num="$num" port="110"}</td>
<td>{get_port_status num="$num" port="143"}</td>
<td>{get_port_status num="$num" port="25"}</td>
<td>{get_port_status num="$num" port="2082"}</td>
<td>{$server.serverload}</td>
<td>{$server.uptime}</td>
</tr>
{foreachelse}
<tr>
<td colspan="8">{$LANG.serverstatusnoservers}</td>
</tr>
{/foreach}
</table><br />
{else}
{assign var='formaction' value='dologin.php?goto=serverstatus'}
{include file="$template/login.tpl"}
{/if}
Redrat, thanks for the script. I'm not trying to steal your thunder, just offer another method. Thanks for the inspiration and some really good ideas.