Location: PHPKode > projects > web-cp - Web Hosting Control Panel > webcp/web/domain/tips.phps
<div align="center">
	<table border="0" cellspacing="0" cellpadding="0" width=350>
		<tr>
			<td colspan="5" class="tbltop"><b>&nbsp;<?=$T['Tips & Tools'];?>&nbsp;</b></td>
		</tr>
	</table>
	<table border="0" cellspacing="0" cellpadding="8" width=350>
		<tr class="row1">
			<td align=center width="25%"><b><? if ($cfg['prog']['traceroute'] != "") { ?><a href='?url=tips&cp=domain&tool=tracert'><? } ?><img border=0 src='icon/tracert.gif'><br><?=$T['Traceroute'];?></a></b></td>
			<td align=center width="25%"><b><? if ($cfg['prog']['ping'] != "") { ?><a href='?url=tips&cp=domain&tool=ping'><? } ?><img border=0 src='icon/ping.gif'><br><?=$T['Ping'];?></a></b></td>
			<td align=center width="25%"><b><? if ($cfg['prog']['whois'] != "") { ?><a href='?url=tips&cp=domain&tool=whois'><? } ?><img border=0 src='icon/whois.gif'><br><?=$T['Whois'];?></a></b></td>
			<td align=center width="25%"><b><? if ($cfg['prog']['dig'] != "") { ?><a href='?url=tips&cp=domain&tool=dig'><? } ?><img border=0 src='icon/whois.gif'><br><?=$T['Dig'];?></a></b></td>
		</tr>
		<tr class="row1">
			<td align=center width="25%"><b><a href='?url=tips&cp=domain&tool=modules'><img border=0 src='icon/modules.gif'><br><?=$T['List Modules'];?></a></b></td>
			<td align=center width="25%"><b><a href='?url=tips&cp=domain&tool=access_log'><img border=0 src='icon/log34.gif'><br><?=$T['Access Log'];?></a></b></td>
			<td align=center width="25%"><b><a href='?url=tips&cp=domain&tool=error_log'><img border=0 src='icon/errorlog34.gif'><br><?=$T['Error Log'];?></a></b></td>
			<td></td>
		</tr>
	</table>
	</div>
	<br>
