diff options
Diffstat (limited to 'usr/local/www/status_interfaces.php')
-rw-r--r-- | usr/local/www/status_interfaces.php | 110 |
1 files changed, 50 insertions, 60 deletions
diff --git a/usr/local/www/status_interfaces.php b/usr/local/www/status_interfaces.php index 58ed077..4e10fe1 100644 --- a/usr/local/www/status_interfaces.php +++ b/usr/local/www/status_interfaces.php @@ -46,13 +46,12 @@ require_once("guiconfig.inc"); require_once("shaper.inc"); require_once("filter.inc"); -if ($_GET['if']) { - $interface = $_GET['if']; - if ($_GET['action'] == "Disconnect" || $_GET['action'] == "Release") { +if ($_POST['if'] && $_POST['submit']) { + $interface = $_POST['if']; + if ($_POST['status'] == "up") interface_bring_down($interface); - } else if ($_GET['action'] == "Connect" || $_GET['action'] == "Renew") { + else interface_configure($interface); - } header("Location: status_interfaces.php"); exit; } @@ -96,15 +95,13 @@ include("head.inc"); DHCP </td> <td width="78%" class="listr"> - <?=htmlspecialchars($ifinfo['dhcplink']);?> - <?php if ($ifinfo['dhcplink'] == "up"): ?> - <a href="status_interfaces.php?action=Release&if=<?php echo $ifdescr; ?>"> - <input type="button" name="<?php echo $ifdescr; ?>" value="<?=gettext("Release");?>" class="formbtns" /> - <?php else: ?> - <a href="status_interfaces.php?action=Renew&if=<?php echo $ifdescr; ?>"> - <input type="button" name="<?php echo $ifdescr; ?>" value="<?=gettext("Renew");?>" class="formbtns" /> - <?php endif; ?> - </a> + <form name="dhcplink_form" action="status_interfaces.php" method="post"> + <input type="hidden" name="if" value="<?php echo $ifdescr; ?>" /> + <input type="hidden" name="status" value="<?php echo $ifinfo['dhcplink']; ?>" /> + <?=htmlspecialchars($ifinfo['dhcplink']);?> + <?php $action = ($ifinfo['dhcplink'] == "up" ? gettext("Release") : gettext("Renew")); ?> + <input type="submit" name="submit" class="formbtn" value="<?php echo $action; ?>" /> + </form> </td> </tr> <?php endif; @@ -114,77 +111,70 @@ include("head.inc"); DHCP6 </td> <td width="78%" class="listr"> - <?=htmlspecialchars($ifinfo['dhcp6link']);?> - <?php if ($ifinfo['dhcp6link'] == "up"): ?> - <a href="status_interfaces.php?action=Release&if=<?php echo $ifdescr; ?>"> - <input type="button" name="<?php echo $ifdescr; ?>" value="<?=gettext("Release");?>" class="formbtns" /> - <?php else: ?> - <a href="status_interfaces.php?action=Renew&if=<?php echo $ifdescr; ?>"> - <input type="button" name="<?php echo $ifdescr; ?>" value="<?=gettext("Renew");?>" class="formbtns" /> - <?php endif; ?> - </a> + <form name="dhcp6link_form" action="status_interfaces.php" method="post"> + <input type="hidden" name="if" value="<?php echo $ifdescr; ?>" /> + <input type="hidden" name="status" value="<?php echo $ifinfo['dhcp6link']; ?>" /> + <?=htmlspecialchars($ifinfo['dhcp6link']);?> + <?php $action = ($ifinfo['dhcp6link'] == "up" ? gettext("Release") : gettext("Renew")); ?> + <input type="submit" name="submit" class="formbtn" value="<?php echo $action; ?>" /> + </form> </td> </tr> <?php endif; if ($ifinfo['pppoelink']): ?> <tr> <td width="22%" class="vncellt"><?=gettext("PPPoE"); ?></td> <td width="78%" class="listr"> - <?=htmlspecialchars($ifinfo['pppoelink']);?> - <?php if ($ifinfo['pppoelink'] == "up"): ?> - <a href="status_interfaces.php?action=Disconnect&if=<?php echo $ifdescr; ?>"> - <input type="button" name="<?php echo $ifdescr; ?>" value="<?=gettext("Disconnect");?>" class="formbtns" /> - <?php else: ?> - <a href="status_interfaces.php?action=Connect&if=<?php echo $ifdescr; ?>"> - <input type="button" name="<?php echo $ifdescr; ?>" value="<?=gettext("Connect");?>" class="formbtns" /> - <?php endif; ?> - </a> + <form name="pppoelink_form" action="status_interfaces.php" method="post"> + <input type="hidden" name="if" value="<?php echo $ifdescr; ?>" /> + <input type="hidden" name="status" value="<?php echo $ifinfo['pppoelink']; ?>" /> + <?=htmlspecialchars($ifinfo['pppoelink']);?> + <?php $action = ($ifinfo['pppoelink'] == "up" ? gettext("Disconnect") : gettext("Connect")); ?> + <input type="submit" name="submit" class="formbtn" value="<?php echo $action; ?>" /> + </form> </td> </tr> <?php endif; if ($ifinfo['pptplink']): ?> <tr> <td width="22%" class="vncellt"><?=gettext("PPTP"); ?></td> <td width="78%" class="listr"> - <?=htmlspecialchars($ifinfo['pptplink']);?> - <?php if ($ifinfo['pptplink'] == "up"): ?> - <a href="status_interfaces.php?action=Disconnect&if=<?php echo $ifdescr; ?>"> - <input type="button" name="<?php echo $ifdescr; ?>" value="<?=gettext("Disconnect");?>" class="formbtns" /> - <?php else: ?> - <a href="status_interfaces.php?action=Connect&if=<?php echo $ifdescr; ?>"> - <input type="button" name="<?php echo $ifdescr; ?>" value="<?=gettext("Connect");?>" class="formbtns" /> - <?php endif; ?> - </a> + <form name="pptplink_form" action="status_interfaces.php" method="post"> + <input type="hidden" name="if" value="<?php echo $ifdescr; ?>" /> + <input type="hidden" name="status" value="<?php echo $ifinfo['pptplink']; ?>" /> + <?=htmlspecialchars($ifinfo['pptplink']);?> + <?php $action = ($ifinfo['pptplink'] == "up" ? gettext("Disconnect") : gettext("Connect")); ?> + <input type="submit" name="submit" class="formbtn" value="<?php echo $action; ?>" /> + </form> </td> </tr> <?php endif; if ($ifinfo['l2tplink']): ?> <tr> <td width="22%" class="vncellt"><?=gettext("L2TP"); ?></td> <td width="78%" class="listr"> - <?=htmlspecialchars($ifinfo['l2tplink']);?> - <?php if ($ifinfo['l2tplink'] == "up"): ?> - <a href="status_interfaces.php?action=Disconnect&if=<?php echo $ifdescr; ?>"> - <input type="button" name="<?php echo $ifdescr; ?>" value="<?=gettext("Disconnect");?>" class="formbtns" /> - <?php else: ?> - <a href="status_interfaces.php?action=Connect&if=<?php echo $ifdescr; ?>"> - <input type="button" name="<?php echo $ifdescr; ?>" value="<?=gettext("Connect");?>" class="formbtns" /> - <?php endif; ?> - </a> + <form name="l2tplink_form" action="status_interfaces.php" method="post"> + <input type="hidden" name="if" value="<?php echo $ifdescr; ?>" /> + <input type="hidden" name="status" value="<?php echo $ifinfo['l2tplink']; ?>" /> + <?=htmlspecialchars($ifinfo['l2tplink']);?> + <?php $action = ($ifinfo['l2tplink'] == "up" ? gettext("Disconnect") : gettext("Connect")); ?> + <input type="submit" name="submit" class="formbtn" value="<?php echo $action; ?>" /> + </form> </td> </tr> <?php endif; if ($ifinfo['ppplink']): ?> <tr> <td width="22%" class="vncellt"><?=gettext("PPP"); ?></td> <td width="78%" class="listr"> - <?=htmlspecialchars($ifinfo['pppinfo']);?> - <?php if ($ifinfo['ppplink'] == "up"): ?> - <a href="status_interfaces.php?action=Disconnect&if=<?php echo $ifdescr; ?>"> - <input type="button" name="<?php echo $ifdescr; ?>" value="<?=gettext("Disconnect");?>" class="formbtns" /> - <?php else: ?> - <?php if (!$ifinfo['nodevice']): ?> - <a href="status_interfaces.php?action=Connect&if=<?php echo $ifdescr; ?>"> - <input type="button" name="<?php echo $ifdescr; ?>" value="<?=gettext("Connect");?>" class="formbtns" /> + <form name="ppplink_form" action="status_interfaces.php" method="post"> + <input type="hidden" name="if" value="<?php echo $ifdescr; ?>" /> + <input type="hidden" name="status" value="<?php echo $ifinfo['ppplink']; ?>" /> + <?=htmlspecialchars($ifinfo['pppinfo']);?> + <?php if ($ifinfo['ppplink'] == "up"): ?> + <input type="submit" name="submit" class="formbtn" value="<?php echo gettext("Disconnect"); ?>" /> + <?php else: ?> + <?php if (!$ifinfo['nodevice']): ?> + <input type="submit" name="submit" class="formbtn" value="<?php echo gettext("Connect"); ?>" /> + <?php endif; ?> <?php endif; ?> - <?php endif; ?> - </a> + </form> </td> </tr> <?php endif; if ($ifinfo['ppp_uptime'] || $ifinfo['ppp_uptime_accumulated']): ?> |