From 40bc7cb32abaa8bd04862658cce48a0453704ca7 Mon Sep 17 00:00:00 2001 From: Ryan Wagoner Date: Fri, 15 Dec 2006 15:27:14 +0000 Subject: add enable checkbox, format menu name to MiniUPnP --- packages/miniupnpd/miniupnpd.inc | 12 ++++++++---- packages/miniupnpd/miniupnpd.xml | 17 +++++++++++------ packages/miniupnpd/status_upnp.php | 7 ++++--- 3 files changed, 23 insertions(+), 13 deletions(-) (limited to 'packages/miniupnpd') diff --git a/packages/miniupnpd/miniupnpd.inc b/packages/miniupnpd/miniupnpd.inc index a8721c8b..fdee5a9e 100644 --- a/packages/miniupnpd/miniupnpd.inc +++ b/packages/miniupnpd/miniupnpd.inc @@ -2,7 +2,7 @@ require_once("config.inc"); require_once("functions.inc"); - /* Miniupnpd */ + /* MiniUPnP */ function upnp_notice ($msg) { syslog(LOG_NOTICE, "miniupnpd: $msg"); return; } function upnp_warn ($msg) { syslog(LOG_WARNING, "miniupnpd: $msg"); return; } @@ -65,8 +65,8 @@ config_lock(); - /* since config is written before this file invoked we don't need to read post data */ - if(upnp_config("iface_array")) + /* since config is written before this file invoked we don't need to read post data */ + if(upnp_config("enable") && upnp_config("iface_array")) $iface_array = explode(",",upnp_config("iface_array")); if($iface_array) { @@ -170,7 +170,11 @@ EOD; /* lets stop the service and remove the rc file */ if(file_exists("/usr/local/etc/rc.d/miniupnpd.sh")) { - upnp_notice("Stopping service, no interfaces selected"); + if(!upnp_config("enable")) + upnp_notice("Stopping service, miniupnpd disabled"); + else + upnp_notice("Stopping service, no interfaces selected"); + stop_service("miniupnpd"); conf_mount_rw(); diff --git a/packages/miniupnpd/miniupnpd.xml b/packages/miniupnpd/miniupnpd.xml index 058e472d..6a579348 100644 --- a/packages/miniupnpd/miniupnpd.xml +++ b/packages/miniupnpd/miniupnpd.xml @@ -1,13 +1,13 @@ - Services: Miniupnpd + Services: MiniUPnP miniupnpd 20061214 Change /usr/local/pkg/miniupnpd.inc status_upnp.php - Miniupnpd + MiniUPnP Set miniupnpd settings such as interfaces to listen on.
Services
/status_upnp.php @@ -34,24 +34,29 @@ - UPNP Status + UPnP Status status_upnp.php - miniupnpd Settings + MiniUPnP Settings /pkg_edit.php?xml=miniupnpd.xml&id=0 - Interface (generally LAN)<br> - NOTE: If no interfaces are selected miniupnpd is disabled + Enable MiniUPnP + enable + checkbox + + + Interfaces (generally LAN) iface_array lan true 3 interfaces_selection + You can use the CTRL or COMMAND key to select multiple interfaces. Maximum Download Speed (Kbits/second) diff --git a/packages/miniupnpd/status_upnp.php b/packages/miniupnpd/status_upnp.php index 35aae38f..1e1a961b 100644 --- a/packages/miniupnpd/status_upnp.php +++ b/packages/miniupnpd/status_upnp.php @@ -32,7 +32,8 @@ require("guiconfig.inc"); /* Defaults to this page but if no settings are present, redirect to setup page */ -if(!$config['installedpackages']['miniupnpd']['config'][0]['iface_array']) +if(!$config['installedpackages']['miniupnpd']['config'][0]['iface_array'] || + !$config['installedpackages']['miniupnpd']['config'][0]['enable']) Header("Location: /pkg_edit.php?xml=miniupnpd.xml&id=0"); if ($_POST) { @@ -65,8 +66,8 @@ include("head.inc");
-- cgit v1.2.3