<?
switch ($tool) {
	case "error_log":
		$logdir = $cfg['webdir']."/".$domaindata["domain"]."/".$domaindata["host"]."/logs";
		if ($cfg['ftpsysname'] == "localhost") {
			$logfile = $logdir."/error";
			$filelocation = tempnam("/tmp", "LOG");
			copy($logfile, $filelocation);
			?>
		<div align="center">
		<table border="0" cellspacing="1">
			<tr>
				<td colspan="2" class="tbltop"><b>&nbsp;<?=$T['Error Log'];?>&nbsp;</b></td>
			</tr>
			<tr class="row1">
				<td valign=top><?=$T['File prepared'];?>: <A href='sendfile.php?filetype=text/plain&filename=error_log.log&removefile=true&filelocation=<?=$filelocation;?>'><?=$T['Download'];?></a></td>
			</tr>
		</table>
		</div>
			<?//}
		} else { ?>
			<div align="center">
		<table border="0" cellspacing="1">
			<tr>
				<td colspan="2" class="tbltop"><b>&nbsp;<?=$T['Error Log'];?>&nbsp;</b></td>
			</tr>
			<tr class="row1">
				<td valign=top><?=$T['Please login via FTP and download this file from the logs directory.'];?></td>
			</tr>
		</table>
		</div>
		<? }
		break;
	case "access_log":
		$logdir = $cfg['webdir']."/".$domaindata["domain"]."/".$domaindata["host"]."/logs";
		if ($cfg['ftpsysname'] == "localhost") {
			$logfile = $logdir."/access";
			$filelocation = tempnam("/tmp", "LOG");
			copy($logfile, $filelocation);
			?>
		<div align="center">
		<table border="0" cellspacing="1">
			<tr>
				<td colspan="2" class="tbltop"><b>&nbsp;<?=$T['Access Log'];?>&nbsp;</b></td>
			</tr>
			<tr class="row1">
				<td valign=top><?=$T['File prepared'];?>: <A href='sendfile.php?filetype=text/plain&filename=access_log.log&removefile=true&filelocation=<?=$filelocation;?>'><?=$T['Download'];?></a></td>
			</tr>
		</table>
		</div>
			<?//}
		} else { ?>
			<div align="center">
		<table border="0" cellspacing="1">
			<tr>
				<td colspan="2" class="tbltop"><b>&nbsp;<?=$T['Access Log'];?>&nbsp;</b></td>
			</tr>
			<tr class="row1">
				<td valign=top><?=$T['Please login via FTP and download this file from the logs directory.'];?></td>
			</tr>
		</table>
		</div>
		<? }
		break;
	case "tracert": ?>
		<div align="center">
		<form action="<?=$current_url;?>" method="post" name="webcp" onSubmit="submitonce(this);">
		<input type=hidden name=tool value='tracert'>
		<table border="0" cellspacing="1">
			<tr>
				<td colspan="2" class="tbltop"><b>&nbsp;<?=$T['Traceroute'];?>&nbsp;</b></td>
			</tr>
			<tr class="row1">
				<td valign=top><input type=textbox name=data[destination]><br>(<?=$T['enter IP address or URL'];?>)</td>
				<td valign=top><input type=submit value="<?=$T['Begin Traceroute'];?>"></td>
			</tr>
		</table>
		</div>
		<? if ($data['destination'] != "") { 
			$data['destination'] = preg_replace("%[^0-9a-zA-Z\.\-]%", "", $data['destination']);	
		?>
		<br>
		<div align="center">
		<table border="0" width=650 cellpadding=0 cellspacing=0>
			<tr>
				<td colspan="1" class="tbltop"><b>&nbsp;<?=$T['Performing traceroute to '];?><?=$data['destination'];?>...&nbsp;</b></td>
			</tr>
		</table>
		<?
		flush();
		ob_flush();
		?>
		<table border="0" width=650 cellpadding=0 cellspacing=0>
			<tr class="row1">
				<td><pre><? 
				system ($cfg['prog']['traceroute']." ".$data['destination']); 
				?></pre></td>
			</tr>
		</table>
		</div>
		<? }
		break;
	case "ping": ?>
		<div align="center">
		<form action="<?=$current_url;?>" method="post" name="webcp" onSubmit="submitonce(this);">
		<input type=hidden name=tool value='ping'>
		<table border="0" cellspacing="1">
			<tr>
				<td colspan="2" class="tbltop"><b>&nbsp;<?=$T['Ping'];?>&nbsp;</b></td>
			</tr>
			<tr class="row1">
				<td valign=top><input type=textbox name=data[destination]><br>(<?=$T['enter IP address or URL'];?>)</td>
				<td valign=top><input type=submit value="<?=$T['Begin Ping'];?>"></td>
			</tr>
		</table>
		</div>
		<? if ($data['destination'] != "") { 
			$data['destination'] = preg_replace("%[^0-9a-zA-Z\.\-]%", "", $data['destination']);	
		?>
		<br>
		<div align="center">
		<table border="0" width=650 cellpadding=0 cellspacing=0>
			<tr>
				<td colspan="1" class="tbltop"><b>&nbsp;<?=$T['Performing ping on '];?><?=$data['destination'];?>...&nbsp;</b></td>
			</tr>
		</table>
		<?
		flush();
		ob_flush();
		?>
		<table border="0" width=650 cellpadding=0 cellspacing=0>
			<tr class="row1">
				<td><pre><? 
				system ($cfg['prog']['ping']." -c 5 ".$data['destination']); 
				?></pre></td>
			</tr>
		</table>
		</div>
		<? }
		break;
	case "whois": ?>
		<div align="center">
		<form action="<?=$current_url;?>" method="post" name="webcp" onSubmit="submitonce(this);">
		<input type=hidden name=tool value='whois'>
		<table border="0" cellspacing="1">
			<tr>
				<td colspan="2" class="tbltop"><b>&nbsp;<?=$T['Whois'];?>&nbsp;</b></td>
			</tr>
			<tr class="row1">
				<td valign=top><input type=textbox name=data[destination]><br>(<?=$T['enter IP address or URL'];?>)</td>
				<td valign=top><input type=submit value="<?=$T['Whois Search'];?>"></td>
			</tr>
		</table>
		</div>
		<? if ($data['destination'] != "") { 
			$data['destination'] = preg_replace("%[^0-9a-zA-Z\.\-]%", "", $data['destination']);	
		?>
		<br>
		<div align="center">
		<table border="0" width=700 cellpadding=0 cellspacing=0>
			<tr>
				<td colspan="1" class="tbltop"><b>&nbsp;<?=$T['Performing whois on '];?><?=$data['destination'];?>...&nbsp;</b></td>
			</tr>
		</table>
		<?
		flush();
		ob_flush();
		?>
		<table border="0" width=700 cellpadding=0 cellspacing=0>
			<tr class="row1">
				<td><pre><? 
				system ($cfg['prog']['whois']." ".$data['destination']); 
				?></pre></td>
			</tr>
		</table>
		</div>
		<? }
		break;
	case "dig": ?>
		<div align="center">
		<form action="<?=$current_url;?>" method="post" name="webcp" onSubmit="submitonce(this);">
		<input type=hidden name=tool value='dig'>
		<table border="0" cellspacing="1">
			<tr>
				<td colspan="2" class="tbltop"><b>&nbsp;<?=$T['Dig'];?>&nbsp;</b></td>
			</tr>
			<tr class="row1">
				<td valign=top><input type=textbox name=data[destination]><br>(<?=$T['enter IP address or URL'];?>)</td>
				<td valign=top><input type=submit value="<?=$T['Begin Dig'];?>"></td>
			</tr>
		</table>
		</div>
		<? if ($data['destination'] != "") { 
			$data['destination'] = preg_replace("%[^0-9a-zA-Z\.\-]%", "", $data['destination']);	
		?>
		<br>
		<div align="center">
		<table border="0" width=700 cellpadding=0 cellspacing=0>
			<tr>
				<td colspan="1" class="tbltop"><b>&nbsp;<?=$T['Performing dig on '];?><?=$data['destination'];?>...&nbsp;</b></td>
			</tr>
		</table>
		<?
		flush();
		ob_flush();
		?>
		<table border="0" width=700 cellpadding=0 cellspacing=0>
			<tr class="row1">
				<td><pre><? 
				system ($cfg['prog']['dig']." ".$data['destination']); 
				?></pre></td>
			</tr>
		</table>
		</div>
		<? }
		break;
	case "modules": ?>
		<div align="center">
		<table border="0" width=300 cellpadding=0 cellspacing=0>
			<tr>
				<td colspan="1" class="tbltop"><b>&nbsp;<?=$T['Loaded PHP Extensions'];?>&nbsp;</b></td>
			</tr>
			<tr class="row1">
				<td><? 
				$res = get_loaded_extensions();
				sort($res);
				for ($i=0; $i<sizeOf($res); $i++) {
					echo "&nbsp;<a ";
					if ($ext == $res[$i]) { echo " name=funcs "; }
					echo "href='".$current_url."&tool=modules&ext=".$res[$i]."#funcs'>".$res[$i]."</a><br>";
					if ($ext == $res[$i]) {
						echo "<ul>";
						$ext = get_extension_funcs($res[$i]);
						for ($j=0; $j<sizeOf($ext); $j++) {
							echo $ext[$j]."<br>";
						}
						echo "</ul>";
					}
				}
				?></td>
			</tr>
		</table>
		<br>
		<? if (function_exists('apache_get_modules')) { ?>
		<table border="0" width=300 cellpadding=0 cellspacing=0>
			<tr>
				<td colspan="1" class="tbltop"><b>&nbsp;<?=$T['Loaded Apache Modules'];?>&nbsp;</b></td>
			</tr>
			<tr class="row1">
				<td><? 
				
				$res = apache_get_modules();
				sort($res);
				for ($i=0; $i<sizeOf($res); $i++) {
					echo "&nbsp;".$res[$i]."<br>";
				}
				?></td>
			</tr>
		</table>
		<br>
		<? } ?>
		<table border="0" width=300 cellpadding=0 cellspacing=0>
			<tr>
				<td colspan="1" class="tbltop"><b>&nbsp;<?=$T['Installed Perl Modules'];?>&nbsp;</b></td>
			</tr>
			<tr class="row1">
				<td><? 
				$res = explode("|", exec("./listpm.pl"));
				if (sizeOf($res) >= 1) {
					sort($res);
					for ($i=0; $i<sizeOf($res); $i++) {
						if ($res[$i] != "") {
							echo "&nbsp;".$res[$i]."<br>";
						}
					}
				} else {
					echo "None Found";
				}
				?></td>
			</tr>
		</table>
		<br>
		</div>
		<?
		break;
}
?>


Return current item: web-cp - Web Hosting Control Panel