<?php
// No direct access
if ( _PPTPD ) die("Cannot access this directly!");
// If not logged in, go to index.
if ( !isset( $_SESSION["console"]["loggedin"] ) ) {
header( "Location: index.php" );
exit;
}
// If no errors, display a blank table row.
if ( empty($error) ) $error="<tr><td> </td></tr>";
?>
<link href="serveradmin.css" rel="stylesheet" type="text/css">
<link href="../serveradmin.css" rel="stylesheet" type="text/css" />
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TR>
<TD width="250"><img src="images/main_menu.png" /><?php echo $version;?></TD>
<TD valign="bottom">Logged In: <?php echo $_SESSION['console']['username']; echo $config['version']; ?></TD>
<TD width="160" align="right">
<b class=h4> </b>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="60" align="center"><b class=h4><a href="?admin.php"><A href=javascript:serveradmin_popUp('?mod=admin',720,400)><img src="images/edit_group.png" border='0'>Admin</a></b></td>
<TD width="60" align="center"><b class=h4><img src="images/configure.png" border='0'>Config</b></TD>
<td width="60" align="center"><b class=h4><a href="?action=logout"><img src="images/exit.png" border='0'>Logout</a></b></TD>
</tr>
</table> </TD>
</TR>
<TR class=color-rule>
<TD colSpan=3 height=1><p><IMG height=1 alt=" " src="images/clear.gif" width=1></p></TD>
</TR>
</TABLE>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TR>
<?php echo $error;?>
</TR>
</TABLE>
<table class="color-tabletrim" cellspacing="1" cellpadding="2" width="100%" border='1'>
<tr class="c" scope='row'>
<td width="100%" background="images/dialogtop.gif" colspan="9" height="20"><strong class="titlerev"> PPTP Server Console</strong> </td>
</tr>
</table>
<TABLE cellSpacing=0 cellPadding=0 width="100%" height=22 border=0>
<TR class=color-columnheaders>
<TD width='90' height='22' nowrap> <A href=javascript:serveradmin_popUp('?mod=newtunnel',800,160)><img src="images/iplus.gif" halign="right" align="absmiddle" border=0></A><FONT class=datasheetField> Add Tunnel</FONT> </TD>
<TD width='90' nowrap> <A href='index.php?<?php echo CreateURLQuery(); ?>'><img src="images/irefresh.gif" align="absmiddle" border=0></A><FONT class=datasheetField> Refresh</FONT> </TD>
<td width='100%'></td>
<TD nowrap width="90"><?php
if ( $_COOKIE['online'] == "on" )
{
$pptpd['GET']['mod'] = "main";
$pptpd['GET']['action'] = "onlineonly_off";
echo "<a href='?".CreateURLQuery()."'><img src='images/irefreshon.gif' border=0 align=absmiddle></a>";
}
else
{
$pptpd['GET']['mod'] = "main";
$pptpd['GET']['action'] = "onlineonly_on";
echo "<a href='?".CreateURLQuery()."'><img src='images/irefreshoff.gif' border=0 align=absmiddle></a>";
}
?>
<FONT class=datasheetField> Online Users</FONT></TD>
<TD nowrap width="90"><?php
if ( $_COOKIE['refresh'] == "on" )
{
$pptpd['GET']['mod'] = "main";
$pptpd['GET']['action'] = "autorefresh_off";
echo "<a href='?".CreateURLQuery()."'><img src='images/irefreshon.gif' border=0 align=absmiddle></a>";
}
else
{
$pptpd['GET']['mod'] = "main";
$pptpd['GET']['action'] = "autorefresh_on";
echo "<a href='?".CreateURLQuery()."'><img src='images/irefreshoff.gif' border=0 align=absmiddle></a>";
}
?>
<FONT class=datasheetField> Auto Refresh</FONT></TD>
</TR>
</TABLE>
<TABLE class=color-tabletrim cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD><table class=color-tabletrim cellspacing=1 cellpadding=2 width="100%" border=0>
<thead>
<tr class=color-tableheader>
<!-- colspam 8 columns + plugin columns -->
<td background=images/dialogtop.gif colspan=<?php echo count($plugin_hooks["maintable_tunnelinfotitle"])+8; ?> height=20><strong class=titlerev> All VPN Users</strong></td>
</tr>
</thead>
<tbody>
<tr class=color-columnheaders>
<th width="58" height=20 nowrap scope=col><font class=datasheetField> Control </font></th>
<th width="108" height=20 nowrap scope=col ><font class=datasheetField> <a href="index.php?<? unset($pptpd['GET']['action']); unset($pptpd['GET']['id']); echo CreateURLQuery(array("column" => TUNNEL_USERNAME)); ?>">Tunnel Name</a></font></th>
<th scope=col nowrap><font class=datasheetField> <a href="index.php?<? unset($pptpd['GET']['action']);unset($pptpd['GET']['id']); echo CreateURLQuery(array("column" => TUNNEL_COMM)); ?>">Description</a></font></th>
<th width="125" height=20 nowrap scope=col><font class=datasheetField> <a href="index.php?<? unset($pptpd['GET']['action']);unset($pptpd['GET']['id']); echo CreateURLQuery(array("column" => TUNNEL_LASTONLINE)); ?>">Connected</a></font></th>
<th width="110" height=20 nowrap scope=col><font class=datasheetField> <a href="index.php?<? unset($pptpd['GET']['action']);unset($pptpd['GET']['id']); echo CreateURLQuery(array("column" => TUNNEL_DURATION)); ?>">Duration</a></font></th>
<th width="51" height=20 nowrap scope=col><font class=datasheetField> <a href="index.php?<? unset($pptpd['GET']['action']);unset($pptpd['GET']['id']); echo CreateURLQuery(array("column" => TUNNEL_DEVICE)); ?>">Device</a></font></th>
<th width="90" height=20 nowrap scope=col><font class=datasheetField> <a href="index.php?<? unset($pptpd['GET']['action']);unset($pptpd['GET']['id']); echo CreateURLQuery(array("column" => TUNNEL_LASTNETIP)); ?>">Inet IP</a></font></th>
<th width="70" height=20 nowrap scope=col><font class=datasheetField> <a href="index.php?<? unset($pptpd['GET']['action']);unset($pptpd['GET']['id']); echo CreateURLQuery(array("column" => TUNNEL_VPNIP)); ?>">VPN IP</a></font></th>
<?php do_hook('maintable_tunnelinfotitle'); ?></tr>
<tr bgcolor=#bbbbbb>
<td></td>
<td nowrap></td>
<td width=840></td>
<td colspan="2"></td>
<td></td>
<td></td>
<td></td>
<?php foreach ( $plugin_hooks["maintable_tunnelinfotitle"] as $key ) echo "<TD></TD>";?>
</tr>
<?php vpn_display_links( $tunnel ); ?>
</tbody>
</table>
</TR>
</TBODY>
</TABLE>
<SCRIPT language=JavaScript>
<!--
function serveradmin_alert( m ) {
alert( m );
}
// -->
</SCRIPT>
<SCRIPT language=JavaScript>
<!--
function serveradmin_confirm(m,l) {
if( confirm( m ) ) {
document.location = l;
}
}
// -->
=======
<?php
// If not logged in, go to index.
if ( !isset( $_SESSION["console"]["loggedin"] ) ) {
header( "Location: index.php" );
exit;
}
// If no errors, display a blank table row.
if ( empty($error) ) $error="<tr><td> </td></tr>";
?>
<link href="serveradmin.css" rel="stylesheet" type="text/css">
<link href="../serveradmin.css" rel="stylesheet" type="text/css" />
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TR>
<TD width="50%">Logged In: <?php echo $_SESSION['console']['username']; echo $config['version']; ?></TD>
<TD align="right">
<b class=h4> </b>
<table border="1" cellpadding="0" cellspacing="0">
<tr>
<td width="60" align="center"><b class=h4><a href="?admin.php"><A href=javascript:serveradmin_popUp('?mod=admin',750,400)>Admin</a></b></td>
<TD width="60" align="center"><b class=h4>Config</b></TD>
<td width="60" align="center"><b class=h4><a href="?action=logout">Logout</a></b></TD>
</tr>
</table>
</TD>
</TR>
<TR class=color-rule>
<TD colSpan=2 height=1><p><IMG height=1 alt=" " src="images/clear.gif" width=1></p></TD>
</TR>
</TABLE>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TR>
<?php echo $error;?>
</TR>
</TABLE>
<table class="color-tabletrim" cellspacing="1" cellpadding="2" width="100%" border='1'>
<tr class="c" scope='row'>
<td width="100%" background="images/dialogtop.gif" colspan="9" height="20"><strong class="titlerev"> PPTP Server Console</strong> </td>
</tr>
</table>
<TABLE cellSpacing=0 cellPadding=0 width="100%" height=22 border=0>
<TR class=color-columnheaders>
<TD width='90' height='22' nowrap> <A href=javascript:serveradmin_popUp('?mod=newtunnel',800,160)><img src="images/iplus.gif" halign="right" align="absmiddle" border=0></A><FONT class=datasheetField> Add Tunnel</FONT> </TD>
<TD width='90' nowrap> <A href='index.php?<?php echo CreateURLQuery(); ?>'><img src="images/irefresh.gif" align="absmiddle" border=0></A><FONT class=datasheetField> Refresh</FONT> </TD>
<td width='100%'></td>
<TD nowrap width="90"><?php
if ( $_COOKIE['online'] == "on" )
{
$pptpd['GET']['mod'] = "main";
$pptpd['GET']['action'] = "onlineonly_off";
echo "<a href='?".CreateURLQuery()."'><img src='images/irefreshon.gif' border=0 align=absmiddle></a>";
}
else
{
$pptpd['GET']['mod'] = "main";
$pptpd['GET']['action'] = "onlineonly_on";
echo "<a href='?".CreateURLQuery()."'><img src='images/irefreshoff.gif' border=0 align=absmiddle></a>";
}
?>
<FONT class=datasheetField> Online Users</FONT></TD>
<TD nowrap width="90"><?php
if ( $_COOKIE['refresh'] == "on" )
{
$pptpd['GET']['mod'] = "main";
$pptpd['GET']['action'] = "autorefresh_off";
echo "<a href='?".CreateURLQuery()."'><img src='images/irefreshon.gif' border=0 align=absmiddle></a>";
}
else
{
$pptpd['GET']['mod'] = "main";
$pptpd['GET']['action'] = "autorefresh_on";
echo "<a href='?".CreateURLQuery()."'><img src='images/irefreshoff.gif' border=0 align=absmiddle></a>";
}
?>
<FONT class=datasheetField> Auto Refresh</FONT></TD>
</TR>
</TABLE>
<TABLE class=color-tabletrim cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD><table class=color-tabletrim cellspacing=1 cellpadding=2 width="100%" border=0>
<thead>
<tr class=color-tableheader>
<!-- colspam 8 columns + plugin columns -->
<td background=images/dialogtop.gif colspan=<?php echo count($plugin_hooks["maintable_tunnelinfotitle"])+8; ?> height=20><strong class=titlerev> All VPN Users</strong></td>
</tr>
</thead>
<tbody>
<tr class=color-columnheaders>
<th width="58" height=20 nowrap scope=col><font class=datasheetField> Control </font></th>
<th width="108" height=20 nowrap scope=col ><font class=datasheetField> <a href="index.php?<? unset($pptpd['GET']['action']); unset($pptpd['GET']['id']); echo CreateURLQuery(array("column" => TUNNEL_USERNAME)); ?>">Tunnel Name</a></font></th>
<th scope=col nowrap><font class=datasheetField> <a href="index.php?<? unset($pptpd['GET']['action']);unset($pptpd['GET']['id']); echo CreateURLQuery(array("column" => TUNNEL_COMM)); ?>">Description</a></font></th>
<th width="125" height=20 nowrap scope=col><font class=datasheetField> <a href="index.php?<? unset($pptpd['GET']['action']);unset($pptpd['GET']['id']); echo CreateURLQuery(array("column" => TUNNEL_LASTONLINE)); ?>">Connected</a></font></th>
<th width="110" height=20 nowrap scope=col><font class=datasheetField> <a href="index.php?<? unset($pptpd['GET']['action']);unset($pptpd['GET']['id']); echo CreateURLQuery(array("column" => TUNNEL_DURATION)); ?>">Duration</a></font></th>
<th width="51" height=20 nowrap scope=col><font class=datasheetField> <a href="index.php?<? unset($pptpd['GET']['action']);unset($pptpd['GET']['id']); echo CreateURLQuery(array("column" => TUNNEL_DEVICE)); ?>">Device</a></font></th>
<th width="90" height=20 nowrap scope=col><font class=datasheetField> <a href="index.php?<? unset($pptpd['GET']['action']);unset($pptpd['GET']['id']); echo CreateURLQuery(array("column" => TUNNEL_LASTNETIP)); ?>">Inet IP</a></font></th>
<th width="70" height=20 nowrap scope=col><font class=datasheetField> <a href="index.php?<? unset($pptpd['GET']['action']);unset($pptpd['GET']['id']); echo CreateURLQuery(array("column" => TUNNEL_VPNIP)); ?>">VPN IP</a></font></th>
<?php do_hook('maintable_tunnelinfotitle'); ?></tr>
<tr bgcolor=#bbbbbb>
<td></td>
<td nowrap></td>
<td width=840></td>
<td colspan="2"></td>
<td></td>
<td></td>
<td></td>
<?php foreach ( $plugin_hooks["maintable_tunnelinfotitle"] as $key ) echo "<TD></TD>";?>
</tr>
<?php vpn_display_links( $tunnel ); ?>
</tbody>
</table>
</TR>
</TBODY>
</TABLE>
<SCRIPT language=JavaScript>
<!--
function serveradmin_alert( m ) {
alert( m );
}
// -->
</SCRIPT>
<SCRIPT language=JavaScript>
<!--
function serveradmin_confirm(m,l) {
if( confirm( m ) ) {
document.location = l;
}
}
// -->
</SCRIPT>