upnp_list.php 3.05 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
<?php
/*
 ----------------------------------------------------------------------
 AlternC - Web Hosting System
 Copyright (C) 2000-2012 by the AlternC Development Team.
 https://alternc.org/
 ----------------------------------------------------------------------
 LICENSE

 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License (GPL)
 as published by the Free Software Foundation; either version 2
 of the License, or (at your option) any later version.

 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 To read the license please visit http://www.gnu.org/copyleft/gpl.html
 ----------------------------------------------------------------------
 Purpose of file: Show the UPnP port forwarding list
 ----------------------------------------------------------------------
*/
require_once("../class/config.php");
include_once("head.php");

if (!$admin->enabled) {
	__("This page is restricted to authorized staff");
	exit();
}

$r=$upnp->get_forward_list();

$aaction=array("CREATE" => _("Creation in progress"),
	       "DELETE" => _("Deletion in progress"),
	       "DELETING" => _("Deletion in progress"),
	       "DISABLE" => _("Will be disabled soon"),
	       "ENABLE" => _("Will be enabled soon"),
	       "OK" => _("OK"),
	       );

?>
<h3><?php __("UPnP port forwarding list"); ?></h3>
<hr id="topbar"/>
<br />
<?php
  if (isset($error) && $error ) {
    echo "<p class=\"error\">$error</p>";
  }
?>
<p>
<?php __("Here is the list of the requested port forward for AlternC's services, and their status. You can enable or disable some of them."); ?> 

<table class="tlist">
<tr>
<th></th>
<th><?php __("Name"); ?></th>
<th><?php __("Class"); ?></th>
<th><?php __("Protocol/Port") ?></th>
<th><?php __("Mandatory") ?></th>
<th><?php __("Enabled") ?></th>
<th><?php __("Last Check"); ?></th>
<th><?php __("Last Update"); ?></th>
<th><?php __("Status"); ?></th>
</tr>
<?php
reset($r);

$col=1;
while (list($key,$val)=each($r))
	{
	$col=3-$col;
?>
	<tr class="lst<?php echo $col; ?>">

<?php
 if ($val["mandatory"]) { ?>
		   <td>&nbsp;</td>
<?php } else { ?>
 <td><?php if ($val["enabled"]) { ?><a href="upnp_change.php?action=disable&id=<?php echo $val["id"]; ?>"><?php __("Disable"); ?></a><?php } else { ?><a href="upnp_change.php?action=enable&id=<?php echo $val["id"]; ?>"><?php __("Enable"); ?></a><?php } ?></td>
<?php } ?>
		<td><?php echo $val["class"] ?></td>
		<td><?php echo $val["protocol"]."/".$val["port"] ?></td>
                <td><?php if ($val["mandatory"]) __("Yes"); else __("No"); ?></td>
                <td><?php if ($val["enabled"]) __("Yes"); else __("No"); ?></td>
		<td><?php echo $val["lastcheck"] ?></td>
		<td><?php echo $val["lastupdate"] ?></td>
	        <td><?php echo $aaction[$val["status"]]; ?><br /><?php echo $val["result"]; ?></td>
	</tr>
<?php
  } // for loop
?>
</table>
</form>
<?php include_once("foot.php"); ?>