index.php
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
require("globals.inc");
require("util.inc");
require("config.inc");
-require("radius_authentication.inc") ;
-require("radius_accounting.inc") ;
+require("radius_authentication.inc");
+require("radius_accounting.inc");
header("Expires: 0");
header("Cache-Control: no-store, no-cache, must-revalidate");
$radiusservers[0]['port'],
$radiusservers[0]['key']);
if ($auth_val == 2) {
+ captiveportal_logportalauth($_POST['auth_user'],$clientmac,$clientip,"LOGIN");
$sessionid = portal_allow($clientip, $clientmac, $_POST['auth_user']);
if (isset($config['captiveportal']['radacct_enable']) && isset($radiusservers[0])) {
$auth_val = RADIUS_ACCOUNTING_START($_POST['auth_user'],
$sessionid,
$radiusservers[0]['ipaddr'],
$radiusservers[0]['acctport'],
- $radiusservers[0]['key']);
+ $radiusservers[0]['key'],
+ $clientip);
}
} else {
+ captiveportal_logportalauth($_POST['auth_user'],$clientmac,$clientip,"FAILURE");
readfile("{$g['varetc_path']}/captiveportal-error.html");
}
} else {
readfile("{$g['varetc_path']}/captiveportal-error.html");
}
+
+} else if ($_POST['accept'] && $config['captiveportal']['auth_method'] == "local") {
+
+ //check against local usermanager
+ //erase expired accounts
+ if(trim($config['users'][$_POST['auth_user']]['expirationdate'])!="" && strtotime("-1 day")>strtotime($config['users'][$_POST['auth_user']]['expirationdate'])){
+ unset($config['users'][$_POST['auth_user']]);
+ write_config();
+ }
+
+ if($config['users'][$_POST['auth_user']]['password']==md5($_POST['auth_pass'])){
+ captiveportal_logportalauth($_POST['auth_user'],$clientmac,$clientip,"LOGIN");
+ portal_allow($clientip, $clientmac,$_POST['auth_user'],0,0);
+ } else {
+ captiveportal_logportalauth($_POST['auth_user'],$clientmac,$clientip,"FAILURE");
+ readfile("{$g['varetc_path']}/captiveportal-error.html");
+ }
} else if ($_POST['accept'] && $clientip) {
portal_allow($clientip, $clientmac, "unauthenticated");
} else if ($_POST['logout_id']) {
$cpdb[$i][0], // start time
$radiusservers[0]['ipaddr'],
$radiusservers[0]['acctport'],
- $radiusservers[0]['key']);
+ $radiusservers[0]['key'],
+ $clientip);
}
mwexec("/sbin/ipfw delete " . $cpdb[$i][1] . " " . ($cpdb[$i][1]+10000));
unset($cpdb[$i]);
$cpdb[$i][0], // start time
$radiusservers[0]['ipaddr'],
$radiusservers[0]['acctport'],
- $radiusservers[0]['key']);
+ $radiusservers[0]['key'],
+ $cpdb[$i][2]);
}
mwexec("/sbin/ipfw delete " . $cpdb[$i][1] . " " . ($cpdb[$i][1]+10000));
+ captiveportal_logportalauth($cpdb[$i][4],$cpdb[$i][3],$cpdb[$i][2],"LOGOUT");
unset($cpdb[$i]);
break;
}
portal_unlock();
}
+
+/* log successful captive portal authentication to syslog */
+/* part of this code from php.net */
+function captiveportal_logportalauth($user,$mac,$ip,$status) {
+ define_syslog_variables();
+ openlog("logportalauth", LOG_PID, LOG_LOCAL4);
+ // Log it
+ syslog(LOG_INFO, "$status: $user, $mac, $ip");
+ closelog();
+}
+
?>
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
-*/
+ // This version of radius_accounting.inc has been modified by
+ // Rob Parker <rob.parker@keycom.co.uk>. Changes made include:
+ // * now sends Framed-IP-Address (client IP)
+ // * now sends Called-Station-ID (NAS IP)
+ // * now sends Calling-Station-ID (client IP)
+*/
-function RADIUS_ACCOUNTING_START($username,$sessionid,$radiusip,$radiusport,$radiuskey) {
+function RADIUS_ACCOUNTING_START($username,$sessionid,$radiusip,$radiusport,$radiuskey,$clientip) {
$sharedsecret=$radiuskey ;
# $debug = 1 ;
/* set 5 second timeout on socket i/o */
stream_set_timeout($fd, 5) ;
+ $nas_ip_address = get_nas_ip();
+
+ if(!isset($clientip)) {
+ //if there's no client ip, we'll need to use the NAS ip
+ $clientip=$nas_ip_address;
+ }
+ $ip_exp=explode(".",$clientip);
+
if ($debug)
echo "<br>radius-port: $radiusport<br>radius-host: $radiusip<br>username: $username<hr>\n";
6+ // nasPortType
6+ // Acct Status Type
6+ // Acct RADIUS Authenticated
- 2+strlen($sessionid); // Acct SessionID
+ 2+strlen($sessionid)+ // Acct SessionID
+ 6; // Framed-IP-Address
// v v v v v v v v v 1 v
// Line # 1 2 3 4 5 6 7 8 9 0 E
- $data=pack("CCCCNNNNCCCCCCCCa*CCa*CCCCCCCCCCCCCCCCCCCCCCCCCCa*",
+ $data=pack("CCCCNNNNCCCCCCCCa*CCa*CCCCCCCCCCCCCCCCCCCCCCCCCCa*CCCCCC",
4,$thisidentifier,$length/256,$length%256, // header
0,0,0,0, // authcode
6,6,0,0,0,1, // service type
61,6,0,0,0,15, // nasPortType = Ethernet
40,6,0,0,0,1, // Acct Status Type = Start
45,6,0,0,0,1, // Acct RADIUS Authenticated
- 44,2+strlen($sessionid),$sessionid // Acct Session ID
+ 44,2+strlen($sessionid),$sessionid, // Acct Session ID
+ 8,6,$ip_exp[0],$ip_exp[1],$ip_exp[2],$ip_exp[3] //Framed-IP-Address
);
/* Generate Accounting Request Authenticator */
// v v v v v v v v v 1 v
// Line # 1 2 3 4 5 6 7 8 9 0 E
- $data=pack("CCCCH*CCCCCCCCa*CCa*CCCCCCCCCCCCCCCCCCCCCCCCCCa*",
+ $data=pack("CCCCH*CCCCCCCCa*CCa*CCCCCCCCCCCCCCCCCCCCCCCCCCa*CCCCCC",
4,$thisidentifier,$length/256,$length%256, // header
$RA, // authcode
6,6,0,0,0,1, // service type
61,6,0,0,0,15, // nasPortType = Ethernet
40,6,0,0,0,1, // Acct Status Type = Start
45,6,0,0,0,1, // Acct RADIUS Authenticated
- 44,2+strlen($sessionid),$sessionid // Acct Session ID
+ 44,2+strlen($sessionid),$sessionid, // Acct Session ID
+ 8,6,$ip_exp[0],$ip_exp[1],$ip_exp[2],$ip_exp[3] //Framed-IP-Address
);
if($debug) {
// See RFC2866 for this.
}
-function RADIUS_ACCOUNTING_STOP($ruleno,$username,$sessionid,$start_time,$radiusip,$radiusport,$radiuskey) {
+function RADIUS_ACCOUNTING_STOP($ruleno,$username,$sessionid,$start_time,$radiusip,$radiusport,$radiuskey,$clientip) {
$sharedsecret=$radiuskey ;
# $debug = 1 ;
/* set 5 second timeout on socket i/o */
stream_set_timeout($fd, 5) ;
+ $nas_ip_address = get_nas_ip();
+
+ if(!isset($clientip)) {
+ //if there's no client ip, we'll need to use the NAS ip
+ $clientip=$nas_ip_address;
+ }
+ $ip_exp=explode(".",$clientip);
+
if ($debug)
echo "<br>radius-port: $radiusport<br>radius-host: $radiusip<br>username: $username<hr>\n";
6+ // input bytes
6+ // input packets
6+ // output bytes
- 6; // output packets
+ 6+ // output packets
+ 2+strlen($nas_ip_address)+ //Called-Station-ID
+ 2+strlen($clientip)+ //Calling-Station-ID
+
+ 6; //Framed-IP-Address
// v v v v v v v v v 1 1 1 1 1 1 1 v
// Line # 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 E
- $data=pack("CCCCNNNNCCCCCCCCa*CCa*CCCCCCCCCCCCCCCCCCCCCCCCCCa*CCNCCNCCNCCNCCNCCN",
+ $data=pack("CCCCNNNNCCCCCCCCa*CCa*CCCCCCCCCCCCCCCCCCCCCCCCCCa*CCNCCNCCNCCNCCNCCNCCa*CCa*CCCCCC",
4,$thisidentifier,$length/256,$length%256, // header
0,0,0,0, // authcode
6,6,0,0,0,1, // service type
42,6,$input_bytes, // Input Octets
47,6,$input_pkts, // Input Packets
43,6,$output_bytes, // Output Octets
- 48,6,$output_pkts // Output Packets
+ 48,6,$output_pkts, // Output Packets
+ 30,2+strlen($nas_ip_address),$nas_ip_address, //Called-Station-ID
+ 31,2+strlen($clientip),$clientip, //Calling-Station-ID
+
+ 8,6,$ip_exp[0],$ip_exp[1],$ip_exp[2],$ip_exp[3] //Framed-IP-Address
);
/* Generate Accounting Request Authenticator */
// v v v v v v v v v 1 1 1 1 1 1 1 v
// Line # 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 E
- $data=pack("CCCCH*CCCCCCCCa*CCa*CCCCCCCCCCCCCCCCCCCCCCCCCCa*CCNCCNCCNCCNCCNCCN",
+ $data=pack("CCCCH*CCCCCCCCa*CCa*CCCCCCCCCCCCCCCCCCCCCCCCCCa*CCNCCNCCNCCNCCNCCNCCa*CCa*CCCCCC",
4,$thisidentifier,$length/256,$length%256, // header
$RA, // authcode
6,6,0,0,0,1, // service type
42,6,$input_bytes, // Input Octets
47,6,$input_pkts, // Input Packets
43,6,$output_bytes, // Output Octets
- 48,6,$output_pkts // Output Packets
+ 48,6,$output_pkts, // Output Packets
+ 30,2+strlen($nas_ip_address),$nas_ip_address, //Called-Station-ID
+ 31,2+strlen($clientip),$clientip, //Calling-Station-ID
+
+ 8,6,$ip_exp[0],$ip_exp[1],$ip_exp[2],$ip_exp[3] //Framed-IP-Address
);
if($debug) {
// 5 -> Accounting-Response
// See RFC2866 for this.
}
+
+function get_nas_ip() {
+ global $config;
+
+ /* static WAN IP address */
+ return $config['interfaces']['wan']['ipaddr'];
+}
+
?>
#!/bin/sh
# /etc/rc
-# part of m0n0wall (http://neon1.net/m0n0wall)
+# part of m0n0wall (http://m0n0.ch/wall)
#
-# Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+# Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
# All rights reserved.
stty status '^T'
clog -i -s 262144 /var/log/system.log
clog -i -s 262144 /var/log/filter.log
clog -i -s 65536 /var/log/vpn.log
+clog -i -s 32768 /var/log/portalauth.log
clog -i -s 32768 /var/log/dhcpd.log
chmod 0600 /var/log/*.log
dev_mkdb
# Run ldconfig
-/sbin/ldconfig -elf /usr/lib
+/sbin/ldconfig -elf /usr/lib /usr/local/lib
# let the PHP-based configuration subsystem set up the system now
/etc/rc.bootup
#!/bin/sh
# /etc/rc.firmware
-# part of m0n0wall (http://neon1.net/m0n0wall)
+# part of m0n0wall (http://m0n0.ch/wall)
#
-# Copyright (C) 2003 Manuel Kasper <mk@neon1.net>.
+# Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
# All rights reserved.
CFDEVICE=`cat /var/etc/cfdevice`
case $1 in
enable)
- /sbin/mount_mfs -s 15360 -T qp120at -b 8192 -f 1024 dummy /ftmp \
+ /sbin/mount_mfs -s 16384 -T qp120at -b 8192 -f 1024 dummy /ftmp \
> /dev/null 2>&1
;;
upgrade)
#!/bin/sh
# /etc/rc.initial
-# part of m0n0wall (http://neon1.net/m0n0wall)
+# part of m0n0wall (http://m0n0.ch/wall)
#
-# Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+# Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
# All rights reserved.
# make sure the user can't kill us by pressing Ctrl-C
captiveportal.inc
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
+
+ This version of captiveportal.inc has been modified by Rob Parker
+ <rob.parker@keycom.co.uk> to include changes for per-user bandwidth management
+ via returned RADIUS attributes. This page has been modified to delete any
+ added rules which may have been created by other per-user code (index.php, etc).
+ These changes are (c) 2004 Keycom PLC.
*/
/* include all configuration functions */
mwexec("/sbin/kldload ipfw");
/* stop accounting on all clients */
- captiveportal_radius_stop_all() ;
+ captiveportal_radius_stop_all();
/* remove old information */
unlink_if_exists("{$g['vardb_path']}/captiveportal.nextrule");
"/etc/rc.prunecaptiveportal");
/* generate passthru mac database */
- captiveportal_passthrumac_configure() ;
+ captiveportal_passthrumac_configure();
/* create allowed ip database and insert ipfw rules to make it so */
- captiveportal_allowedip_configure() ;
+ captiveportal_allowedip_configure();
/* generate radius server database */
- if($config['captiveportal']['radiusip']) {
- $radiusip = $config['captiveportal']['radiusip'] ;
+ if ($config['captiveportal']['radiusip'] && (!isset($config['captiveportal']['auth_method']) ||
+ ($config['captiveportal']['auth_method'] == "radius"))) {
+ $radiusip = $config['captiveportal']['radiusip'];
- if($config['captiveportal']['radiusport'])
- $radiusport = $config['captiveportal']['radiusport'] ;
+ if ($config['captiveportal']['radiusport'])
+ $radiusport = $config['captiveportal']['radiusport'];
else
$radiusport = 1812;
- if($config['captiveportal']['radiusacctport'])
- $radiusacctport = $config['captiveportal']['radiusacctport'] ;
+ if ($config['captiveportal']['radiusacctport'])
+ $radiusacctport = $config['captiveportal']['radiusacctport'];
else
$radiusacctport = 1813;
printf("Error: cannot open radius DB file in captiveportal_configure().\n");
return 1;
} else {
- fwrite($fd,$radiusip . "," . $radiusport . "," . $radiusacctport . "," . $radiuskey) ;
+ fwrite($fd,$radiusip . "," . $radiusport . "," . $radiusacctport . "," . $radiuskey);
}
- fclose($fd) ;
+ fclose($fd);
}
-
if ($g['booting'])
echo "done\n";
} else {
killbypid("{$g['varrun_path']}/mini_httpd.cp.pid");
killbypid("{$g['varrun_path']}/minicron.pid");
- captiveportal_radius_stop_all() ;
+
+ captiveportal_radius_stop_all();
+
mwexec("/sbin/sysctl net.link.ether.ipfw=0");
+
if (!isset($config['shaper']['enable'])) {
/* unload ipfw */
mwexec("/sbin/kldunload ipfw");
}
if ($timedout) {
- /* this client needs to be deleted - remove ipfw rules */
- if (isset($config['captiveportal']['radacct_enable']) && isset($radiusservers[0])) {
- RADIUS_ACCOUNTING_STOP($cpdb[$i][1], // ruleno
- $cpdb[$i][4], // username
- $cpdb[$i][5], // sessionid
- $cpdb[$i][0], // start time
- $radiusservers[0]['ipaddr'],
- $radiusservers[0]['acctport'],
- $radiusservers[0]['key']);
- }
- mwexec("/sbin/ipfw delete " . $cpdb[$i][1] . " " . ($cpdb[$i][1]+10000));
+ captiveportal_disconnect($cpdb[$i], $radiusservers);
+ captiveportal_logportalauth($cpdb[$i][4], $cpdb[$i][3], $cpdb[$i][2], "TIMEOUT");
unset($cpdb[$i]);
}
}
captiveportal_unlock();
}
+/* remove a single client according to the DB entry */
+function captiveportal_disconnect($dbent, $radiusservers) {
+
+ global $g, $config;
+
+ /* this client needs to be deleted - remove ipfw rules */
+ if (isset($config['captiveportal']['radacct_enable']) && isset($radiusservers[0])) {
+ RADIUS_ACCOUNTING_STOP($dbent[1], // ruleno
+ $dbent[4], // username
+ $dbent[5], // sessionid
+ $dbent[0], // start time
+ $radiusservers[0]['ipaddr'],
+ $radiusservers[0]['acctport'],
+ $radiusservers[0]['key'],
+ $dbent[2]); //clientip
+ }
+
+ mwexec("/sbin/ipfw delete " . $dbent[1] . " " . ($dbent[1]+10000));
+
+ //KEYCOM: we need to delete +40500 and +45500 as well...
+ //these are the rule numbers we use to control traffic shaping for each logged in user via captive portal
+ //we only need to remove our rules if peruserbw is turned on.
+ if (isset($config['captiveportal']['peruserbw'])) {
+ mwexec("/sbin/ipfw delete " . ($dbent[1]+40500));
+ mwexec("/sbin/ipfw delete " . ($dbent[1]+45500));
+ }
+}
+
/* remove a single client by ipfw rule number */
function captiveportal_disconnect_client($id) {
/* find entry */
for ($i = 0; $i < count($cpdb); $i++) {
if ($cpdb[$i][1] == $id) {
- /* this client needs to be deleted - remove ipfw rules */
- if (isset($config['captiveportal']['radacct_enable']) && isset($radiusservers[0])) {
- RADIUS_ACCOUNTING_STOP($cpdb[$i][1], // ruleno
- $cpdb[$i][4], // username
- $cpdb[$i][5], // sessionid
- $cpdb[$i][0], // start time
- $radiusservers[0]['ipaddr'],
- $radiusservers[0]['acctport'],
- $radiusservers[0]['key']);
- }
- mwexec("/sbin/ipfw delete " . $cpdb[$i][1] . " " . ($cpdb[$i][1]+10000));
+ captiveportal_disconnect($cpdb[$i], $radiusservers);
+ captiveportal_logportalauth($cpdb[$i][4], $cpdb[$i][3], $cpdb[$i][2], "DISCONNECT");
unset($cpdb[$i]);
break;
}
function captiveportal_radius_stop_all() {
global $g, $config;
- captiveportal_lock() ;
- $cpdb = captiveportal_read_db() ;
+ captiveportal_lock();
+ $cpdb = captiveportal_read_db();
$radiusservers = captiveportal_get_radius_servers();
$cpdb[$i][0], // start time
$radiusservers[0]['ipaddr'],
$radiusservers[0]['acctport'],
- $radiusservers[0]['key']);
+ $radiusservers[0]['key'],
+ $cpdb[$i][2]); //clientip
}
}
- captiveportal_unlock() ;
+ captiveportal_unlock();
}
function captiveportal_passthrumac_configure() {
global $config, $g;
+ captiveportal_lock();
+
/* clear out passthru macs, if necessary */
- if (file_exists("{$g['vardb_path']}/captiveportal_mac.db")) {
- unlink("{$g['vardb_path']}/captiveportal_mac.db");
- }
+ unlink_if_exists("{$g['vardb_path']}/captiveportal_mac.db");
if (is_array($config['captiveportal']['passthrumac'])) {
$fd = @fopen("{$g['vardb_path']}/captiveportal_mac.db", "w");
if (!$fd) {
printf("Error: cannot open passthru mac DB file in captiveportal_passthrumac_configure().\n");
+ captiveportal_unlock();
return 1;
}
fclose($fd);
}
+ captiveportal_unlock();
+
return 0;
}
function captiveportal_allowedip_configure() {
global $config, $g;
- captiveportal_lock() ;
+ captiveportal_lock();
/* clear out existing allowed ips, if necessary */
if (file_exists("{$g['vardb_path']}/captiveportal_ip.db")) {
if ($fd) {
while (!feof($fd)) {
$line = trim(fgets($fd));
- if($line) {
+ if ($line) {
list($ip,$rule) = explode(",",$line);
- mwexec("/sbin/ipfw delete $rule") ;
+ mwexec("/sbin/ipfw delete $rule");
}
}
}
- fclose($fd) ;
+ fclose($fd);
unlink("{$g['vardb_path']}/captiveportal_ip.db");
}
$fd = @fopen("{$g['vardb_path']}/captiveportal_ip.db", "w");
if (!$fd) {
printf("Error: cannot open allowed ip DB file in captiveportal_allowedip_configure().\n");
- captiveportal_unlock() ;
+ captiveportal_unlock();
return 1;
}
foreach ($config['captiveportal']['allowedip'] as $ipent) {
+
/* record allowed ip so it can be recognized and removed later */
fwrite($fd, $ipent['ip'] . "," . $ruleno ."\n");
+
/* insert ipfw rule to allow ip thru */
- if($ipent['dir'] == "from") {
- mwexec("/sbin/ipfw add $ruleno set 2 skipto 50000 ip from ".$ipent['ip']." to any in") ;
- mwexec("/sbin/ipfw add $ruleno set 2 skipto 50000 ip from any to ".$ipent['ip']." out") ;
+ if ($ipent['dir'] == "from") {
+ mwexec("/sbin/ipfw add $ruleno set 2 skipto 50000 ip from " . $ipent['ip'] . " to any in");
+ mwexec("/sbin/ipfw add $ruleno set 2 skipto 50000 ip from any to " . $ipent['ip'] . " out");
} else {
- mwexec("/sbin/ipfw add $ruleno set 2 skipto 50000 ip from any to ".$ipent['ip']." in") ;
- mwexec("/sbin/ipfw add $ruleno set 2 skipto 50000 ip from ".$ipent['ip']." to any out") ;
+ mwexec("/sbin/ipfw add $ruleno set 2 skipto 50000 ip from any to " . $ipent['ip'] . " in");
+ mwexec("/sbin/ipfw add $ruleno set 2 skipto 50000 ip from " . $ipent['ip'] . " to any out");
}
- $ruleno++ ;
+
+ $ruleno++;
if ($ruleno > 19899)
$ruleno = 10000;
}
}
}
- captiveportal_unlock() ;
+ captiveportal_unlock();
return 0;
}
unlink($lockfile);
}
+/* log successful captive portal authentication to syslog */
+/* part of this code from php.net */
+function captiveportal_logportalauth($user,$mac,$ip,$status) {
+ define_syslog_variables();
+ openlog("logportalauth", LOG_PID, LOG_LOCAL4);
+ // Log it
+ syslog(LOG_INFO, "$status: $user, $mac, $ip");
+ closelog();
+}
+
?>
config.inc
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
/* read platform */
if (file_exists("{$g['etc_path']}/platform")) {
- $g['platform'] = chop(file_get_contents("{$g['etc_path']}/platform"));
+ $g['fullplatform'] = chop(file_get_contents("{$g['etc_path']}/platform"));
+ $pla = explode("_", $g['fullplatform']);
+ $g['platform'] = $pla[0];
} else {
- $g['platform'] = "unknown";
+ $g['platform'] = $g['fullplatform'] = "unknown";
}
if ($g['booting']) {
filter.inc
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
echo "Configuring firewall... ";
/* set TCP timeouts */
- $tcpidletimeout = 9000;
+ $tcpidletimeout = 9000*2;
if ($config['filter']['tcpidletimeout'])
- $tcpidletimeout = $config['filter']['tcpidletimeout'];
+ $tcpidletimeout = $config['filter']['tcpidletimeout']*2;
mwexec("/sbin/sysctl net.inet.ipf.fr_tcpidletimeout={$tcpidletimeout}");
mwexec("/sbin/sysctl net.inet.ipf.fr_tcphalfclosed=480");
- mwexec("/sbin/sysctl net.inet.ipf.fr_udpacktimeout=240"); /* SIP... */
+ mwexec("/sbin/sysctl net.inet.ipf.fr_udpacktimeout=480"); /* SIP... */
/* generate ipnat rules */
$ipnatrules = filter_nat_rules_generate();
}
}
- if ($pptpdcfg['mode'] && $pptpdcfg['mode'] != "off") {
-
- if ($pptpdcfg['mode'] == "server")
- $pptpdtarget = "127.0.0.1";
- else if ($pptpdcfg['mode'] == "redir")
- $pptpdtarget = $pptpdcfg['redir'];
-
- if ($pptpdtarget) {
+ if ($pptpdcfg['mode'] == "redir" && $pptpdcfg['redir']) {
$natrules .= <<<EOD
# PPTP
-rdr $wanif 0/0 port 0 -> $pptpdtarget port 0 gre
-rdr $wanif 0/0 port 1723 -> $pptpdtarget port 1723 tcp
+rdr $wanif 0/0 port 0 -> {$pptpdcfg['redir']} port 0 gre
+rdr $wanif 0/0 port 1723 -> {$pptpdcfg['redir']} port 1723 tcp
EOD;
- }
}
return $natrules;
$lanif = $lancfg['if'];
$wanif = get_real_wan_interface();
+ $curwanip = get_current_wan_address();
+
/* rule groups (optional interfaces: see below) */
$ifgroups = array("lan" => 100, "wan" => 200);
}
}
$oic['bridge'] = 1;
+ $oic['bridge_if'] = $oc['bridge'];
} else {
$oic['ip'] = $oc['ipaddr'];
$oic['sn'] = $oc['subnet'];
/* pass traffic between statically routed subnets and the subnet on the
interface in question to avoid problems with complicated routing
topologies */
- if (is_array($config['staticroutes']['route']) && count($config['staticroutes']['route'])) {
+ if (isset($config['filter']['bypassstaticroutes']) && is_array($config['staticroutes']['route']) && count($config['staticroutes']['route'])) {
foreach ($config['staticroutes']['route'] as $route) {
unset($sa);
EOD;
- /* LAN spoof check */
- $ipfrules .= filter_rules_spoofcheck_generate('lan', $lanif, $lansa, $lansn, $log);
+ /* LAN spoof check */
+ /* omit if any interface is bridged to LAN and the filtering bridge is on */
+ $lanbridge = false;
+ foreach ($optcfg as $on => $oc) {
+ if ($oc['bridge'] && $oc['bridge_if'] == "lan") {
+ $lanbridge = true;
+ break;
+ }
+ }
+ if (!$lanbridge || !isset($config['bridge']['filteringbridge']))
+ $ipfrules .= filter_rules_spoofcheck_generate('lan', $lanif, $lansa, $lansn, $log);
/* OPT spoof check */
foreach ($optcfg as $on => $oc) {
- if ($oc['ip'])
+ /* omit for bridged interfaces when the filtering bridge is on */
+ if ($oc['ip'] && (!$oc['bridge'] || !isset($config['bridge']['filteringbridge'])))
$ipfrules .= filter_rules_spoofcheck_generate($on, $oc['if'], $oc['sa'], $oc['sn'], $log);
}
count($config['ipsec']['tunnel'])) ||
isset($config['ipsec']['mobileclients']['enable']))) {
- $curwanip = get_current_wan_address();
-
if ($curwanip)
$ipfrules .= filter_rules_ipsec_generate($wanif, $curwanip);
if ($pptpdcfg['mode'] && ($pptpdcfg['mode'] != "off")) {
if ($pptpdcfg['mode'] == "server")
- $pptpdtarget = "127.0.0.1";
+ $pptpdtarget = $curwanip;
else
$pptpdtarget = $pptpdcfg['redir'];
-
- $ipfrules .= <<<EOD
+
+ if ($pptpdtarget) {
+ $ipfrules .= <<<EOD
# PPTP rules
pass in quick proto gre from any to $pptpdtarget keep state group 200
pass in quick proto tcp from any to $pptpdtarget port = 1723 keep state group 200
EOD;
+ }
}
/* BigPond client enabled? */
if ($rule['protocol'] == "tcp") {
$line = "block return-rst";
} else if ($rule['protocol'] == "udp") {
- $line = "block return-icmp";
+ $line = "block return-icmp(port-unr)";
} else {
$line = "block";
}
$line .= " in ";
if (isset($rule['log']))
- $line .= "log ";
+ $line .= "log first ";
$line .= "quick ";
$optcfg[$rule['source']['network']]['sn'];
} else {
switch ($rule['source']['network']) {
+ case 'wanip':
+ $src = $curwanip;
+ break;
case 'lan':
$src = "$lansa/$lansn";
break;
$optcfg[$rule['destination']['network']]['sn'];
} else {
switch ($rule['destination']['network']) {
+ case 'wanip':
+ $dst = $curwanip;
+ break;
case 'lan':
$dst = "$lansa/$lansn";
break;
functions.inc
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
globals.inc
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
"pptp_subnet" => 28,
"debug" => false,
"latest_config" => "1.4",
- "nopccard_platforms" => array("wrap", "net48xx")
+ "nopccard_platforms" => array("wrap", "net48xx"),
+ "wireless_regex" => "/^(wi|ath|an)/"
);
?>
interfaces.inc
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
mwexec($cmd);
}
+ $addflags = "";
+ if (strpos($lancfg['if'], "fxp") !== false)
+ $addflags .= " link0";
+
mwexec("/sbin/ifconfig " . escapeshellarg($lancfg['if']) . " " .
- escapeshellarg($lancfg['ipaddr'] . "/" . $lancfg['subnet']));
+ escapeshellarg($lancfg['ipaddr'] . "/" . $lancfg['subnet']) . $addflags);
if (!$g['booting']) {
/* make new hosts file */
if (isset($config['bridge']['filteringbridge']))
mwexec("/sbin/sysctl net.link.ether.bridge_ipf=1");
+ else
+ mwexec("/sbin/sysctl net.link.ether.bridge_ipf=0");
mwexec("/sbin/sysctl net.link.ether.bridge=1");
} else {
if (strstr($if, "tap"))
ovpn_link_tap();
}
+
+ $addflags = "";
+ if (strpos($optcfg['if'], "fxp") !== false)
+ $addflags .= " link0";
/* bridged? */
if ($optcfg['bridge']) {
":" . $opti;
} else {
mwexec("/sbin/ifconfig " . escapeshellarg($optcfg['if']) . " " .
- escapeshellarg($optcfg['ipaddr'] . "/" . $optcfg['subnet']));
+ escapeshellarg($optcfg['ipaddr'] . "/" . $optcfg['subnet']) . $addflags);
}
} else {
mwexec("/sbin/ifconfig " . escapeshellarg($optcfg['if']) .
$ifcargs .= "wepmode off ";
}
+ if (strstr($if, "ath")) {
+ if ($wlcfg['standard'])
+ $ifcargs .= "mode {$wlcfg['standard']} ";
+ }
+
switch ($wlcfg['mode']) {
case 'hostap':
- if (strstr($if, "wi"))
+ if (strstr($if, "ath"))
+ $ifcargs .= "-mediaopt adhoc mediaopt hostap ";
+ else if (strstr($if, "wi"))
$ifcargs .= "-mediaopt ibss mediaopt hostap ";
break;
case 'ibss':
case 'IBSS':
- if (strstr($if, "wi"))
+ if (strstr($if, "ath"))
+ $ifcargs .= "-mediaopt hostap mediaopt adhoc ";
+ else if (strstr($if, "wi"))
$ifcargs .= "-mediaopt hostap mediaopt ibss ";
else if (strstr($if, "an"))
$ifcargs .= "mediaopt adhoc ";
break;
case 'bss':
case 'BSS':
- if (strstr($if, "wi"))
+ if (strstr($if, "ath"))
+ $ifcargs .= "-mediaopt hostap -mediaopt adhoc ";
+ else if (strstr($if, "wi"))
$ifcargs .= "-mediaopt hostap -mediaopt ibss ";
else if (strstr($if, "an"))
$ifcargs .= "-mediaopt adhoc ";
mwexec($cmd);
}
+ $addflags = "";
+ if (strpos($wancfg['if'], "fxp") !== false)
+ $addflags .= " link0";
+
switch ($wancfg['ipaddr']) {
case 'dhcp':
if (isset($wancfg['ispointtopoint']) && $wancfg['pointtopoint']) {
mwexec("/sbin/ifconfig " . escapeshellarg($wancfg['if']) . " " .
escapeshellarg($wancfg['ipaddr'] . "/" . $wancfg['subnet']) .
- " " . escapeshellarg($wancfg['pointtopoint']) . " up");
+ " " . escapeshellarg($wancfg['pointtopoint']) . $addflags . " up");
} else {
mwexec("/sbin/ifconfig " . escapeshellarg($wancfg['if']) . " " .
- escapeshellarg($wancfg['ipaddr'] . "/" . $wancfg['subnet']));
+ escapeshellarg($wancfg['ipaddr'] . "/" . $wancfg['subnet']) . $addflags);
}
/* install default route */
}
function interfaces_wan_dhcp_down() {
- mwexec("/sbin/dhclient -r");\r
+ mwexec("/sbin/dhclient -r");
+
sleep(3);
}
function interfaces_wan_dhcp_up() {
- interfaces_wan_dhcp_configure();\r
+ interfaces_wan_dhcp_configure();
+
sleep(3);
}
function interfaces_wan_pppoe_down() {
global $g;
- sigkillbypid("{$g['varrun_path']}/mpd.pid", "SIGUSR2");\r
+ sigkillbypid("{$g['varrun_path']}/mpd.pid", "SIGUSR2");
+
sleep(3);
}
function interfaces_wan_pppoe_up() {
global $g;
- sigkillbypid("{$g['varrun_path']}/mpd.pid", "SIGUSR1");\r
+ sigkillbypid("{$g['varrun_path']}/mpd.pid", "SIGUSR1");
+
sleep(3);
}
function interfaces_wan_pptp_down() {
global $g;
- sigkillbypid("{$g['varrun_path']}/mpd.pid", "SIGUSR2");\r
+ sigkillbypid("{$g['varrun_path']}/mpd.pid", "SIGUSR2");
+
sleep(3);
}
function interfaces_wan_pptp_up() {
global $g;
- sigkillbypid("{$g['varrun_path']}/mpd.pid", "SIGUSR1");\r
+ sigkillbypid("{$g['varrun_path']}/mpd.pid", "SIGUSR1");
+
sleep(3);
}
services.inc
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
/* DHCPRelay enabled on any interfaces? */
$dhcrelayenable = false;
- foreach ($dhcrelaycfg as $dhcrelayif => $dhcrelayifconf) {
- if (isset($dhcrelayifconf['enable']) &&
- (($dhcrelayif == "lan") ||
- (isset($config['interfaces'][$dhcrelayif]['enable']) &&
- $config['interfaces'][$dhcrelayif]['if'] && (!$config['interfaces'][$dhcrelayif]['bridge']))))
- $dhcrelayenable = true;
+
+ if (is_array($dhcrelaycfg)) {
+ foreach ($dhcrelaycfg as $dhcrelayif => $dhcrelayifconf) {
+ if (isset($dhcrelayifconf['enable']) &&
+ (($dhcrelayif == "lan") ||
+ (isset($config['interfaces'][$dhcrelayif]['enable']) &&
+ $config['interfaces'][$dhcrelayif]['if'] && (!$config['interfaces'][$dhcrelayif]['bridge'])))) {
+
+ $dhcrelayenable = true;
+ break;
+ }
+ }
}
if (!$dhcrelayenable)
if (isset($config['dnsupdate']['enable'])) {
$wanip = get_current_wan_address();
+
if ($wanip) {
-
+
$keyname = $config['dnsupdate']['keyname'];
/* trailing dot */
if (substr($keyname, -1) != ".")
but nsupdate insists on having both */
$fd = fopen("{$g['varetc_path']}/K{$keyname}+157+00000.private", "w");
$privkey .= <<<EOD
-Private-key-format: v1.2\r
+Private-key-format: v1.2
Algorithm: 157 (HMAC)
Key: {$config['dnsupdate']['keydata']}
fclose($fd);
/* write public key file */
- if ($config['dnsupdate']['keytype'] == "zone") {
- $flags = 257;
- $proto = 3;
- } else if ($config['dnsupdate']['keytype'] == "host") {
+ if ($config['dnsupdate']['keytype'] == "host") {
$flags = 513;
$proto = 3;
} else if ($config['dnsupdate']['keytype'] == "user") {
$flags = 0;
$proto = 2;
+ } else {
+ $flags = 257;
+ $proto = 3;
}
$fd = fopen("{$g['varetc_path']}/K{$keyname}+157+00000.key", "w");
fclose($fd);
/* generate update instructions */
- $upinst = "update delete {$config['dnsupdate']['host']} A\n";
- $upinst .= "update add {$config['dnsupdate']['host']} {$config['dnsupdate']['ttl']} A {$wanip}\n";
+ $upinst = "update delete {$hostname} A\n";
+ $upinst .= "update add {$hostname} {$config['dnsupdate']['ttl']} A {$wanip}\n";
$upinst .= "\n"; /* mind that trailing newline! */
$fd = fopen("{$g['varetc_path']}/nsupdatecmds", "w");
shaper.inc
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
$line .= "delay {$pipe['delay']} ";
}
+ if ($pipe['plr']) {
+ $line .= "plr {$pipe['plr']} ";
+ }
+
+ if ($pipe['qsize']) {
+ $line .= "queue {$pipe['qsize']} ";
+ }
+
switch ($pipe['mask']) {
case 'source':
$line .= "mask src-ip 0xffffffff ";
system.inc
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
$syslogconf = <<<EOD
local0.* %/var/log/filter.log
local3.* %/var/log/vpn.log
+local4.* %/var/log/portalauth.log
local7.* %/var/log/dhcpd.log
-*.notice;kern.debug;lpr.info;mail.crit;news.err;local0.none;local3.none;local7.none %/var/log/system.log
+*.notice;kern.debug;lpr.info;mail.crit;news.err;local0.none;local3.none;local4.none;local7.none %/var/log/system.log
security.* %/var/log/system.log
auth.info;authpriv.info;daemon.info %/var/log/system.log
*.emerg *
$syslogconf .= <<<EOD
local3.* @{$syslogcfg['remoteserver']}
+EOD;
+ }
+
+ if (isset($syslogcfg['portalauth'])) {
+ $syslogconf .= <<<EOD
+local4.* @{$syslogcfg['remoteserver']}
+
EOD;
}
if (isset($syslogcfg['system'])) {
$syslogconf .= <<<EOD
-*.notice;kern.debug;lpr.info;mail.crit;news.err;local0.none;local3.none;local7.none @{$syslogcfg['remoteserver']}
+*.notice;kern.debug;lpr.info;mail.crit;news.err;local0.none;local3.none;local4.none;local7.none @{$syslogcfg['remoteserver']}
security.* @{$syslogcfg['remoteserver']}
auth.info;authpriv.info;daemon.info @{$syslogcfg['remoteserver']}
*.emerg @{$syslogcfg['remoteserver']}
$cert = <<<EOD
-----BEGIN CERTIFICATE-----
MIIBlDCB/gIBADANBgkqhkiG9w0BAQQFADATMREwDwYDVQQKEwhtMG4wd2FsbDAe
-Fw0wMzA5MDgxNzAzNDZaFw0wNDA5MDcxNzAzNDZaMBMxETAPBgNVBAoTCG0wbjB3
+Fw0wNTA1MTAxMjI0NDRaFw0wNzA1MTAxMjI0NDRaMBMxETAPBgNVBAoTCG0wbjB3
YWxsMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDAShszhFz+o8lsMWTGgTxs
TMPR+v4+qL5jXDyY97MLTGFK7aqQOtpIQc+TcTc4jklgOVlHoR7oBXrsi8YrbCd+
83LPQmQoSPC0VqhfU3uYf3NzxiK8r97aPCsmWgwT2pQ6TcESTm6sF7nLprOf/zFP
-C4jE2fvjkbzyVolPywBuewIDAQABMA0GCSqGSIb3DQEBBAUAA4GBAK2D8NqQSlUs
-pFCe5J9ue1LrjfGHHy4HE9zA9avgrz3Qju+1JOshEwy/1BJjZ93tQUbiRS7RwvDO
-4crGG4IejjhFczzA2CIX3rd2rYM2oGpojKgm5YuuhV5lYPwAHUOLbBaLOVqlLhzw
-VqjD7R2DkXUIfhJ5ZekqK5ZwzqJXta8U
+C4jE2fvjkbzyVolPywBuewIDAQABMA0GCSqGSIb3DQEBBAUAA4GBAFR962c4R5tV
+cTn0OQcszYoW6WC+ini9tQQh5ku5jYDAiC+00atawJEVLnL3lwAcpSKTIWlTkD20
+tl3lz5br1qFgYky+Rd0kwS2nk9jRbkxSXxd6KJVnNRCKre28aw3ENzZfCSurPQsX
+UPp5er+NtwMT1g7s/JDmKTC4w1rGr5/c
-----END CERTIFICATE-----
EOD;
if (is_numeric($standby)) {
// Sync the disk(s)
mwexec('/bin/sync');
- if (!mwexec('/sbin/sysctl hw.ata.standby=' . ((int)$standby))) {
+ if (!mwexec('/sbin/sysctl hw.ata.suspend=' . ((int)$standby))) {
// Reinitialize ATA-drives
mwexec('/usr/local/sbin/atareinit');
if ($g['booting']) {
util.inc
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
vpn.inc
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
mwexec("/usr/sbin/setkey -F");
/* prefer old SAs only for 30 seconds, then use the new one */
- mwexec("/sbin/sysctl -w net.key.preferred_oldsa=-30");
+ if (!isset($config['ipsec']['preferoldsa']))
+ mwexec("/sbin/sysctl -w net.key.preferred_oldsa=-30");
+ else
+ mwexec("/sbin/sysctl -w net.key.preferred_oldsa=1");
if (isset($ipseccfg['enable'])) {
/* start racoon */
mwexec("/usr/local/sbin/racoon -d -f {$g['varetc_path']}/racoon.conf");
- foreach ($ipseccfg['tunnel'] as $tunnel) {
- if (isset($tunnel['auto'])) {
- $remotehost = substr($tunnel['remote-subnet'],0,strpos($tunnel['remote-subnet'],"/"));
- $srchost = vpn_endpoint_determine($tunnel, $curwanip);
- if ($srchost)
- mwexec_bg("/sbin/ping -c 1 -S {$srchost} {$remotehost}");
+ if (is_array($ipseccfg['tunnel'])) {
+ foreach ($ipseccfg['tunnel'] as $tunnel) {
+ if (isset($tunnel['auto'])) {
+ $remotehost = substr($tunnel['remote-subnet'],0,strpos($tunnel['remote-subnet'],"/"));
+ $srchost = vpn_endpoint_determine($tunnel, $curwanip);
+ if ($srchost)
+ mwexec_bg("/sbin/ping -c 1 -S {$srchost} {$remotehost}");
+ }
}
}
}
EOD;
}
- if (isset($config['dnsmasq']['enable'])) {
+ if (is_array($pptpdcfg['dnsserver']) && ($pptpdcfg['dnsserver'][0])) {
+ $mpdconf .= " set ipcp dns " . join(" ", $pptpdcfg['dnsserver']) . "\n";
+ } else if (isset($config['dnsmasq']['enable'])) {
$mpdconf .= " set ipcp dns " . $config['interfaces']['lan']['ipaddr'];
if ($syscfg['dnsserver'][0])
$mpdconf .= " " . $syscfg['dnsserver'][0];
functions to parse/dump configuration files in XML format
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
rc.banner
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
*** This is m0n0wall, version {$version}
- built on {$buildtime} for {$g['platform']}
- Copyright (C) 2002-2004 by Manuel Kasper. All rights reserved.
+ built on {$buildtime} for {$g['fullplatform']}
+ Copyright (C) 2002-2005 by Manuel Kasper. All rights reserved.
Visit http://m0n0.ch/wall for updates.
rc.bootup
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
/* start DHCP service */
services_dhcpd_configure();
+ /* start DHCP relay */
+ services_dhcrelay_configure();
+
/* start SNMP service */
services_snmpd_configure();
rc.initial.defaults
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
rc.initial.password
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
rc.initial.ping
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
rc.initial.reboot
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
rc.initial.setlanip
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
unset($config['dhcpd']['lan']['enable']);
}
+ $proto = "http";
if ($config['system']['webgui']['protocol'] == "https") {
echo "\nDo you want to revert to HTTP as the webGUI protocol? (y/n) ";
if (strcasecmp(chop(fgets($fp)), "y") == 0)
$config['system']['webgui']['protocol'] = "http";
+ else
+ $proto = "https";
}
if (isset($config['system']['webgui']['noantilockout'])) {
You can now access the webGUI by opening the following URL
in your browser:
-http://$lanip/
+$proto://$lanip/
Press ENTER to continue.
rc.initial.setports
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
if (strcasecmp(chop(fgets($fp)), "y") == 0) {
$config['interfaces']['lan']['if'] = $lanif;
- if (preg_match("/^(wi|awi|an)/", $lanif)) {
+ if (preg_match($g['wireless_regex'], $lanif)) {
if (!is_array($config['interfaces']['lan']['wireless']))
$config['interfaces']['lan']['wireless'] = array();
} else {
}
$config['interfaces']['wan']['if'] = $wanif;
- if (preg_match("/^(wi|awi|an)/", $wanif)) {
+ if (preg_match($g['wireless_regex'], $wanif)) {
if (!is_array($config['interfaces']['wan']['wireless']))
$config['interfaces']['wan']['wireless'] = array();
} else {
$config['interfaces']['opt' . ($i+1)]['if'] = $optif[$i];
/* wireless interface? */
- if (preg_match("/^(wi|awi|an)/", $optif[$i])) {
+ if (preg_match($g['wireless_regex'], $optif[$i])) {
if (!is_array($config['interfaces']['opt' . ($i+1)]['wireless']))
$config['interfaces']['opt' . ($i+1)]['wireless'] = array();
} else {
rc.newwanip
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
return 0; /* nothing to do */
}
- /* resync ipfilter */
- filter_resync();
+ /* reload firewall rules */
+ filter_rules_generate();
/* flush NAT table */
filter_flush_nat_table();
rc.prunecaptiveportal
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
--- /dev/null
+//Javascript name: My Date Time Picker\r
+//Date created: 16-Nov-2003 23:19\r
+//Scripter: TengYong Ng\r
+//Website: http://www.rainforestnet.com\r
+//Copyright (c) 2003 TengYong Ng\r
+//FileName: DateTimePicker.js\r
+//Version: 0.8\r
+//Contact: contact@rainforestnet.com\r
+// Note: Permission given to use this script in ANY kind of applications if\r
+// header lines are left unchanged.
+\r
+//Global variables\r
+var winCal;\r
+var dtToday=new Date();\r
+var Cal;\r
+var docCal;\r
+var MonthName=["January", "February", "March", "April", "May", "June","July", \r
+ "August", "September", "October", "November", "December"];\r
+var WeekDayName=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]; \r
+var exDateTime;//Existing Date and Time\r
+\r
+//Configurable parameters\r
+var cnTop="200";//top coordinate of calendar window.\r
+var cnLeft="500";//left coordinate of calendar window\r
+var WindowTitle ="DateTime Picker";//Date Time Picker title.\r
+var WeekChar=2;//number of character for week day. if 2 then Mo,Tu,We. if 3 then Mon,Tue,Wed.\r
+var CellWidth=20;//Width of day cell.\r
+var DateSeparator="/";//Date Separator, you can change it to "/" if you want.\r
+var TimeMode=24;//default TimeMode value. 12 or 24\r
+\r
+var ShowLongMonth=true;//Show long month name in Calendar header. example: "January".\r
+var ShowMonthYear=true;//Show Month and Year in Calendar header.\r
+var MonthYearColor="#435370";//Font Color of Month and Year in Calendar header.\r
+var WeekHeadColor="#777777";//Background Color in Week header.\r
+var SundayColor="#D9DEE8";//Background color of Sunday.\r
+var SaturdayColor="#D9DEE8";//Background color of Saturday.\r
+var WeekDayColor="white";//Background color of weekdays.\r
+var FontColor="black";//color of font in Calendar day cell.\r
+var TodayColor="#FFFF33";//Background color of today.\r
+var SelDateColor="red";//Backgrond color of selected date in textbox.\r
+var YrSelColor="black";//color of font of Year selector.\r
+var ThemeBg="";//Background image of Calendar window.\r
+//end Configurable parameters\r
+//end Global variable\r
+\r
+function NewCal(pCtrl,pFormat,pShowTime,pTimeMode)\r
+{\r
+ Cal=new Calendar(dtToday);\r
+ if ((pShowTime!=null) && (pShowTime))\r
+ {\r
+ Cal.ShowTime=true;\r
+ if ((pTimeMode!=null) &&((pTimeMode=='12')||(pTimeMode=='24')))\r
+ {\r
+ TimeMode=pTimeMode;\r
+ } \r
+ } \r
+ if (pCtrl!=null)\r
+ Cal.Ctrl=pCtrl;\r
+ if (pFormat!=null)\r
+ Cal.Format=pFormat.toUpperCase();\r
+ \r
+ exDateTime=document.getElementById(pCtrl).value;\r
+ if (exDateTime!="")//Parse Date String\r
+ {\r
+ var Sp1;//Index of Date Separator 1\r
+ var Sp2;//Index of Date Separator 2 \r
+ var tSp1;//Index of Time Separator 1\r
+ var tSp1;//Index of Time Separator 2\r
+ var strMonth;\r
+ var strDate;\r
+ var strYear;\r
+ var intMonth;\r
+ var YearPattern;\r
+ var strHour;\r
+ var strMinute;\r
+ var strSecond;\r
+ //parse month\r
+ Sp1=exDateTime.indexOf(DateSeparator,0)\r
+ Sp2=exDateTime.indexOf(DateSeparator,(parseInt(Sp1)+1));\r
+ \r
+ if ((Cal.Format.toUpperCase()=="DDMMYYYY") || (Cal.Format.toUpperCase()=="DDMMMYYYY"))\r
+ {\r
+ strMonth=exDateTime.substring(Sp1+1,Sp2);\r
+ strDate=exDateTime.substring(0,Sp1);\r
+ }\r
+ else if ((Cal.Format.toUpperCase()=="MMDDYYYY") || (Cal.Format.toUpperCase()=="MMMDDYYYY"))\r
+ {\r
+ strMonth=exDateTime.substring(0,Sp1);\r
+ strDate=exDateTime.substring(Sp1+1,Sp2);\r
+ }\r
+ if (isNaN(strMonth))\r
+ intMonth=Cal.GetMonthIndex(strMonth);\r
+ else\r
+ intMonth=parseInt(strMonth,10)-1; \r
+ if ((parseInt(intMonth,10)>=0) && (parseInt(intMonth,10)<12))\r
+ Cal.Month=intMonth;\r
+ //end parse month\r
+ //parse Date\r
+ if ((parseInt(strDate,10)<=Cal.GetMonDays()) && (parseInt(strDate,10)>=1))\r
+ Cal.Date=strDate;\r
+ //end parse Date\r
+ //parse year\r
+ strYear=exDateTime.substring(Sp2+1,Sp2+5);\r
+ YearPattern=/^\d{4}$/;\r
+ if (YearPattern.test(strYear))\r
+ Cal.Year=parseInt(strYear,10);\r
+ //end parse year\r
+ //parse time\r
+ if (Cal.ShowTime==true)\r
+ {\r
+ tSp1=exDateTime.indexOf(":",0)\r
+ tSp2=exDateTime.indexOf(":",(parseInt(tSp1)+1));\r
+ strHour=exDateTime.substring(tSp1,(tSp1)-2);\r
+ Cal.SetHour(strHour);\r
+ strMinute=exDateTime.substring(tSp1+1,tSp2);\r
+ Cal.SetMinute(strMinute);\r
+ strSecond=exDateTime.substring(tSp2+1,tSp2+3);\r
+ Cal.SetSecond(strSecond);\r
+ } \r
+ }\r
+ winCal=window.open("","DateTimePicker","toolbar=0,status=0,menubar=0,fullscreen=no,width=195,height=200,resizable=0,top="+cnTop+",left="+cnLeft);\r
+ docCal=winCal.document;\r
+ RenderCal();\r
+}\r
+\r
+function RenderCal()\r
+{\r
+ var vCalHeader;\r
+ var vCalData;\r
+ var vCalTime;\r
+ var i;\r
+ var j;\r
+ var SelectStr;\r
+ var vDayCount=0;\r
+ var vFirstDay;\r
+\r
+ docCal.open();\r
+ docCal.writeln("<html><head><title>"+WindowTitle+"</title>");\r
+ docCal.writeln("<script>var winMain=window.opener;</script>");\r
+ docCal.writeln("<style>");\r
+ docCal.writeln("body,td,th,input,select {font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif;font-size: 11px;}");\r
+ docCal.writeln("a {text-decoration: none;}");\r
+ docCal.writeln("</style>");\r
+ docCal.writeln("</head><body background='"+ThemeBg+"' link="+FontColor+" vlink="+FontColor+"><form name='Calendar'>");\r
+\r
+ vCalHeader="<table border=1 cellpadding=1 cellspacing=1 align=\"center\" valign=\"top\" bgcolor='#EEEEEE' style=\"border-color:#999999; border-style:solid; border-collapse:collapse\">\n";\r
+ //Month Selector\r
+ vCalHeader+="<tr>\n<td colspan='7'><table border=0 width='100%' cellpadding=0 cellspacing=0><tr><td align='left'>\n";\r
+ vCalHeader+="<select name=\"MonthSelector\" onChange=\"javascript:winMain.Cal.SwitchMth(this.selectedIndex);winMain.RenderCal();\">\n";\r
+ for (i=0;i<12;i++)\r
+ {\r
+ if (i==Cal.Month)\r
+ SelectStr="Selected";\r
+ else\r
+ SelectStr=""; \r
+ vCalHeader+="<option "+SelectStr+" value >"+MonthName[i]+"\n";\r
+ }\r
+ vCalHeader+="</select></td>";\r
+ //Year selector\r
+ vCalHeader+="\n<td align='right'><a href=\"javascript:winMain.Cal.DecYear();winMain.RenderCal()\"><b><font color=\""+YrSelColor+"\"><</font></b></a><font face=\"Verdana\" color=\""+YrSelColor+"\" size=2><b> "+Cal.Year+" </b></font><a href=\"javascript:winMain.Cal.IncYear();winMain.RenderCal()\"><b><font color=\""+YrSelColor+"\">></font></b></a></td></tr></table></td>\n"; \r
+ vCalHeader+="</tr>";\r
+ //Calendar header shows Month and Year\r
+ if (ShowMonthYear)\r
+ vCalHeader+="<tr><td colspan='7'><font face='Verdana' size='2' align='center' color='"+MonthYearColor+"'><b>"+Cal.GetMonthName(ShowLongMonth)+" "+Cal.Year+"</b></font></td></tr>\n";\r
+ //Week day header\r
+ vCalHeader+="<tr bgcolor="+WeekHeadColor+">";\r
+ for (i=0;i<7;i++)\r
+ {\r
+ vCalHeader+="<td align='center'><font face='Verdana' size='2'>"+WeekDayName[i].substr(0,WeekChar)+"</font></td>";\r
+ }\r
+ vCalHeader+="</tr>"; \r
+ docCal.write(vCalHeader);\r
+ \r
+ //Calendar detail\r
+ CalDate=new Date(Cal.Year,Cal.Month);\r
+ CalDate.setDate(1);\r
+ vFirstDay=CalDate.getDay();\r
+ vCalData="<tr>";\r
+ for (i=0;i<vFirstDay;i++)\r
+ {\r
+ vCalData=vCalData+GenCell();\r
+ vDayCount=vDayCount+1;\r
+ }\r
+ for (j=1;j<=Cal.GetMonDays();j++)\r
+ {\r
+ var strCell;\r
+ vDayCount=vDayCount+1;\r
+ if ((j==dtToday.getDate())&&(Cal.Month==dtToday.getMonth())&&(Cal.Year==dtToday.getFullYear()))\r
+ strCell=GenCell(j,true,TodayColor);//Highlight today's date\r
+ else\r
+ {\r
+ if (j==Cal.Date)\r
+ {\r
+ strCell=GenCell(j,true,SelDateColor);\r
+ }\r
+ else\r
+ { \r
+ if (vDayCount%7==0)\r
+ strCell=GenCell(j,false,SaturdayColor);\r
+ else if ((vDayCount+6)%7==0)\r
+ strCell=GenCell(j,false,SundayColor);\r
+ else\r
+ strCell=GenCell(j,null,WeekDayColor);\r
+ } \r
+ } \r
+ vCalData=vCalData+strCell;\r
+\r
+ if((vDayCount%7==0)&&(j<Cal.GetMonDays()))\r
+ {\r
+ vCalData=vCalData+"</tr>\n<tr>";\r
+ }\r
+ }\r
+ docCal.writeln(vCalData); \r
+ //Time picker\r
+ if (Cal.ShowTime)\r
+ {\r
+ var showHour;\r
+ showHour=Cal.getShowHour(); \r
+ vCalTime="<tr>\n<td colspan='7' align='center'>";\r
+ vCalTime+="<input type='text' name='hour' maxlength=2 size=1 style=\"WIDTH: 22px\" value="+showHour+" onchange=\"javascript:winMain.Cal.SetHour(this.value)\">";\r
+ vCalTime+=" : ";\r
+ vCalTime+="<input type='text' name='minute' maxlength=2 size=1 style=\"WIDTH: 22px\" value="+Cal.Minutes+" onchange=\"javascript:winMain.Cal.SetMinute(this.value)\">";\r
+ vCalTime+=" : ";\r
+ vCalTime+="<input type='text' name='second' maxlength=2 size=1 style=\"WIDTH: 22px\" value="+Cal.Seconds+" onchange=\"javascript:winMain.Cal.SetSecond(this.value)\">";\r
+ if (TimeMode==12)\r
+ {\r
+ var SelectAm =(parseInt(Cal.Hours,10)<12)? "Selected":"";\r
+ var SelectPm =(parseInt(Cal.Hours,10)>=12)? "Selected":"";\r
+\r
+ vCalTime+="<select name=\"ampm\" onchange=\"javascript:winMain.Cal.SetAmPm(this.options[this.selectedIndex].value);\">";\r
+ vCalTime+="<option "+SelectAm+" value=\"AM\">AM</option>";\r
+ vCalTime+="<option "+SelectPm+" value=\"PM\">PM<option>";\r
+ vCalTime+="</select>";\r
+ } \r
+ vCalTime+="\n</td>\n</tr>";\r
+ docCal.write(vCalTime);\r
+ } \r
+ //end time picker\r
+ docCal.writeln("\n</table>");\r
+ docCal.writeln("</form></body></html>");\r
+ docCal.close();\r
+}\r
+\r
+function GenCell(pValue,pHighLight,pColor)//Generate table cell with value\r
+{\r
+ var PValue;\r
+ var PCellStr;\r
+ var vColor;\r
+ var vHLstr1;//HighLight string\r
+ var vHlstr2;\r
+ var vTimeStr;\r
+ \r
+ if (pValue==null)\r
+ PValue="";\r
+ else\r
+ PValue=pValue;\r
+ \r
+ if (pColor!=null)\r
+ vColor="bgcolor=\""+pColor+"\"";\r
+ else\r
+ vColor=""; \r
+ if ((pHighLight!=null)&&(pHighLight))\r
+ {vHLstr1="color='red'><b>";vHLstr2="</b>";}\r
+ else\r
+ {vHLstr1=">";vHLstr2="";} \r
+ \r
+ if (Cal.ShowTime)\r
+ {\r
+ vTimeStr="winMain.document.getElementById('"+Cal.Ctrl+"').value+=' '+"+"winMain.Cal.getShowHour()"+"+':'+"+"winMain.Cal.Minutes"+"+':'+"+"winMain.Cal.Seconds";\r
+ if (TimeMode==12)\r
+ vTimeStr+="+' '+winMain.Cal.AMorPM";\r
+ } \r
+ else\r
+ vTimeStr=""; \r
+ PCellStr="<td "+vColor+" width="+CellWidth+" align='center'><font face='verdana' size='2'"+vHLstr1+"<a href=\"javascript:winMain.document.getElementById('"+Cal.Ctrl+"').value='"+Cal.FormatDate(PValue)+"';"+vTimeStr+";window.close();\">"+PValue+"</a>"+vHLstr2+"</font></td>";\r
+ return PCellStr;\r
+}\r
+\r
+function Calendar(pDate,pCtrl)\r
+{\r
+ //Properties\r
+ this.Date=pDate.getDate();//selected date\r
+ this.Month=pDate.getMonth();//selected month number\r
+ this.Year=pDate.getFullYear();//selected year in 4 digits\r
+ this.Hours=pDate.getHours(); \r
+ \r
+ if (pDate.getMinutes()<10)\r
+ this.Minutes="0"+pDate.getMinutes();\r
+ else\r
+ this.Minutes=pDate.getMinutes();\r
+ \r
+ if (pDate.getSeconds()<10)\r
+ this.Seconds="0"+pDate.getSeconds();\r
+ else \r
+ this.Seconds=pDate.getSeconds();\r
+ \r
+ this.MyWindow=winCal;\r
+ this.Ctrl=pCtrl;\r
+ this.Format="ddMMyyyy";\r
+ this.Separator=DateSeparator;\r
+ this.ShowTime=false;\r
+ if (pDate.getHours()<12)\r
+ this.AMorPM="AM";\r
+ else\r
+ this.AMorPM="PM"; \r
+}\r
+\r
+function GetMonthIndex(shortMonthName)\r
+{\r
+ for (i=0;i<12;i++)\r
+ {\r
+ if (MonthName[i].substring(0,3).toUpperCase()==shortMonthName.toUpperCase())\r
+ { return i;}\r
+ }\r
+}\r
+Calendar.prototype.GetMonthIndex=GetMonthIndex;\r
+\r
+function IncYear()\r
+{ Cal.Year++;}\r
+Calendar.prototype.IncYear=IncYear;\r
+\r
+function DecYear()\r
+{ Cal.Year--;}\r
+Calendar.prototype.DecYear=DecYear;\r
+ \r
+function SwitchMth(intMth)\r
+{ Cal.Month=intMth;}\r
+Calendar.prototype.SwitchMth=SwitchMth;\r
+\r
+function SetHour(intHour)\r
+{ \r
+ var MaxHour;\r
+ var MinHour;\r
+ if (TimeMode==24)\r
+ { MaxHour=23;MinHour=0}\r
+ else if (TimeMode==12)\r
+ { MaxHour=12;MinHour=1}\r
+ else\r
+ alert("TimeMode can only be 12 or 24"); \r
+ var HourExp=new RegExp("^\\d\\d$");\r
+ if (HourExp.test(intHour) && (parseInt(intHour,10)<=MaxHour) && (parseInt(intHour,10)>=MinHour))\r
+ { \r
+ if ((TimeMode==12) && (Cal.AMorPM=="PM"))\r
+ {\r
+ if (parseInt(intHour,10)==12)\r
+ Cal.Hours=12;\r
+ else \r
+ Cal.Hours=parseInt(intHour,10)+12;\r
+ } \r
+ else if ((TimeMode==12) && (Cal.AMorPM=="AM"))\r
+ {\r
+ if (intHour==12)\r
+ intHour-=12;\r
+ Cal.Hours=parseInt(intHour,10);\r
+ }\r
+ else if (TimeMode==24)\r
+ Cal.Hours=parseInt(intHour,10); \r
+ }\r
+}\r
+Calendar.prototype.SetHour=SetHour;\r
+\r
+function SetMinute(intMin)\r
+{\r
+ var MinExp=new RegExp("^\\d\\d$");\r
+ if (MinExp.test(intMin) && (intMin<60))\r
+ Cal.Minutes=intMin;\r
+}\r
+Calendar.prototype.SetMinute=SetMinute;\r
+\r
+function SetSecond(intSec)\r
+{ \r
+ var SecExp=new RegExp("^\\d\\d$");\r
+ if (SecExp.test(intSec) && (intSec<60))\r
+ Cal.Seconds=intSec;\r
+}\r
+Calendar.prototype.SetSecond=SetSecond;\r
+\r
+function SetAmPm(pvalue)\r
+{\r
+ this.AMorPM=pvalue;\r
+ if (pvalue=="PM")\r
+ {\r
+ this.Hours=(parseInt(this.Hours,10))+12;\r
+ if (this.Hours==24)\r
+ this.Hours=12;\r
+ } \r
+ else if (pvalue=="AM")\r
+ this.Hours-=12; \r
+}\r
+Calendar.prototype.SetAmPm=SetAmPm;\r
+\r
+function getShowHour()\r
+{\r
+ var finalHour;\r
+ if (TimeMode==12)\r
+ {\r
+ if (parseInt(this.Hours,10)==0)\r
+ {\r
+ this.AMorPM="AM";\r
+ finalHour=parseInt(this.Hours,10)+12; \r
+ }\r
+ else if (parseInt(this.Hours,10)==12)\r
+ {\r
+ this.AMorPM="PM";\r
+ finalHour=12;\r
+ } \r
+ else if (this.Hours>12)\r
+ {\r
+ this.AMorPM="PM";\r
+ if ((this.Hours-12)<10)\r
+ finalHour="0"+((parseInt(this.Hours,10))-12);\r
+ else\r
+ finalHour=parseInt(this.Hours,10)-12; \r
+ }\r
+ else\r
+ {\r
+ this.AMorPM="AM";\r
+ if (this.Hours<10)\r
+ finalHour="0"+parseInt(this.Hours,10);\r
+ else\r
+ finalHour=this.Hours; \r
+ }\r
+ }\r
+ else if (TimeMode==24)\r
+ {\r
+ if (this.Hours<10)\r
+ finalHour="0"+parseInt(this.Hours,10);\r
+ else \r
+ finalHour=this.Hours;\r
+ } \r
+ return finalHour; \r
+} \r
+Calendar.prototype.getShowHour=getShowHour; \r
+\r
+function GetMonthName(IsLong)\r
+{\r
+ var Month=MonthName[this.Month];\r
+ if (IsLong)\r
+ return Month;\r
+ else\r
+ return Month.substr(0,3);\r
+}\r
+Calendar.prototype.GetMonthName=GetMonthName;\r
+\r
+function GetMonDays()//Get number of days in a month\r
+{\r
+ var DaysInMonth=[31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\r
+ if (this.IsLeapYear())\r
+ {\r
+ DaysInMonth[1]=29;\r
+ } \r
+ return DaysInMonth[this.Month]; \r
+}\r
+Calendar.prototype.GetMonDays=GetMonDays;\r
+\r
+function IsLeapYear()\r
+{\r
+ if ((this.Year%4)==0)\r
+ {\r
+ if ((this.Year%100==0) && (this.Year%400)!=0)\r
+ {\r
+ return false;\r
+ }\r
+ else\r
+ {\r
+ return true;\r
+ }\r
+ }\r
+ else\r
+ {\r
+ return false;\r
+ }\r
+}\r
+Calendar.prototype.IsLeapYear=IsLeapYear;\r
+\r
+function FormatDate(pDate)\r
+{\r
+ if (this.Format.toUpperCase()=="DDMMYYYY")\r
+ return (pDate+DateSeparator+(this.Month+1)+DateSeparator+this.Year);\r
+ else if (this.Format.toUpperCase()=="DDMMMYYYY")\r
+ return (pDate+DateSeparator+this.GetMonthName(false)+DateSeparator+this.Year);\r
+ else if (this.Format.toUpperCase()=="MMDDYYYY")\r
+ return ((this.Month+1)+DateSeparator+pDate+DateSeparator+this.Year);\r
+ else if (this.Format.toUpperCase()=="MMMDDYYYY")\r
+ return (this.GetMonthName(false)+DateSeparator+pDate+DateSeparator+this.Year); \r
+}\r
+Calendar.prototype.FormatDate=FormatDate;
\ No newline at end of file
diag_backup.php
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("Diagnostics", "Backup/restore");
+
/* omit no-cache headers because it confuses IE with file downloads */
$omit_nocacheheaders = true;
require("guiconfig.inc");
}
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("Diagnostics: Backup/restore");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
- <p class="pgtitle">Diagnostics: Backup/restore</p>
<form action="diag_backup.php" method="post" enctype="multipart/form-data">
<?php if ($input_errors) print_input_errors($input_errors); ?>
<?php if ($savemsg) print_info_box($savemsg); ?>
<tr>
<td width="22%" valign="baseline" class="vncell"> </td>
<td width="78%" class="vtable">
- <p> Click this button to download the system configuration
+ Click this button to download the system configuration
in XML format.<br>
<br>
<input name="Submit" type="submit" class="formbtn" id="download" value="Download configuration"></td>
</table>
</form>
<?php include("fend.inc"); ?>
-</body>
-</html>
diag_defaults.php
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("Diagnostics", "Factory defaults");
+
require("guiconfig.inc");
if ($_POST) {
}
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("Diagnostics: Factory defaults");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
-<p class="pgtitle">Diagnostics: Factory defaults</p>
<?php if ($rebootmsg): echo print_info_box($rebootmsg); else: ?>
<form action="diag_defaults.php" method="post">
<p><strong>If you click "Yes", the firewall will be reset
</form>
<?php endif; ?>
<?php include("fend.inc"); ?>
-</body>
-</html>
diag_dhcp_leases.php
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Björn Pålsson <bjorn@networksab.com> and Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Björn Pålsson <bjorn@networksab.com> and Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("Diagnostics", "DHCP leases");
+
require("guiconfig.inc");
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("Diagnostics: DHCP leases");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
-<p class="pgtitle">Diagnostics: DHCP leases</p>
<?php
flush();
return strcmp($a[$_GET['order']], $b[$_GET['order']]);
}
+function adjust_gmt($dt) {
+ $ts = strtotime($dt . " GMT");
+ return strftime("%Y/%m/%d %H:%M:%S", $ts);
+}
+
$fp = @fopen("{$g['vardb_path']}/dhcpd.leases","r");
if ($fp):
<td class="listhdrr"><a href="?all=<?=$_GET['all'];?>&order=hostname">Hostname</a></td>
<td class="listhdrr"><a href="?all=<?=$_GET['all'];?>&order=start">Start</a></td>
<td class="listhdr"><a href="?all=<?=$_GET['all'];?>&order=end">End</a></td>
+ <td class="list"></td>
</tr>
<?php
foreach ($leases as $data) {
} else {
$fspans = $fspane = "";
}
+ $lip = ip2long($data['ip']);
+ foreach ($config['dhcpd'] as $dhcpif => $dhcpifconf) {
+ if (($lip >= ip2long($dhcpifconf['range']['from'])) && ($lip <= ip2long($dhcpifconf['range']['to']))) {
+ $data['if'] = $dhcpif;
+ break;
+ }
+ }
echo "<tr>\n";
echo "<td class=\"listlr\">{$fspans}{$data['ip']}{$fspane} </td>\n";
echo "<td class=\"listr\">{$fspans}{$data['mac']}{$fspane} </td>\n";
echo "<td class=\"listr\">{$fspans}{$data['hostname']}{$fspane} </td>\n";
- echo "<td class=\"listr\">{$fspans}{$data['start']}{$fspane} </td>\n";
- echo "<td class=\"listr\">{$fspans}{$data['end']}{$fspane} </td>\n";
+ echo "<td class=\"listr\">{$fspans}" . adjust_gmt($data['start']) . "{$fspane} </td>\n";
+ echo "<td class=\"listr\">{$fspans}" . adjust_gmt($data['end']) . "{$fspane} </td>\n";
+ echo "<td class=\"list\" valign=\"middle\"><a href=\"services_dhcp_edit.php?if={$data['if']}&mac={$data['mac']}\"><img src=\"plus.gif\" width=\"17\" height=\"17\" border=\"0\" title=\"add a static mapping for this MAC address\"></a></td>\n";
echo "</tr>\n";
}
}
?>
</table>
-<p>
+<br>
<form action="diag_dhcp_leases.php" method="GET">
<input type="hidden" name="order" value="<?=$_GET['order'];?>">
<?php if ($_GET['all']): ?>
<?php endif; ?>
</form>
<?php else: ?>
-<p><strong>No leases file found. Is the DHCP server active?</strong></p>
+<strong>No leases file found. Is the DHCP server active?</strong>
<?php endif; ?>
<?php include("fend.inc"); ?>
-</body>
-</html>
diag_ipsec_sad.php
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("Diagnostics", "IPsec");
+
require("guiconfig.inc");
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("Diagnostics: IPsec");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
-<p class="pgtitle">Diagnostics: IPsec</p>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr><td>
+ <tr><td class="tabnavtbl">
<ul id="tabnav">
<li class="tabact">SAD</li>
<li class="tabinact"><a href="diag_ipsec_spd.php">SPD</a></li>
<?php endif; ?>
</td></tr></table>
<?php include("fend.inc"); ?>
-</body>
-</html>
diag_ipsec_spd.php
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("Diagnostics", "IPsec");
+
require("guiconfig.inc");
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("Diagnostics: IPsec");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
-<p class="pgtitle">Diagnostics: IPsec</p>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr><td>
+ <tr><td class="tabnavtbl">
<ul id="tabnav">
- <li class="tabinact"><a href="diag_ipsec_sad.php">SAD</a></li>
+ <li class="tabinact1"><a href="diag_ipsec_sad.php">SAD</a></li>
<li class="tabact">SPD</li>
</ul>
</td></tr>
<?php endif; ?>
</td></tr></table>
<?php include("fend.inc"); ?>
-</body>
-</html>
diag_logs.php
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("Diagnostics", "Logs");
require("guiconfig.inc");
$nentries = $config['syslog']['nentries'];
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("Diagnostics: Logs");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
-<p class="pgtitle">Diagnostics: Logs</p>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr><td>
+ <tr><td class="tabnavtbl">
<ul id="tabnav">
<li class="tabact">System</li>
<li class="tabinact"><a href="diag_logs_filter.php">Firewall</a></li>
<li class="tabinact"><a href="diag_logs_dhcp.php">DHCP</a></li>
+ <li class="tabinact"><a href="diag_logs_portal.php">Captive portal</a></li>
<li class="tabinact"><a href="diag_logs_vpn.php">PPTP VPN</a></li>
<li class="tabinact"><a href="diag_logs_settings.php">Settings</a></li>
</ul>
</tr>
</table>
<?php include("fend.inc"); ?>
-</body>
-</html>
diag_logs_dhcp.php
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("Diagnostics", "Logs");
require("guiconfig.inc");
$nentries = $config['syslog']['nentries'];
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("Diagnostics: Logs");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
-<p class="pgtitle">Diagnostics: Logs</p>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr><td>
+ <tr><td class="tabnavtbl">
<ul id="tabnav">
- <li class="tabinact"><a href="diag_logs.php">System</a></li>
+ <li class="tabinact1"><a href="diag_logs.php">System</a></li>
<li class="tabinact"><a href="diag_logs_filter.php">Firewall</a></li>
<li class="tabact">DHCP</li>
+ <li class="tabinact"><a href="diag_logs_portal.php">Captive portal</a></li>
<li class="tabinact"><a href="diag_logs_vpn.php">PPTP VPN</a></li>
<li class="tabinact"><a href="diag_logs_settings.php">Settings</a></li>
</ul>
</tr>
</table>
<?php include("fend.inc"); ?>
-</body>
-</html>
-
diag_logs_filter.php
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("Diagnostics", "Logs");
require("guiconfig.inc");
$nentries = $config['syslog']['nentries'];
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("Diagnostics: Logs");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
-<p class="pgtitle">Diagnostics: Logs</p>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr><td>
+ <tr><td class="tabnavtbl">
<ul id="tabnav">
- <li class="tabinact"><a href="diag_logs.php">System</a></li>
+ <li class="tabinact1"><a href="diag_logs.php">System</a></li>
<li class="tabact">Firewall</li>
<li class="tabinact"><a href="diag_logs_dhcp.php">DHCP</a></li>
+ <li class="tabinact"><a href="diag_logs_portal.php">Captive portal</a></li>
<li class="tabinact"><a href="diag_logs_vpn.php">PPTP VPN</a></li>
<li class="tabinact"><a href="diag_logs_settings.php">Settings</a></li>
</ul>
</tr>
</table>
<?php include("fend.inc"); ?>
-</body>
-</html>
--- /dev/null
+#!/usr/local/bin/php
+<?php
+/*
+ diag_logs_portal.php
+ part of m0n0wall (http://m0n0.ch/wall)
+
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+*/
+
+$pgtitle = array("Diagnostics", "Logs");
+require("guiconfig.inc");
+
+$nentries = $config['syslog']['nentries'];
+if (!$nentries)
+ $nentries = 50;
+
+if ($_POST['clear']) {
+ exec("/usr/sbin/clog -i -s 32768 /var/log/portalauth.log");
+}
+
+function dump_clog($logfile, $tail) {
+ global $g, $config;
+
+ $sor = isset($config['syslog']['reverse']) ? "-r" : "";
+
+ exec("/usr/sbin/clog " . $logfile . " | tail {$sor} -n " . $tail, $logarr);
+
+ foreach ($logarr as $logent) {
+ $logent = preg_split("/\s+/", $logent, 6);
+ echo "<tr valign=\"top\">\n";
+ echo "<td class=\"listlr\" nowrap>" . htmlspecialchars(join(" ", array_slice($logent, 0, 3))) . "</td>\n";
+ echo "<td class=\"listr\">" . htmlspecialchars($logent[5]) . "</td>\n";
+ echo "</tr>\n";
+ }
+}
+
+?>
+<?php include("fbegin.inc"); ?>
+<table width="100%" border="0" cellpadding="0" cellspacing="0">
+ <tr><td class="tabnavtbl">
+ <ul id="tabnav">
+ <li class="tabinact1"><a href="diag_logs.php">System</a></li>
+ <li class="tabinact"><a href="diag_logs_filter.php">Firewall</a></li>
+ <li class="tabinact"><a href="diag_logs_dhcp.php">DHCP</a></li>
+ <li class="tabact">Captive portal</li>
+ <li class="tabinact"><a href="diag_logs_vpn.php">PPTP VPN</a></li>
+ <li class="tabinact"><a href="diag_logs_settings.php">Settings</a></li>
+ </ul>
+ </td></tr>
+ <tr>
+ <td class="tabcont">
+ <table width="100%" border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td colspan="2" class="listtopic">
+ Last <?=$nentries;?> captive portal log entries</td>
+ </tr>
+ <?php dump_clog("/var/log/portalauth.log", $nentries); ?>
+ </table>
+ <br><form action="diag_logs_portal.php" method="post">
+<input name="clear" type="submit" class="formbtn" value="Clear log">
+</form>
+ </td>
+ </tr>
+</table>
+<?php include("fend.inc"); ?>
diag_logs_settings.php
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("Diagnostics", "Logs");
require("guiconfig.inc");
$pconfig['reverse'] = isset($config['syslog']['reverse']);
$pconfig['remoteserver'] = $config['syslog']['remoteserver'];
$pconfig['filter'] = isset($config['syslog']['filter']);
$pconfig['dhcp'] = isset($config['syslog']['dhcp']);
+$pconfig['portalauth'] = isset($config['syslog']['portalauth']);
$pconfig['vpn'] = isset($config['syslog']['vpn']);
$pconfig['system'] = isset($config['syslog']['system']);
$pconfig['enable'] = isset($config['syslog']['enable']);
$config['syslog']['remoteserver'] = $_POST['remoteserver'];
$config['syslog']['filter'] = $_POST['filter'] ? true : false;
$config['syslog']['dhcp'] = $_POST['dhcp'] ? true : false;
+ $config['syslog']['portalauth'] = $_POST['portalauth'] ? true : false;
$config['syslog']['vpn'] = $_POST['vpn'] ? true : false;
$config['syslog']['system'] = $_POST['system'] ? true : false;
$config['syslog']['enable'] = $_POST['enable'] ? true : false;
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("Diagnostics: Logs");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
+<?php include("fbegin.inc"); ?>
<script language="JavaScript">
<!--
function enable_change(enable_over) {
document.iform.remoteserver.disabled = 0;
document.iform.filter.disabled = 0;
document.iform.dhcp.disabled = 0;
+ document.iform.portalauth.disabled = 0;
document.iform.vpn.disabled = 0;
document.iform.system.disabled = 0;
} else {
document.iform.remoteserver.disabled = 1;
document.iform.filter.disabled = 1;
document.iform.dhcp.disabled = 1;
+ document.iform.portalauth.disabled = 1;
document.iform.vpn.disabled = 1;
document.iform.system.disabled = 1;
}
}
// -->
</script>
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-<p class="pgtitle">Diagnostics: Logs</p>
<form action="diag_logs_settings.php" method="post" name="iform" id="iform">
<?php if ($input_errors) print_input_errors($input_errors); ?>
<?php if ($savemsg) print_info_box($savemsg); ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr><td>
+ <tr><td class="tabnavtbl">
<ul id="tabnav">
- <li class="tabinact"><a href="diag_logs.php">System</a></li>
+ <li class="tabinact1"><a href="diag_logs.php">System</a></li>
<li class="tabinact"><a href="diag_logs_filter.php">Firewall</a></li>
<li class="tabinact"><a href="diag_logs_dhcp.php">DHCP</a></li>
+ <li class="tabinact"><a href="diag_logs_portal.php">Captive portal</a></li>
<li class="tabinact"><a href="diag_logs_vpn.php">PPTP VPN</a></li>
<li class="tabact">Settings</li>
</ul>
server</td>
<td width="78%" class="vtable"> <input name="remoteserver" id="remoteserver" type="text" class="formfld" size="20" value="<?=htmlspecialchars($pconfig['remoteserver']);?>">
<br>
- IP address of remote syslog server<br> <br> <input name="system" id="system" type="checkbox" value="yes" onclick="enable_change(false)" <?php if ($pconfig['system']) echo "checked"; ?>>
- system events <br> <input name="filter" id="filter" type="checkbox" value="yes" <?php if ($pconfig['filter']) echo "checked"; ?>>
- firewall events<br> <input name="dhcp" id="dhcp" type="checkbox" value="yes" <?php if ($pconfig['dhcp']) echo "checked"; ?>>
- DHCP service events<br> <input name="vpn" id="vpn" type="checkbox" value="yes" <?php if ($pconfig['vpn']) echo "checked"; ?>>
+ IP address of remote syslog server<br> <br>
+ <input name="system" id="system" type="checkbox" value="yes" onclick="enable_change(false)" <?php if ($pconfig['system']) echo "checked"; ?>>
+ system events <br>
+ <input name="filter" id="filter" type="checkbox" value="yes" <?php if ($pconfig['filter']) echo "checked"; ?>>
+ firewall events<br>
+ <input name="dhcp" id="dhcp" type="checkbox" value="yes" <?php if ($pconfig['dhcp']) echo "checked"; ?>>
+ DHCP service events<br>
+ <input name="portalauth" id="portalauth" type="checkbox" value="yes" <?php if ($pconfig['portalauth']) echo "checked"; ?>>
+ Captive portal<br>
+ <input name="vpn" id="vpn" type="checkbox" value="yes" <?php if ($pconfig['vpn']) echo "checked"; ?>>
PPTP VPN events</td>
</tr>
<tr>
</td>
</tr>
<tr>
- <td width="22%" height="53" valign="top"> </td>
+ <td width="22%" valign="top"> </td>
<td width="78%"><strong><span class="red">Note:</span></strong><br>
syslog sends UDP datagrams to port 514 on the specified
remote syslog server. Be sure to set syslogd on the
//-->
</script>
<?php include("fend.inc"); ?>
-</body>
-</html>
diag_logs_vpn.php
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("Diagnostics", "Logs");
require("guiconfig.inc");
$nentries = $config['syslog']['nentries'];
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("Diagnostics: Logs");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
-<p class="pgtitle">Diagnostics: Logs</p>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr><td>
+ <tr><td class="tabnavtbl">
<ul id="tabnav">
- <li class="tabinact"><a href="diag_logs.php">System</a></li>
+ <li class="tabinact1"><a href="diag_logs.php">System</a></li>
<li class="tabinact"><a href="diag_logs_filter.php">Firewall</a></li>
<li class="tabinact"><a href="diag_logs_dhcp.php">DHCP</a></li>
+ <li class="tabinact"><a href="diag_logs_portal.php">Captive portal</a></li>
<li class="tabact">PPTP VPN</li>
<li class="tabinact"><a href="diag_logs_settings.php">Settings</a></li>
</ul>
</tr>
</table>
<?php include("fend.inc"); ?>
-</body>
-</html>
diag_ping.php
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Bob Zoller (bob@kludgebox.com) and Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Bob Zoller (bob@kludgebox.com) and Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("Diagnostics", "Ping");
require("guiconfig.inc");
define('MAX_COUNT', 10);
if (!$input_errors) {
$do_ping = true;
- $host = preg_replace ("/[^A-Za-z0-9.]/","",$_POST['host']);
+ $host = $_POST['host'];
$count = $_POST['count'];
}
$count = DEFAULT_COUNT;
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("Diagnostics: Ping");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
-<p class="pgtitle">Diagnostics: Ping</font></p>
<?php if ($input_errors) print_input_errors($input_errors); ?>
<form action="diag_ping.php" method="post" name="iform" id="iform">
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td width="22%" valign="top" class="vncellreq">Host</td>
<td width="78%" class="vtable">
- <input name="host" type="text" class="formfld" id="host" size="20" value="<?=htmlspecialchars($host);?>"></td>
+ <?=$mandfldhtml;?><input name="host" type="text" class="formfld" id="host" size="20" value="<?=htmlspecialchars($host);?>"></td>
</tr>
<tr>
<td width="22%" valign="top" class="vncellreq">Count</td>
<td width="78%" class="vtable">
-<select name="count" class="formfld" id="count">
+ <select name="count" class="formfld" id="count">
<?php for ($i = 1; $i <= MAX_COUNT; $i++): ?>
<option value="<?=$i;?>" <?php if ($i == $count) echo "selected"; ?>><?=$i;?></option>
<?php endfor; ?>
</table>
</form>
<?php include("fend.inc"); ?>
-</body>
-</html>
diag_resetstate.php
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("Diagnostics", "Reset state");
require("guiconfig.inc");
if ($_POST) {
}
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("Diagnostics: Reset state");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
- <p class="pgtitle">Diagnostics: Reset state</p>
<?php if ($input_errors) print_input_errors($input_errors); ?>
<?php if ($savemsg) print_info_box($savemsg); ?>
<form action="diag_resetstate.php" method="post" name="iform" id="iform">
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td width="22%" valign="top" class="vtable"> </td>
- <td width="78%" class="vtable"> <p>
+ <td width="78%" class="vtable">
<input name="nattable" type="checkbox" id="nattable" value="yes" checked>
<strong>NAT table</strong><br>
<input name="statetable" type="checkbox" id="statetable" value="yes" checked>
<br>
NOTE: If you reset the firewall state table, the browser
session may appear to be hung after clicking "Reset".
- Simply refresh the page to continue.</span></p>
+ Simply refresh the page to continue.</span>
</td>
</tr>
<tr>
</table>
</form>
<?php include("fend.inc"); ?>
-</body>
-</html>
?>
// Set pointer to end of recall buffer.
- var intRecallPtr = arrRecallBuffer.length-1;
+ var intRecallPtr = arrRecallBuffer.length;
// Functions to extend String class.
function str_encode() { return escape( this ) }
return true;
}
+
+ // hansmi, 2005-01-13
+ function txtCommand_onKey(e) {
+ if(!e) var e = window.event; // IE-Fix
+ var code = (e.keyCode?e.keyCode:(e.which?e.which:0));
+ if(!code) return;
+ var f = document.getElementsByName('frmExecPlus')[0];
+ if(!f) return;
+ switch(code) {
+ case 38: // up
+ btnRecall_onClick(f, -1);
+ break;
+ case 40: // down
+ btnRecall_onClick(f, 1);
+ break;
+ }
+ }
//-->
</script>
<link href="gui.css" rel="stylesheet" type="text/css">
-->
</style>
</head>
-<body>
+<body<?php
+if(!isBlank($_POST['txtCommand'])) {
+ echo ' onload="document.forms[\'frmExecPlus\'].txtCommand.focus();"';
+}
+?>>
<p><span class="pgtitle"><?=$Title ?></span>
<?php if (isBlank($_POST['txtCommand'])): ?>
<p class="red"><strong>Note: this function is unsupported. Use it
<table>
<tr>
<td class="label" align="right">Command:</td>
- <td class="type"><input name="txtCommand" type="text" size="80" value="<?=htmlspecialchars($_POST['txtCommand']);?>"></td>
+ <td class="type"><input name="txtCommand" type="text" size="80" value="" onkeypress="txtCommand_onKey(event);"></td>
</tr>
<tr>
- <td valign="top"> </td>
+ <td valign="top"> </td>
<td valign="top" class="label">
<input type="hidden" name="txtRecallBuffer" value="<?=$_POST['txtRecallBuffer'] ?>">
<input type="button" class="button" name="btnRecallPrev" value="<" onClick="btnRecall_onClick( this.form, -1 );">
exec_raw.php
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
+<?php
+$navlevelsep = ": "; /* navigation level separator string */
+$mandfldhtml = ""; /* display this before mandatory input fields */
+$mandfldhtmlspc = ""; /* same as above, but with spacing */
+
+function gentitle($title) {
+ global $navlevelsep;
+ return join($navlevelsep, $title);
+}
+
+function genhtmltitle($title) {
+ global $config;
+ return $config['system']['hostname'] . "." . $config['system']['domain'] . " - " . gentitle($title);
+}
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<title><?=genhtmltitle($pgtitle);?></title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<link href="gui.css" rel="stylesheet" type="text/css">
+</head>
+
+<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<script language="javascript">
<!--
var tri_open = "";
</tr></table></td>
<td width="600"><table width="100%" border="0" cellpadding="10" cellspacing="0">
<tr><td>
+<?php if (!$pgtitle_omit): ?>
+ <p class="pgtitle"><?=gentitle($pgtitle);?></p>
+<?php endif; ?>
</td></tr></table></td>
</tr>
<tr align="center" valign="top" bgcolor="#435370">
- <td colspan="2" class="cpline">m0n0wall is © 2002-2004 by Manuel Kasper.
+ <td colspan="2" class="cpline">m0n0wall is © 2002-2005 by Manuel Kasper.
All rights reserved. [<a href="/license.php" class="tblnk">view license</a>]</td>
</tr>
-</table>
\ No newline at end of file
+</table>
+</body>
+</html>
firewall_aliases.php
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("Firewall", "Aliases");
require("guiconfig.inc");
if (!is_array($config['aliases']['alias']))
}
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("Firewall: Aliases");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
-<p class="pgtitle">Firewall: Aliases</p>
<form action="firewall_aliases.php" method="post">
<?php if ($savemsg) print_info_box($savemsg); ?>
<?php if (file_exists($d_aliasesdirty_path)): ?><p>
be resolved (e.g. because you deleted it), the corresponding element
(e.g. filter/NAT/shaper rule) will be considered invalid and skipped.</span></p>
<?php include("fend.inc"); ?>
-</body>
-</html>
firewall_aliases_edit.php
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("Firewall", "Aliases", "Edit alias");
require("guiconfig.inc");
if (!is_array($config['aliases']['alias']))
}
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("System: Firewall: Aliases: Edit alias");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
+<?php include("fbegin.inc"); ?>
<script language="JavaScript">
<!--
function typesel_change() {
}
//-->
</script>
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-<p class="pgtitle">Firewall: Aliases: Edit alias</p>
<?php if ($input_errors) print_input_errors($input_errors); ?>
<form action="firewall_aliases_edit.php" method="post" name="iform" id="iform">
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td valign="top" class="vncellreq">Name</td>
- <td class="vtable"> <input name="name" type="text" class="formfld" id="name" size="40" value="<?=htmlspecialchars($pconfig['name']);?>">
+ <td class="vtable"><?=$mandfldhtml;?><input name="name" type="text" class="formfld" id="name" size="40" value="<?=htmlspecialchars($pconfig['name']);?>">
<br> <span class="vexpl">The name of the alias may only consist
of the characters a-z, A-Z and 0-9.</span></td>
</tr>
</tr>
<tr>
<td width="22%" valign="top" class="vncellreq">Address</td>
- <td width="78%" class="vtable"> <input name="address" type="text" class="formfld" id="address" size="20" value="<?=htmlspecialchars($pconfig['address']);?>">
+ <td width="78%" class="vtable"><?=$mandfldhtml;?><input name="address" type="text" class="formfld" id="address" size="20" value="<?=htmlspecialchars($pconfig['address']);?>">
/
<select name="address_subnet" class="formfld" id="address_subnet">
<?php for ($i = 32; $i >= 1; $i--): ?>
//-->
</script>
<?php include("fend.inc"); ?>
-</body>
-</html>
firewall_nat.php
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("Firewall", "NAT");
require("guiconfig.inc");
if (!is_array($config['nat']['rule'])) {
}
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("Firewall: NAT");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
-<p class="pgtitle">Firewall: NAT</font></p>
<form action="firewall_nat.php" method="post">
<?php if ($savemsg) print_info_box($savemsg); ?>
<?php if (file_exists($d_natconfdirty_path)): ?><p>
<input name="apply" type="submit" class="formbtn" id="apply" value="Apply changes"></p>
<?php endif; ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr><td>
+ <tr><td class="tabnavtbl">
<ul id="tabnav">
<li class="tabact">Inbound</li>
<li class="tabinact"><a href="firewall_nat_server.php">Server NAT</a></li>
<td class="list" colspan="6"></td>
<td class="list"> <a href="firewall_nat_edit.php"><img src="plus.gif" width="17" height="17" border="0"></a></td>
</tr>
- </table>
- <p><span class="vexpl"><span class="red"><strong>Note:<br>
+ </table><br>
+ <span class="vexpl"><span class="red"><strong>Note:<br>
</strong></span>It is not possible to access NATed services
using the WAN IP address from within LAN (or an optional
- network).</span></p></td>
+ network).</span></td>
</tr>
</table>
</form>
<?php include("fend.inc"); ?>
-</body>
-</html>
firewall_nat_1to1.php
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("Firewall", "NAT");
require("guiconfig.inc");
if (!is_array($config['nat']['onetoone'])) {
if (!file_exists($d_sysrebootreqd_path)) {
config_lock();
$retval |= filter_configure();
+ $retval |= services_proxyarp_configure();
config_unlock();
}
$savemsg = get_std_save_message($retval);
unlink($d_natconfdirty_path);
if (file_exists($d_filterconfdirty_path))
unlink($d_filterconfdirty_path);
+ if (file_exists($d_proxyarpdirty_path))
+ unlink($d_proxyarpdirty_path);
}
}
}
}
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("Firewall: NAT");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
-<p class="pgtitle">Firewall: NAT</p>
<form action="firewall_nat_1to1.php" method="post">
<?php if ($savemsg) print_info_box($savemsg); ?>
<?php if (file_exists($d_natconfdirty_path)): ?><p>
<?php print_info_box_np("The NAT configuration has been changed.<br>You must apply the changes in order for them to take effect.");?><br>
<input name="apply" type="submit" class="formbtn" id="apply" value="Apply changes"></p>
<?php endif; ?>
-<table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr><td>
+<table width="100%" border="0" cellpadding="0" cellspacing="0">
+<tr><td class="tabnavtbl">
<ul id="tabnav">
- <li class="tabinact"><a href="firewall_nat.php">Inbound</a></li>
+ <li class="tabinact1"><a href="firewall_nat.php">Inbound</a></li>
<li class="tabinact"><a href="firewall_nat_server.php">Server NAT</a></li>
<li class="tabact">1:1</li>
<li class="tabinact"><a href="firewall_nat_out.php">Outbound</a></li>
<td class="list" colspan="4"></td>
<td class="list"> <a href="firewall_nat_1to1_edit.php"><img src="plus.gif" width="17" height="17" border="0"></a></td>
</tr>
- </table>
- <p><span class="vexpl"><span class="red"><strong>Note:<br>
- </strong></span>Depending on the way your WAN connection is setup, you may also need <a href="services_proxyarp.php">proxy ARP</a>.</span></p>
+ </table><br>
+ <span class="vexpl"><span class="red"><strong>Note:<br>
+ </strong></span>Depending on the way your WAN connection is setup, you may also need <a href="services_proxyarp.php">proxy ARP</a>.</span>
</td>
</tr>
</table>
</form>
<?php include("fend.inc"); ?>
-</body>
-</html>
firewall_nat_1to1_edit.php
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("Firewall", "NAT", "Edit 1:1");
require("guiconfig.inc");
if (!is_array($config['nat']['onetoone'])) {
$input_errors[] = "A valid internal subnet must be specified.";
}
+ /* return the subnet address given a host address and a subnet bit count */
+ if ($extsubnetip = gen_subnet($_POST['external'], $_POST['subnet'])) {
+ $_POST['external'] = $extsubnetip;
+ } else {
+ $input_errors[] = "Can't convert external ip to valid subnet address.";
+ }
+
+ if ($intsubnetip = gen_subnet($_POST['internal'], $_POST['subnet'])) {
+ $_POST['internal'] = $intsubnetip;
+ } else {
+ $input_errors[] = "Can't convert internal ip to valid subnet address.";
+ }
+
if (is_ipaddr($config['interfaces']['wan']['ipaddr'])) {
if (check_subnets_overlap($_POST['external'], $_POST['subnet'],
$config['interfaces']['wan']['ipaddr'], 32))
$input_errors[] = "The WAN IP address may not be used in a 1:1 rule.";
}
+
/* check for overlaps with other 1:1 */
foreach ($a_1to1 as $natent) {
if (isset($id) && ($a_1to1[$id]) && ($a_1to1[$id] === $natent))
$a_1to1[] = $natent;
touch($d_natconfdirty_path);
+
+ if ($_POST['autoaddproxy']) {
+ /* auto-generate a matching proxy arp entry */
+ $arpent = array();
+ $arpent['interface'] = $_POST['interface'];
+ $arpent['network'] = $_POST['external'] . "/" . $_POST['subnet'];
+ $arpent['descr'] = "NAT " . $_POST['descr'];
+
+ $config['proxyarp']['proxyarpnet'][] = $arpent;
+
+ touch($d_proxyarpdirty_path);
+ }
write_config();
}
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("Firewall: NAT: Edit 1:1");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
-<p class="pgtitle">Firewall: NAT: Edit 1:1</p>
<?php if ($input_errors) print_input_errors($input_errors); ?>
<form action="firewall_nat_1to1_edit.php" method="post" name="iform" id="iform">
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td width="22%" valign="top" class="vncellreq">External subnet</td>
<td width="78%" class="vtable">
- <input name="external" type="text" class="formfld" id="external" size="20" value="<?=htmlspecialchars($pconfig['external']);?>">
+ <?=$mandfldhtml;?><input name="external" type="text" class="formfld" id="external" size="20" value="<?=htmlspecialchars($pconfig['external']);?>">
/
<select name="subnet" class="formfld" id="subnet">
<?php for ($i = 32; $i >= 0; $i--): ?>
<tr>
<td width="22%" valign="top" class="vncellreq">Internal subnet</td>
<td width="78%" class="vtable">
- <input name="internal" type="text" class="formfld" id="internal" size="20" value="<?=htmlspecialchars($pconfig['internal']);?>">
+ <?=$mandfldhtml;?><input name="internal" type="text" class="formfld" id="internal" size="20" value="<?=htmlspecialchars($pconfig['internal']);?>">
<br>
<span class="vexpl">Enter the internal (LAN) subnet for the 1:1 mapping. The subnet size specified for the external subnet also applies to the internal subnet (they have to be the same).</span></td>
</tr>
<input name="descr" type="text" class="formfld" id="descr" size="40" value="<?=htmlspecialchars($pconfig['descr']);?>">
<br> <span class="vexpl">You may enter a description here
for your reference (not parsed).</span></td>
- </tr>
+ </tr><?php if (!(isset($id) && $a_1to1[$id])): ?>
+ <tr>
+ <td width="22%" valign="top"> </td>
+ <td width="78%">
+ <input name="autoaddproxy" type="checkbox" id="autoaddproxy" value="yes" checked="checked">
+ <strong>Auto-add a <a href="services_proxyarp.php">proxy ARP</a> entry to this interface
+ </strong></td>
+ </tr><?php endif; ?>
<tr>
<td width="22%" valign="top"> </td>
<td width="78%">
</table>
</form>
<?php include("fend.inc"); ?>
-</body>
-</html>
firewall_nat_edit.php
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("Firewall", "NAT", "Edit");
require("guiconfig.inc");
if (!is_array($config['nat']['rule'])) {
continue;
if ($natent['external-address'] != $_POST['extaddr'])
continue;
+ if (($natent['proto'] != $_POST['proto']) && ($natent['proto'] != "tcp/udp") && ($_POST['proto'] != "tcp/udp"))
+ continue;
list($begp,$endp) = explode("-", $natent['external-port']);
if (!$endp)
}
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("Firewall: NAT: Edit");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
+<?php include("fbegin.inc"); ?>
<script language="JavaScript">
<!--
function ext_change() {
}
//-->
</script>
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-<p class="pgtitle">Firewall: NAT: Edit</p>
<?php if ($input_errors) print_input_errors($input_errors); ?>
<form action="firewall_nat_edit.php" method="post" name="iform" id="iform">
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td width="22%" valign="top" class="vncellreq">NAT IP</td>
<td width="78%" class="vtable">
- <input name="localip" type="text" class="formfldalias" id="localip" size="20" value="<?=htmlspecialchars($pconfig['localip']);?>">
+ <?=$mandfldhtml;?><input name="localip" type="text" class="formfldalias" id="localip" size="20" value="<?=htmlspecialchars($pconfig['localip']);?>">
<br> <span class="vexpl">Enter the internal IP address of
the server on which you want to map the ports.<br>
e.g. <em>192.168.1.12</em></span></td>
//-->
</script>
<?php include("fend.inc"); ?>
-</body>
-</html>
firewall_nat_out.php
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("Firewall", "NAT");
require("guiconfig.inc");
if (!is_array($config['nat']['advancedoutbound']['rule']))
}
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("Firewall: NAT");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
-<p class="pgtitle">Firewall: NAT</p>
<form action="firewall_nat_out.php" method="post">
<?php if ($savemsg) print_info_box($savemsg); ?>
<?php if (file_exists($d_natconfdirty_path)): ?><p>
<?php print_info_box_np("The NAT configuration has been changed.<br>You must apply the changes in order for them to take effect.");?><br>
<input name="apply" type="submit" class="formbtn" id="apply" value="Apply changes"></p>
<?php endif; ?>
-<table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr><td>
+<table width="100%" border="0" cellpadding="0" cellspacing="0">
+<tr><td class="tabnavtbl">
<ul id="tabnav">
- <li class="tabinact"><a href="firewall_nat.php">Inbound</a></li>
+ <li class="tabinact1"><a href="firewall_nat.php">Inbound</a></li>
<li class="tabinact"><a href="firewall_nat_server.php">Server NAT</a></li>
<li class="tabinact"><a href="firewall_nat_1to1.php">1:1</a></li>
<li class="tabact">Outbound</li>
<td class="tabcont">
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
- <td class="vtable"><p>
+ <td class="vtable">
<input name="enable" type="checkbox" id="enable" value="yes" <?php if (isset($config['nat']['advancedoutbound']['enable'])) echo "checked";?>>
- <strong>Enable advanced outbound NAT<br>
- </strong></p></td>
+ <strong>Enable advanced outbound NAT</strong></td>
</tr>
<tr>
<td> <input name="submit" type="submit" class="formbtn" value="Save">
</td>
</tr>
</table>
- <br>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="10%" class="listhdrr">Interface</td>
</table>
</form>
<?php include("fend.inc"); ?>
-</body>
-</html>
firewall_nat_out_edit.php
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("Firewall", "NAT", "Edit outbound mapping");
require("guiconfig.inc");
if (!is_array($config['nat']['advancedoutbound']['rule']))
}
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("Firewall: NAT: Edit outbound mapping");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
+<?php include("fbegin.inc"); ?>
<script language="JavaScript">
<!--
function typesel_change() {
}
//-->
</script>
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-<p class="pgtitle">Firewall: NAT: Edit outbound mapping</p>
<?php if ($input_errors) print_input_errors($input_errors); ?>
<form action="firewall_nat_out_edit.php" method="post" name="iform" id="iform">
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td width="22%" valign="top" class="vncellreq">Source</td>
<td width="78%" class="vtable">
-<input name="source" type="text" class="formfld" id="source" size="20" value="<?=htmlspecialchars($pconfig['source']);?>">
+ <?=$mandfldhtml;?><input name="source" type="text" class="formfld" id="source" size="20" value="<?=htmlspecialchars($pconfig['source']);?>">
/
<select name="source_subnet" class="formfld" id="source_subnet">
<tr>
<td width="22%" valign="top" class="vncellreq">Destination</td>
<td width="78%" class="vtable">
-<input name="destination_not" type="checkbox" id="destination_not" value="yes" <?php if ($pconfig['destination_not']) echo "checked"; ?>>
+ <input name="destination_not" type="checkbox" id="destination_not" value="yes" <?php if ($pconfig['destination_not']) echo "checked"; ?>>
<strong>not</strong><br>
Use this option to invert the sense of the match.<br>
<br>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>Type: </td>
+ <td></td>
<td><select name="destination_type" class="formfld" onChange="typesel_change()">
<option value="any" <?php if ($pconfig['destination'] == "any") echo "selected"; ?>>
any</option>
</tr>
<tr>
<td>Address: </td>
+ <td><?=$mandfldhtmlspc;?></td>
<td><input name="destination" type="text" class="formfld" id="destination" size="20" value="<?=htmlspecialchars($pconfig['destination']);?>">
/
<select name="destination_subnet" class="formfld" id="destination_subnet">
</tr>
<tr>
<td> </td>
+ <td></td>
<td><span class="vexpl">Enter the destination network for
the outbound NAT mapping.</span></td>
</tr>
//-->
</script>
<?php include("fend.inc"); ?>
-</body>
-</html>
firewall_nat_server.php
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("Firewall", "NAT");
require("guiconfig.inc");
if (!is_array($config['nat']['servernat'])) {
}
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("Firewall: NAT");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
-<p class="pgtitle">Firewall: NAT</p>
<form action="firewall_nat_server.php" method="post">
<?php if ($input_errors) print_input_errors($input_errors); ?>
<?php if ($savemsg) print_info_box($savemsg); ?>
<?php print_info_box_np("The NAT configuration has been changed.<br>You must apply the changes in order for them to take effect.");?><br>
<input name="apply" type="submit" class="formbtn" id="apply" value="Apply changes"></p>
<?php endif; ?>
-<table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr><td>
+<table width="100%" border="0" cellpadding="0" cellspacing="0">
+<tr><td class="tabnavtbl">
<ul id="tabnav">
- <li class="tabinact"><a href="firewall_nat.php">Inbound</a></li>
+ <li class="tabinact1"><a href="firewall_nat.php">Inbound</a></li>
<li class="tabact">Server NAT</li>
<li class="tabinact"><a href="firewall_nat_1to1.php">1:1</a></li>
<li class="tabinact"><a href="firewall_nat_out.php">Outbound</a></li>
<td class="list" colspan="2"></td>
<td class="list"> <a href="firewall_nat_server_edit.php"><img src="plus.gif" width="17" height="17" border="0"></a></td>
</tr>
- </table>
- <p><span class="vexpl"><span class="red"><strong>Note:<br>
- </strong></span>The external IP addresses defined on this page may be used in <a href="firewall_nat.php">inbound NAT</a> mappings. Depending on the way your WAN connection is setup, you may also need <a href="services_proxyarp.php">proxy ARP</a>.</span></p>
+ </table><br>
+ <span class="vexpl"><span class="red"><strong>Note:<br>
+ </strong></span>The external IP addresses defined on this page may be used in <a href="firewall_nat.php">inbound NAT</a> mappings. Depending on the way your WAN connection is setup, you may also need <a href="services_proxyarp.php">proxy ARP</a>.</span>
</td>
</tr>
</table>
</form>
<?php include("fend.inc"); ?>
-</body>
-</html>
firewall_nat_server_edit.php
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("Firewall", "NAT", "Edit Server NAT");
require("guiconfig.inc");
if (!is_array($config['nat']['servernat'])) {
}
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("Firewall: NAT: Edit Server NAT");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
-<p class="pgtitle">Firewall: NAT: Edit Server NAT</p>
<?php if ($input_errors) print_input_errors($input_errors); ?>
<form action="firewall_nat_server_edit.php" method="post" name="iform" id="iform">
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td width="22%" valign="top" class="vncellreq">External IP address</td>
<td width="78%" class="vtable">
- <input name="ipaddr" type="text" class="formfld" id="ipaddr" size="20" value="<?=htmlspecialchars($pconfig['ipaddr']);?>">
-
+ <?=$mandfldhtml;?><input name="ipaddr" type="text" class="formfld" id="ipaddr" size="20" value="<?=htmlspecialchars($pconfig['ipaddr']);?>">
</td>
</tr>
<tr>
</table>
</form>
<?php include("fend.inc"); ?>
-</body>
-</html>
firewall_rules.php
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("Firewall", "Rules");
require("guiconfig.inc");
if (!is_array($config['filter']['rule'])) {
}
if (!$if || !isset($iflist[$if]))
- $if = "lan";
+ $if = "wan";
if ($_POST) {
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("Firewall: Rules");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
-<p class="pgtitle">Firewall: Rules</p>
+<script language="JavaScript">
+<!--
+function fr_toggle(id) {
+ var checkbox = document.getElementById('frc' + id);
+ checkbox.checked = !checkbox.checked;
+ fr_bgcolor(id);
+}
+function fr_bgcolor(id) {
+ var row = document.getElementById('fr' + id);
+ var checkbox = document.getElementById('frc' + id);
+ var cells = row.getElementsByTagName("td");
+
+ for (i = 2; i <= 6; i++) {
+ cells[i].style.backgroundColor = checkbox.checked ? "#FFFFBB" : "#FFFFFF";
+ }
+ cells[7].style.backgroundColor = checkbox.checked ? "#FFFFBB" : "#D9DEE8";
+}
+function fr_insline(id, on) {
+ var row = document.getElementById('fr' + id);
+ if (id != 0) {
+ var prevrow = document.getElementById('fr' + (id-1));
+ } else {
+ var prevrow = document.getElementById('frheader');
+ }
+
+ var cells = row.getElementsByTagName("td");
+ var prevcells = prevrow.getElementsByTagName("td");
+
+ for (i = 2; i <= 7; i++) {
+ if (on) {
+ prevcells[i].style.borderBottom = "3px solid #999999";
+ prevcells[i].style.paddingBottom = (id != 0) ? 2 : 3;
+ } else {
+ prevcells[i].style.borderBottomWidth = "1px";
+ prevcells[i].style.paddingBottom = (id != 0) ? 4 : 5;
+ }
+ }
+
+ for (i = 2; i <= 7; i++) {
+ if (on) {
+ cells[i].style.borderTop = "2px solid #999999";
+ cells[i].style.paddingTop = 2;
+ } else {
+ cells[i].style.borderTopWidth = 0;
+ cells[i].style.paddingTop = 4;
+ }
+ }
+}
+// -->
+</script>
<form action="firewall_rules.php" method="post">
<?php if ($savemsg) print_info_box($savemsg); ?>
<?php if (file_exists($d_filterconfdirty_path)): ?><p>
<input name="apply" type="submit" class="formbtn" id="apply" value="Apply changes"></p>
<?php endif; ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr><td>
+ <tr><td class="tabnavtbl">
<ul id="tabnav">
-<?php foreach ($iflist as $ifent => $ifname):
+<?php $i = 0; foreach ($iflist as $ifent => $ifname):
if ($ifent == $if): ?>
<li class="tabact"><?=htmlspecialchars($ifname);?></li>
<?php else: ?>
- <li class="tabinact"><a href="firewall_rules.php?if=<?=$ifent;?>"><?=htmlspecialchars($ifname);?></a></li>
+ <li class="<?php if ($i == 0) echo "tabinact1"; else echo "tabinact";?>"><a href="firewall_rules.php?if=<?=$ifent;?>"><?=htmlspecialchars($ifname);?></a></li>
<?php endif; ?>
-<?php endforeach; ?>
+<?php $i++; endforeach; ?>
</ul>
</td></tr>
<tr>
<td class="tabcont">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
+ <tr id="frheader">
+ <td width="3%" class="list"> </td>
<td width="5%" class="list"> </td>
<td width="10%" class="listhdrr">Proto</td>
<td width="15%" class="listhdrr">Source</td>
<td width="10%" class="listhdrr">Port</td>
<td width="15%" class="listhdrr">Destination</td>
<td width="10%" class="listhdrr">Port</td>
- <td width="25%" class="listhdr">Description</td>
+ <td width="22%" class="listhdr">Description</td>
<td width="10%" class="list"></td>
</tr>
<?php $nrules = 0; for ($i = 0; isset($a_filter[$i]); $i++):
if ($filterent['interface'] != $if)
continue;
?>
- <tr valign="top">
- <td class="listt">
+ <tr valign="top" id="fr<?=$nrules;?>">
+ <td class="listt"><input type="checkbox" id="frc<?=$nrules;?>" name="rule[]" value="<?=$i;?>" onClick="fr_bgcolor('<?=$nrules;?>')" style="margin: 0; padding: 0; width: 15px; height: 15px;"></td>
+ <td class="listt" align="center">
<?php if ($filterent['type'] == "block")
$iconfn = "block";
else if ($filterent['type'] == "reject") {
<br><img src="<?=$iconfn;?>.gif" width="11" height="15" border="0">
<?php endif; ?>
</td>
- <td class="listlr">
+ <td class="listlr" onClick="fr_toggle(<?=$nrules;?>)">
<?=$textss;?><?php if (isset($filterent['protocol'])) echo strtoupper($filterent['protocol']); else echo "*"; ?><?=$textse;?>
</td>
- <td class="listr">
+ <td class="listr" onClick="fr_toggle(<?=$nrules;?>)">
<?=$textss;?><?php echo htmlspecialchars(pprint_address($filterent['source'])); ?><?=$textse;?>
</td>
- <td class="listr">
+ <td class="listr" onClick="fr_toggle(<?=$nrules;?>)">
<?=$textss;?><?php echo htmlspecialchars(pprint_port($filterent['source']['port'])); ?><?=$textse;?>
</td>
- <td class="listr">
+ <td class="listr" onClick="fr_toggle(<?=$nrules;?>)">
<?=$textss;?><?php echo htmlspecialchars(pprint_address($filterent['destination'])); ?><?=$textse;?>
</td>
- <td class="listr">
+ <td class="listr" onClick="fr_toggle(<?=$nrules;?>)">
<?=$textss;?><?php echo htmlspecialchars(pprint_port($filterent['destination']['port'])); ?><?=$textse;?>
</td>
- <td class="listbg">
+ <td class="listbg" onClick="fr_toggle(<?=$nrules;?>)">
<?=$textss;?><?=htmlspecialchars($filterent['descr']);?> <?=$textse;?>
</td>
<td valign="middle" nowrap class="list">
<table border="0" cellspacing="0" cellpadding="1">
<tr>
+ <td><input name="move_<?=$i;?>" type="image" src="left.gif" width="17" height="17" title="move selected rules before this rule" onMouseOver="fr_insline(<?=$nrules;?>, true)" onMouseOut="fr_insline(<?=$nrules;?>, false)"></td>
<td><a href="firewall_rules_edit.php?id=<?=$i;?>"><img src="e.gif" title="edit rule" width="17" height="17" border="0"></a></td>
- <td align="center" valign="middle"><input type="checkbox" name="rule[]" value="<?=$i;?>" style="margin: 0; padding: 0; width: 15px; height: 15px;"></td>
</tr>
<tr>
- <td><input name="move_<?=$i;?>" type="image" src="left.gif" width="17" height="17" title="move selected rules before this rule"></td>
+ <td align="center" valign="middle"></td>
<td><a href="firewall_rules_edit.php?dup=<?=$i;?>"><img src="plus.gif" title="add a new rule based on this one" width="17" height="17" border="0"></a></td>
</tr>
</table>
</tr>
<?php $nrules++; endfor; ?>
<?php if ($nrules == 0): ?>
+ <td class="listt"></td>
<td class="listt"></td>
<td class="listlr" colspan="6" align="center" valign="middle">
<span class="gray">
Click the <a href="firewall_rules_edit.php?if=<?=$if;?>"><img src="plus.gif" title="add new rule" border="0" width="17" height="17" align="absmiddle"></a> button to add a new rule.</span>
</td>
<?php endif; ?>
- <tr>
- <td class="list" colspan="7"></td>
+ <tr id="fr<?=$nrules;?>">
+ <td class="list"></td>
+ <td class="list"></td>
+ <td class="list"> </td>
+ <td class="list"> </td>
+ <td class="list"> </td>
+ <td class="list"> </td>
+ <td class="list"> </td>
+ <td class="list"> </td>
<td class="list">
<table border="0" cellspacing="0" cellpadding="1">
<tr>
<td>
- <?php if ($nrules == 0): ?><img src="left_d.gif" width="17" height="17" title="move selected rules to end" border="0"><?php else: ?><input name="move_<?=$i;?>" type="image" src="left.gif" width="17" height="17" title="move selected rules to end"><?php endif; ?></td>
- <td><a href="firewall_rules_edit.php?if=<?=$if;?>"><img src="plus.gif" title="add new rule" width="17" height="17" border="0"></a></td>
+ <?php if ($nrules == 0): ?><img src="left_d.gif" width="17" height="17" title="move selected rules to end" border="0"><?php else: ?><input name="move_<?=$i;?>" type="image" src="left.gif" width="17" height="17" title="move selected rules to end" onMouseOver="fr_insline(<?=$nrules;?>, true)" onMouseOut="fr_insline(<?=$nrules;?>, false)"><?php endif; ?></td>
+ <td></td>
</tr>
<tr>
<td><?php if ($nrules == 0): ?><img src="x_d.gif" width="17" height="17" title="delete selected rules" border="0"><?php else: ?><input name="del" type="image" src="x.gif" width="17" height="17" title="delete selected rules" onclick="return confirm('Do you really want to delete the selected rules?')"><?php endif; ?></td>
- <td></td>
+ <td><a href="firewall_rules_edit.php?if=<?=$if;?>"><img src="plus.gif" title="add new rule" width="17" height="17" border="0"></a></td>
</tr>
</table>
</td>
</table>
</td>
</tr>
-</table>
- <p>
+</table><br>
<strong><span class="red">Hint:<br>
- </span></strong>rules are evaluated on a first-match basis (i.e.
+ </span></strong>Rules are evaluated on a first-match basis (i.e.
the action of the first rule to match a packet will be executed).
This means that if you use block rules, you'll have to pay attention
to the rule order. Everything that isn't explicitly passed is blocked
- by default.</p>
-<input type="hidden" name="if" value="<?=$if;?>">
+ by default.
+ <input type="hidden" name="if" value="<?=$if;?>">
</form>
<?php include("fend.inc"); ?>
-</body>
-</html>
firewall_rules_edit.php
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("Firewall", "Rules", "Edit");
require("guiconfig.inc");
-$specialsrcdst = explode(" ", "any lan pptp");
+$specialsrcdst = explode(" ", "any wanip lan pptp");
if (!is_array($config['filter']['rule'])) {
$config['filter']['rule'] = array();
$_POST['dstendport'] = 0;
}
+ if (($_POST['type'] == "reject") && ($_POST['proto'] != "tcp") && ($_POST['proto'] != "udp")) {
+ $input_errors[] = "Reject only works when the protocol is set to either TCP or UDP.";
+ }
+
if (($_POST['srcbeginport'] && !is_port($_POST['srcbeginport']))) {
$input_errors[] = "The start source port must be an integer between 1 and 65535.";
}
}
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("Firewall: Rules: Edit");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
+<?php include("fbegin.inc"); ?>
<script language="JavaScript">
<!--
var portsenabled = 1;
}
//-->
</script>
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-<p class="pgtitle">Firewall: Rules: Edit</p>
<?php if ($input_errors) print_input_errors($input_errors); ?>
<form action="firewall_rules_edit.php" method="post" name="iform" id="iform">
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td width="22%" valign="top" class="vncellreq">Action</td>
<td width="78%" class="vtable">
-<select name="type" class="formfld">
+ <select name="type" class="formfld">
<?php $types = explode(" ", "Pass Block Reject"); foreach ($types as $type): ?>
<option value="<?=strtolower($type);?>" <?php if (strtolower($type) == strtolower($pconfig['type'])) echo "selected"; ?>>
<?=htmlspecialchars($type);?>
<tr>
<td width="22%" valign="top" class="vncellreq">Interface</td>
<td width="78%" class="vtable">
-<select name="interface" class="formfld">
+ <select name="interface" class="formfld">
<?php $interfaces = array('wan' => 'WAN', 'lan' => 'LAN', 'pptp' => 'PPTP');
for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++) {
$interfaces['opt' . $i] = $config['interfaces']['opt' . $i]['descr'];
<tr>
<td width="22%" valign="top" class="vncellreq">Protocol</td>
<td width="78%" class="vtable">
-<select name="proto" class="formfld" onchange="proto_change()">
+ <select name="proto" class="formfld" onchange="proto_change()">
<?php $protocols = explode(" ", "TCP UDP TCP/UDP ICMP ESP AH GRE IPv6 IGMP any"); foreach ($protocols as $proto): ?>
<option value="<?=strtolower($proto);?>" <?php if (strtolower($proto) == $pconfig['proto']) echo "selected"; ?>>
<?=htmlspecialchars($proto);?>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>Type: </td>
+ <td></td>
<td><select name="srctype" class="formfld" onChange="typesel_change()">
<?php $sel = is_specialnet($pconfig['src']); ?>
<option value="any" <?php if ($pconfig['src'] == "any") { echo "selected"; } ?>>
Single host or alias</option>
<option value="network" <?php if (!$sel) echo "selected"; ?>>
Network</option>
+ <option value="wanip" <?php if ($pconfig['src'] == "wanip") { echo "selected"; } ?>>
+ WAN address</option>
<option value="lan" <?php if ($pconfig['src'] == "lan") { echo "selected"; } ?>>
LAN subnet</option>
<option value="pptp" <?php if ($pconfig['src'] == "pptp") { echo "selected"; } ?>>
</tr>
<tr>
<td>Address: </td>
+ <td><?=$mandfldhtmlspc;?></td>
<td><input name="src" type="text" class="formfldalias" id="src" size="20" value="<?php if (!is_specialnet($pconfig['src'])) echo htmlspecialchars($pconfig['src']);?>">
/
<select name="srcmask" class="formfld" id="srcmask">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>Type: </td>
+ <td></td>
<td><select name="dsttype" class="formfld" onChange="typesel_change()">
<?php $sel = is_specialnet($pconfig['dst']); ?>
<option value="any" <?php if ($pconfig['dst'] == "any") { echo "selected"; } ?>>
Single host or alias</option>
<option value="network" <?php if (!$sel) echo "selected"; ?>>
Network</option>
+ <option value="wanip" <?php if ($pconfig['dst'] == "wanip") { echo "selected"; } ?>>
+ WAN address</option>
<option value="lan" <?php if ($pconfig['dst'] == "lan") { echo "selected"; } ?>>
LAN subnet</option>
<option value="pptp" <?php if ($pconfig['dst'] == "pptp") { echo "selected"; } ?>>
</tr>
<tr>
<td>Address: </td>
+ <td><?=$mandfldhtmlspc;?></td>
<td><input name="dst" type="text" class="formfldalias" id="dst" size="20" value="<?php if (!is_specialnet($pconfig['dst'])) echo htmlspecialchars($pconfig['dst']);?>">
/
<select name="dstmask" class="formfld" id="dstmask">
//-->
</script>
<?php include("fend.inc"); ?>
-</body>
-</html>
firewall_shaper.php
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("Firewall", "Traffic shaper");
require("guiconfig.inc");
if (!is_array($config['shaper']['rule'])) {
}
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("Firewall: Traffic shaper");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
-<p class="pgtitle">Firewall: Traffic shaper</p>
<form action="firewall_shaper.php" method="post">
<?php if ($savemsg) print_info_box($savemsg); ?>
<?php if (file_exists($d_shaperconfdirty_path)): ?><p>
<input name="apply" type="submit" class="formbtn" id="apply" value="Apply changes"></p>
<?php endif; ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr><td>
+ <tr><td class="tabnavtbl">
<ul id="tabnav">
<li class="tabact">Rules</li>
<li class="tabinact"><a href="firewall_shaper_pipes.php">Pipes</a></li>
<td class="tabcont">
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
- <td class="vtable"><p>
+ <td class="vtable">
<input name="enable" type="checkbox" id="enable" value="yes" <?php if ($pconfig['enable']) echo "checked";?>>
- <strong>Enable traffic shaper<br>
- </strong></p></td>
+ <strong>Enable traffic shaper</strong></td>
</tr>
<tr>
<td> <input name="submit" type="submit" class="formbtn" value="Save">
<td><img src="out_d.gif" width="11" height="11"></td>
<td>outgoing (disabled)</td>
</tr>
- </table>
- <p><span class="red"><strong>Note:</strong></span><strong><br>
+ </table><br>
+ <span class="red"><strong>Note:</strong></span><strong><br>
</strong>the first rule that matches a packet will be executed.<br>
The following match patterns are not shown in the list above:
IP packet length, TCP flags.</td>
</table>
</form>
<?php include("fend.inc"); ?>
-</body>
-</html>
firewall_shaper_edit.php
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("Firewall", "Traffic shaper", "Edit rule");
require("guiconfig.inc");
if (!is_array($config['shaper']['rule'])) {
}
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("Firewall: Traffic shaper: Edit rule");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
+<?php include("fbegin.inc"); ?>
<script language="JavaScript">
<!--
var portsenabled = 1;
}
//-->
</script>
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-<p class="pgtitle">Firewall: Traffic shaper: Edit rule</p>
<?php if ($input_errors) print_input_errors($input_errors); ?>
<?php if (is_array($config['shaper']['pipe']) && (count($config['shaper']['pipe']) > 0)): ?>
<form action="firewall_shaper_edit.php" method="post" name="iform" id="iform">
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td valign="top" class="vncellreq">Target</td>
- <td class="vtable"> <select name="target" class="formfld">
+ <td class="vtable"><select name="target" class="formfld">
<?php
foreach ($config['shaper']['pipe'] as $pipei => $pipe): ?>
<option value="<?="targetpipe:$pipei";?>" <?php if ("targetpipe:$pipei" == $pconfig['target']) echo "selected"; ?>>
</tr>
<tr>
<td width="22%" valign="top" class="vncellreq">Interface</td>
- <td width="78%" class="vtable"> <select name="interface" class="formfld">
+ <td width="78%" class="vtable"><select name="interface" class="formfld">
<?php $interfaces = array('lan' => 'LAN', 'wan' => 'WAN', 'pptp' => 'PPTP');
for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++) {
$interfaces['opt' . $i] = $config['interfaces']['opt' . $i]['descr'];
</tr>
<tr>
<td width="22%" valign="top" class="vncellreq">Protocol</td>
- <td width="78%" class="vtable"> <select name="proto" class="formfld" onchange="proto_change()">
+ <td width="78%" class="vtable"><select name="proto" class="formfld" onchange="proto_change()">
<?php $protocols = explode(" ", "TCP UDP ICMP ESP AH GRE IPv6 IGMP any"); foreach ($protocols as $proto): ?>
<option value="<?=strtolower($proto);?>" <?php if (strtolower($proto) == $pconfig['proto']) echo "selected"; ?>>
<?=htmlspecialchars($proto);?>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>Type: </td>
+ <td></td>
<td><select name="srctype" class="formfld" onChange="typesel_change()">
<?php $sel = is_specialnet($pconfig['src']); ?>
<option value="any" <?php if ($pconfig['src'] == "any") { echo "selected"; } ?>>
</tr>
<tr>
<td>Address: </td>
+ <td><?=$mandfldhtmlspc;?></td>
<td><input name="src" type="text" class="formfldalias" id="src" size="20" value="<?php if (!is_specialnet($pconfig['src'])) echo htmlspecialchars($pconfig['src']);?>">
/
<select name="srcmask" class="formfld" id="srcmask">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>Type: </td>
+ <td></td>
<td><select name="dsttype" class="formfld" onChange="typesel_change()">
<?php $sel = is_specialnet($pconfig['dst']); ?>
<option value="any" <?php if ($pconfig['dst'] == "any") { echo "selected"; } ?>>
</tr>
<tr>
<td>Address: </td>
+ <td><?=$mandfldhtmlspc;?></td>
<td><input name="dst" type="text" class="formfldalias" id="dst" size="20" value="<?php if (!is_specialnet($pconfig['dst'])) echo htmlspecialchars($pconfig['dst']);?>">
/
<select name="dstmask" class="formfld" id="dstmask">
<p><strong>You need to create a pipe or queue before you can add a new rule.</strong></p>
<?php endif; ?>
<?php include("fend.inc"); ?>
-</body>
-</html>
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("Firewall", "Traffic shaper");
+require("guiconfig.inc");
+
function wipe_magic () {
global $config;
$rulei++;
}
-require("guiconfig.inc");
-
if (!is_array($config['shaper']['rule'])) {
$config['shaper']['rule'] = array();
}
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("Firewall: Traffic shaper");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
-<p class="pgtitle">Firewall: Traffic shaper</p>
<form action="firewall_shaper_magic.php" method="post">
<?php if ($savemsg) print_info_box($savemsg); ?>
<?php if (file_exists($d_shaperconfdirty_path)): ?><p>
<input name="apply" type="submit" class="formbtn" id="apply" value="Apply changes"></p>
<?php endif; ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr><td>
+ <tr><td class="tabnavtbl">
<ul id="tabnav">
- <li class="tabinact"><a href="firewall_shaper.php">Rules</a></li>
+ <li class="tabinact1"><a href="firewall_shaper.php">Rules</a></li>
<li class="tabinact"><a href="firewall_shaper_pipes.php">Pipes</a></li>
<li class="tabinact"><a href="firewall_shaper_queues.php">Queues</a></li>
<li class="tabact">Magic shaper wizard</li>
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td width="22%" valign="top" class="vtable"> </td>
- <td width="78%" class="vtable"><p>
+ <td width="78%" class="vtable">
<input name="p2plow" type="checkbox" id="p2plow" value="yes" <?php if ($pconfig['p2plow']) echo "checked";?>>
- Set P2P traffic to lowest priority<br>
- </p></td>
+ Set P2P traffic to lowest priority</td>
</tr>
<tr>
<td width="22%" valign="top" class="vtable"> </td>
- <td width="78%" class="vtable"><p>
+ <td width="78%" class="vtable">
<input name="maskq" type="checkbox" id="maskq" value="yes" <?php if ($pconfig['maskq']) echo "checked";?>>
- Share bandwidth evenly on LAN<br>
- </p></td>
+ Share bandwidth evenly on LAN</td>
</tr>
<tr valign="top">
<td width="22%" class="vncellreq">Downstream<br>
speed </td>
<td width="78%" class="vtable">
- <input name="maxdown" type="text" size="10" value="<?php if ($pconfig['maxdown']) echo $pconfig['maxdown']; ?>">
+ <?=$mandfldhtml;?><input name="maxdown" type="text" size="10" value="<?php if ($pconfig['maxdown']) echo $pconfig['maxdown']; ?>">
kbps<br>
Enter the speed of your WAN downstream link here.</td>
</tr>
<tr valign="top">
<td width="22%" class="vncellreq">Upstream<br>
speed</td>
- <td width="78%" class="vtable"><input name="maxup" type="text" size="10" value="<?php if ($pconfig['maxup']) echo $pconfig['maxup']; ?>">
+ <td width="78%" class="vtable"><?=$mandfldhtml;?><input name="maxup" type="text" size="10" value="<?php if ($pconfig['maxup']) echo $pconfig['maxup']; ?>">
kbps<br>
Enter the speed of your WAN upstream link here.</td>
</tr>
<tr>
<td width="22%"> </td>
- <td width="78%"><p>
+ <td width="78%">
<input name="install" type="submit" class="formbtn" id="install" value="Install/Update">
<input name="remove" type="submit" class="formbtn" id="remove" value="Remove">
- </p>
- <p><span class="red"><strong>All existing traffic shaper <strong>rules</strong>/pipes/queues will be deleted once "Install/Update" has been pressed! Backup your configuration before proceeding! </strong></span></p></td>
+ <br><br>
+ <span class="red"><strong>All existing traffic shaper <strong>rules</strong>/pipes/queues will be deleted once "Install/Update" has been pressed! Backup your configuration before proceeding! </strong></span></td>
</tr>
- </table>
- <p><span class="vexpl"><span class="red"><strong>Note:</strong></span><strong><br>
- </strong>By entering your maximum upload and download values and pressing the "Install/Update" button, the magic shaper will do its best to create the optimum shaping rules, queues, and pipes for you. These rules will help ensure that interactive traffic remains acceptable while the upstream bandwidth is being consumed by heavy traffic.</span></p>
+ </table><br>
+ <span class="vexpl"><span class="red"><strong>Note:</strong></span><strong><br>
+ </strong>By entering your maximum upload and download values and pressing the "Install/Update" button, the magic shaper will do its best to create the optimum shaping rules, queues, and pipes for you. These rules will help ensure that interactive traffic remains acceptable while the upstream bandwidth is being consumed by heavy traffic.</span>
</td>
</tr>
</table>
</form>
<?php include("fend.inc"); ?>
-</body>
-</html>
firewall_shaper_pipes.php
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("Firewall", "Traffic shaper");
require("guiconfig.inc");
if (!is_array($config['shaper']['pipe'])) {
}
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("Firewall: Traffic shaper");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
-<p class="pgtitle">Firewall: Traffic shaper</p>
<form action="firewall_shaper.php" method="post">
<?php if ($input_errors) print_input_errors($input_errors); ?>
<?php if ($savemsg) print_info_box($savemsg); ?>
<input name="apply" type="submit" class="formbtn" id="apply" value="Apply changes"></p>
<?php endif; ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr><td>
+ <tr><td class="tabnavtbl">
<ul id="tabnav">
- <li class="tabinact"><a href="firewall_shaper.php">Rules</a></li>
+ <li class="tabinact1"><a href="firewall_shaper.php">Rules</a></li>
<li class="tabact">Pipes</li>
<li class="tabinact"><a href="firewall_shaper_queues.php">Queues</a></li>
<li class="tabinact"><a href="firewall_shaper_magic.php">Magic shaper wizard</a></li>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="10%" class="listhdrr">No.</td>
- <td width="20%" class="listhdrr">Bandwidth</td>
- <td width="15%" class="listhdrr">Delay</td>
+ <td width="15%" class="listhdrr">Bandwidth</td>
+ <td width="10%" class="listhdrr">Delay</td>
+ <td width="10%" class="listhdrr">PLR</td>
+ <td width="10%" class="listhdrr">Queue</td>
<td width="15%" class="listhdrr">Mask</td>
- <td width="30%" class="listhdr">Description</td>
+ <td width="20%" class="listhdr">Description</td>
<td width="10%" class="list"></td>
</tr>
<?php $i = 0; foreach ($a_pipes as $pipe): ?>
ms
<?php endif; ?>
</td>
+ <td class="listr">
+ <?php if ($pipe['plr']): ?>
+ <?=$pipe['plr'];?>
+ <?php endif; ?>
+ </td>
+ <td class="listr">
+ <?php if ($pipe['qsize']): ?>
+ <?=htmlspecialchars($pipe['qsize']);?>
+ <?php endif; ?>
+ </td>
<td class="listr">
<?php if ($pipe['mask']): ?>
<?=$pipe['mask'];?>
</tr>
<?php $i++; endforeach; ?>
<tr>
- <td class="list" colspan="5"></td>
+ <td class="list" colspan="7"></td>
<td class="list"> <a href="firewall_shaper_pipes_edit.php"><img src="plus.gif" width="17" height="17" border="0"></a></td>
</tr>
- </table>
- <p>
+ </table><br>
<strong><span class="red">Note:</span></strong> a pipe can
- only be deleted if it is not referenced by any rules or queues.</td></p>
+ only be deleted if it is not referenced by any rules or queues.</td>
</tr>
</table>
</form>
<?php include("fend.inc"); ?>
-</body>
-</html>
firewall_shaper_pipes_edit.php
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("Firewall", "Traffic shaper", "Edit pipe");
require("guiconfig.inc");
$a_pipes = &$config['shaper']['pipe'];
if (isset($id) && $a_pipes[$id]) {
$pconfig['bandwidth'] = $a_pipes[$id]['bandwidth'];
$pconfig['delay'] = $a_pipes[$id]['delay'];
+ $pconfig['plr'] = $a_pipes[$id]['plr'];
+ $pconfig['qsize'] = $a_pipes[$id]['qsize'];
$pconfig['mask'] = $a_pipes[$id]['mask'];
$pconfig['descr'] = $a_pipes[$id]['descr'];
}
if (($_POST['delay'] && !is_numericint($_POST['delay']))) {
$input_errors[] = "The delay must be an integer.";
}
+ if ($_POST['plr'] && (!is_numeric($_POST['plr']) || $_POST['plr'] < 0 || $_POST['plr'] > 1)) {
+ $input_errors[] = "The packet loss rate must be a number between 0 and 1.";
+ }
+ if ($_POST['qsize'] && (!is_numericint($_POST['qsize']) || $_POST['qsize'] < 2 || $_POST['qsize'] > 100)) {
+ $input_errors[] = "The queue size must be an integer between 2 and 100.";
+ }
if (!$input_errors) {
$pipe = array();
$pipe['bandwidth'] = $_POST['bandwidth'];
if ($_POST['delay'])
$pipe['delay'] = $_POST['delay'];
+ if ($_POST['plr'])
+ $pipe['plr'] = $_POST['plr'];
+ if ($_POST['qsize'])
+ $pipe['qsize'] = $_POST['qsize'];
if ($_POST['mask'])
$pipe['mask'] = $_POST['mask'];
$pipe['descr'] = $_POST['descr'];
}
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("Firewall: Traffic shaper: Edit pipe");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
-<p class="pgtitle">Firewall: Traffic shaper: Edit pipe</p>
<?php if ($input_errors) print_input_errors($input_errors); ?>
<form action="firewall_shaper_pipes_edit.php" method="post" name="iform" id="iform">
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td width="22%" valign="top" class="vncellreq">Bandwidth</td>
- <td width="78%" class="vtable"> <input name="bandwidth" type="text" id="bandwidth" size="5" value="<?=htmlspecialchars($pconfig['bandwidth']);?>">
+ <td width="78%" class="vtable"><?=$mandfldhtml;?><input name="bandwidth" type="text" id="bandwidth" size="5" value="<?=htmlspecialchars($pconfig['bandwidth']);?>">
Kbit/s</td>
</tr>
<tr>
ms<br> <span class="vexpl">Hint: in most cases, you
should specify 0 here (or leave the field empty)</span></td>
</tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell">Packet loss rate</td>
+ <td width="78%" class="vtable"> <input name="plr" type="text" id="plr" size="5" value="<?=htmlspecialchars($pconfig['plr']);?>">
+ <br> <span class="vexpl">Hint: in most cases, you
+ should specify 0 here (or leave the field empty). A value of 0.001 means one packet in 1000 gets dropped.</span></td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell">Queue size</td>
+ <td width="78%" class="vtable"> <input name="qsize" type="text" id="qsize" size="8" value="<?=htmlspecialchars($pconfig['qsize']);?>">
+ slots<br>
+ <span class="vexpl">Hint: in most cases, you
+ should leave the field empty. All packets in this pipe are placed into a fixed-size queue first,
+ then they are delayed by value specified in the Delay field, and then they are delivered to their destination.</span></td>
+ </tr>
<tr>
<td width="22%" valign="top" class="vncell">Mask</td>
<td width="78%" class="vtable"> <select name="mask" class="formfld">
<option value="destination" <?php if ($pconfig['mask'] == "destination") echo "selected"; ?>>destination</option>
</select> <br>
<span class="vexpl">If 'source' or 'destination' is chosen,
- a dynamic pipe with the bandwidth and delay given above will
+ a dynamic pipe with the bandwidth, delay, packet loss and queue size given above will
be created for each source/destination IP address encountered,
respectively. This makes it possible to easily specify bandwidth
limits per host.</span></td>
</table>
</form>
<?php include("fend.inc"); ?>
-</body>
-</html>
firewall_shaper_queues.php
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("Firewall", "Traffic shaper");
require("guiconfig.inc");
if (!is_array($config['shaper']['pipe'])) {
}
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("Firewall: Traffic shaper");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
-<p class="pgtitle">Firewall: Traffic shaper</p>
<form action="firewall_shaper.php" method="post">
<?php if ($input_errors) print_input_errors($input_errors); ?>
<?php if ($savemsg) print_info_box($savemsg); ?>
<input name="apply" type="submit" class="formbtn" id="apply" value="Apply changes"></p>
<?php endif; ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr><td>
+ <tr><td class="tabnavtbl">
<ul id="tabnav">
- <li class="tabinact"><a href="firewall_shaper.php">Rules</a></li>
+ <li class="tabinact1"><a href="firewall_shaper.php">Rules</a></li>
<li class="tabinact"><a href="firewall_shaper_pipes.php">Pipes</a></li>
<li class="tabact">Queues</li>
<li class="tabinact"><a href="firewall_shaper_magic.php">Magic shaper wizard</a></li>
<td class="list" colspan="5"></td>
<td class="list"> <a href="firewall_shaper_queues_edit.php"><img src="plus.gif" width="17" height="17" border="0"></a></td>
</tr>
- </table>
- <p>
+ </table><br>
<strong><span class="red">Note:</span></strong> a queue can
- only be deleted if it is not referenced by any rules.</td></p>
+ only be deleted if it is not referenced by any rules.</td>
</tr>
</table>
</form>
<?php include("fend.inc"); ?>
-</body>
-</html>
firewall_shaper_queues_edit.php
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("Firewall", "Traffic shaper", "Edit queue");
require("guiconfig.inc");
$a_queues = &$config['shaper']['queue'];
}
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("Firewall: Traffic shaper: Edit queue");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
-<p class="pgtitle">Firewall: Traffic shaper: Edit queue</p>
<?php if ($input_errors) print_input_errors($input_errors); ?>
<?php if (is_array($config['shaper']['pipe']) && (count($config['shaper']['pipe']) > 0)): ?>
<form action="firewall_shaper_queues_edit.php" method="post" name="iform" id="iform">
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td valign="top" class="vncellreq">Pipe</td>
- <td class="vtable"> <select name="targetpipe" class="formfld">
+ <td class="vtable"><select name="targetpipe" class="formfld">
<?php
foreach ($config['shaper']['pipe'] as $pipei => $pipe): ?>
<option value="<?=$pipei;?>" <?php if ($pipei == $pconfig['targetpipe']) echo "selected"; ?>>
</tr>
<tr>
<td width="22%" valign="top" class="vncellreq">Weight</td>
- <td width="78%" class="vtable"> <input name="weight" type="text" id="weight" size="5" value="<?=htmlspecialchars($pconfig['weight']);?>">
+ <td width="78%" class="vtable"><?=$mandfldhtml;?><input name="weight" type="text" id="weight" size="5" value="<?=htmlspecialchars($pconfig['weight']);?>">
<br> <span class="vexpl">Valid range: 1..100.<br>
All backlogged (i.e., with packets queued) queues linked to
the same pipe share the pipe's bandwidth proportionally to
<p><strong>You need to create a pipe before you can add a new queue.</strong></p>
<?php endif; ?>
<?php include("fend.inc"); ?>
-</body>
-</html>
graph.php
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2004 T. Lechat <dev@lechat.org> and Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2004-2005 T. Lechat <dev@lechat.org> and Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
$first_stage_time_interval=2; //First stage time Intervall
$urldata=@$_SERVER["SCRIPT_NAME"];
-$fetch_link = "ifstats.cgi?$ifnum";
+$fetch_link = "stats.cgi?$ifnum";
//Style
$style['bg']="fill:white;stroke:none;stroke-width:0;opacity:1;";
--- /dev/null
+#!/usr/local/bin/php -f
+<?php
+/*
+ graph_cpu.php
+ part of m0n0wall (http://m0n0.ch/wall)
+
+ Copyright (C) 2004-2005 T. Lechat <dev@lechat.org> and Manuel Kasper <mk@neon1.net>.
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+*/
+
+/********* Other conf *******/
+$nb_plot=120; //NB plot in graph
+
+$fetch_link = "stats.cgi?cpu";
+
+//Style
+$style['bg']="fill:white;stroke:none;stroke-width:0;opacity:1;";
+$style['axis']="fill:black;stroke:black;stroke-width:1;";
+$style['cpu']="fill:#435370; font-family:Tahoma, Verdana, Arial, Helvetica, sans-serif; font-size:7;";
+$style['graph_cpu']="fill:none;stroke:#435370;stroke-width:1;opacity:0.8;";
+$style['legend']="fill:black; font-family:Tahoma, Verdana, Arial, Helvetica, sans-serif; font-size:4;";
+$style['grid_txt']="fill:gray; font-family:Tahoma, Verdana, Arial, Helvetica, sans-serif; font-size:6;";
+$style['grid']="stroke:gray;stroke-width:1;opacity:0.5;";
+$style['error']="fill:blue; font-family:Arial; font-size:4;";
+$style['collect_initial']="fill:gray; font-family:Tahoma, Verdana, Arial, Helvetica, sans-serif; font-size:4;";
+
+$error_text = "Cannot get CPU load";
+
+$height=100; //SVG internal height : do not modify
+$width=200; //SVG internal width : do not modify
+
+/********* Graph DATA **************/
+header("Content-type: image/svg+xml");
+print('<?xml version="1.0" encoding="iso-8859-1"?>' . "\n");?><svg width="100%" height="100%" viewBox="0 0 <?=$width?> <?=$height?>" preserveAspectRatio="none" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" onload="init(evt)">
+<g id="graph" style="visibility:visible">
+ <rect id="bg" x1="0" y1="0" x2="<?=$width?>" y2="<?=$height?>" style="<?=$style['bg']?>"/>
+ <line id="axis_x" x1="0" y1="0" x2="0" y2="<?=$height?>" style="<?=$style['axis']?>"/>
+ <line id="axis_y" x1="0" y1="<?=$height?>" x2="<?=$width?>" y2="<?=$height?>" style="<?=$style['axis']?>"/>
+ <path id="graph_cpu" d="M0 <?=$height?> L 0 <?=$height?>" style="<?=$style['graph_cpu']?>"/>
+ <path id="grid" d="M0 <?=$height/4*1?> L <?=$width?> <?=$height/4*1?> M0 <?=$height/4*2?> L <?=$width?> <?=$height/4*2?> M0 <?=$height/4*3?> L <?=$width?> <?=$height/4*3?>" style="<?=$style[grid]?>"/>
+ <text id="grid_txt1" x="<?=$width?>" y="<?=$height/4*1?>" style="<?=$style['grid_txt']?> text-anchor:end">75%</text>
+ <text id="grid_txt2" x="<?=$width?>" y="<?=$height/4*2?>" style="<?=$style['grid_txt']?> text-anchor:end">50%</text>
+ <text id="grid_txt3" x="<?=$width?>" y="<?=$height/4*3?>" style="<?=$style['grid_txt']?> text-anchor:end">25%</text>
+ <text id="graph_cpu_txt" x="4" y="8" style="<?=$style['cpu']?>"> </text>
+ <polygon id="axis_arrow_x" style="<?=$style['axis']?>" points="<?=($width) . "," . ($height)?> <?=($width-2) . "," . ($height-2)?> <?=($width-2) . "," . $height?>"/>
+ <text id="error" x="<?=$width*0.5?>" y="<?=$height*0.5?>" style="visibility:hidden;<?=$style['error']?> text-anchor:middle"><?=$error_text?></text>
+ <text id="collect_initial" x="<?=$width*0.5?>" y="<?=$height*0.5?>" style="visibility:hidden;<?=$style['collect_initial']?> text-anchor:middle">Collecting initial data, please wait...</text>
+</g>
+
+<script type="text/ecmascript"><![CDATA[
+var SVGDoc;
+var last_cpu_total=0;
+var last_cpu_idle=0;
+var diff_cpu_total=0;
+var diff_cpu_idle=0;
+plot_cpu = new Array();
+
+var isfirst=1;
+var index_plot=0;
+var step = <?=$width?> / <?=$nb_plot?> ;
+
+function init(evt) {
+ SVGDoc = evt.getTarget().getOwnerDocument();
+ go();
+}
+
+function go() {
+ getURL('<?=$fetch_link?>',urlcallback);
+}
+
+function urlcallback(obj) {
+ var error = 0;
+
+ //shift plot to left if nb_plot is already completed
+ var i=0;
+ if(index_plot > <?=$nb_plot?>)
+ {
+ while (i <= <?=$nb_plot?>)
+ {
+ var a=i+1;
+ plot_cpu[i]=plot_cpu[a];
+ i=i+1;
+ }
+ index_plot = <?=$nb_plot?>;
+ plot_cpu[index_plot]=0;
+ }
+
+ //if Geturl returns something
+ if (obj.success){
+ var cpu = parseInt(obj.content);
+ var scale;
+
+ if(!isNumber(cpu)) {
+ goerror();
+ return;
+ } else {
+ SVGDoc.getElementById("error").getStyle().setProperty ('visibility', 'hidden');
+ }
+
+ if(isfirst) {
+ SVGDoc.getElementById("collect_initial").getStyle().setProperty ('visibility', 'visible');
+ go();
+ isfirst=0;
+ return;
+ } else SVGDoc.getElementById("collect_initial").getStyle().setProperty ('visibility', 'hidden');
+
+ plot_cpu[index_plot] = cpu;
+
+ SVGDoc.getElementById('graph_cpu_txt').getFirstChild().setData(plot_cpu[index_plot] + '%');
+
+ scale = <?=$height?> / 100;
+
+ i = 0;
+
+ while (i <= index_plot)
+ {
+ var x = step * i;
+ var y_cpu= <?=$height?> - (plot_cpu[i] * scale);
+ if(i==0) {
+ var path_cpu = "M" + x + " " + y_cpu;
+ }
+ else
+ {
+ var path_cpu = path_cpu + " L" + x + " " + y_cpu;
+ }
+ i = i + 1;
+ }
+
+ index_plot = index_plot+1;
+ SVGDoc.getElementById('graph_cpu').setAttribute("d", path_cpu);
+
+ go();
+ }
+ else
+ { //In case of Geturl fails
+ goerror();
+ }
+}
+
+function goerror() {
+ SVGDoc.getElementById("error").getStyle().setProperty ('visibility', 'visible');
+ go();
+}
+
+function isNumber(a) {
+ return typeof a == 'number' && isFinite(a);
+}
+
+function LZ(x) {
+ return (x < 0 || x > 9 ? "" : "0") + x
+}
+]]></script>
+</svg>
\ No newline at end of file
form {
margin: 0px;
}
+p {
+ margin: 0 0 10px 0;
+}
.pgtitle {
font-size: 18px;
color: #777777;
padding-top: 5px;
padding-bottom: 5px;
}
+.listhdr a {
+ color: #000000;
+}
.listhdrr {
background-color: #BBBBBB;
padding-right: 16px;
padding-top: 5px;
padding-bottom: 5px;
}
+.listhdrr a {
+ color: #000000;
+}
.listlr {
background-color: #FFFFFF;
border-right: 1px solid #999999;
color: #FFFFFF;
font-weight: bold;
}
+.tabnavtbl {
+}
ul#tabnav {
font-size: 11px;
font-weight: bold;
margin: 0;
padding: 0;
}
+ul#tabnav li.tabinact1 {
+ float: left;
+ background-color: #777777;
+ color: #FFFFFF;
+ padding: 0;
+ white-space: nowrap;
+}
ul#tabnav li.tabinact {
float: left;
border-left: 1px solid #999999;
padding: 5px 8px 5px 8px;
color: #FFFFFF;
}
+ul#tabnav li.tabinact1 a {
+ float: left;
+ display: block;
+ text-decoration: none;
+ padding: 5px 8px 5px 8px;
+ color: #FFFFFF;
+}
ul#tabnav li.tabact {
float: left;
background-color: #EEEEEE;
guiconfig.inc
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
/* TCP flags */
$tcpflags = array("fin", "syn", "rst", "psh", "ack", "urg");
-$specialnets = array("lan" => "LAN net", "pptp" => "PPTP clients");
+$specialnets = array("wanip" => "WAN address", "lan" => "LAN net", "pptp" => "PPTP clients");
for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++) {
$specialnets['opt' . $i] = $config['interfaces']['opt' . $i]['descr'] . " net";
}
for ($i = 0; $i < count($reqdfields); $i++) {
- if (!$_POST[$reqdfields[$i]]) {
+ if (!isset($_POST[$reqdfields[$i]]) || ($_POST[$reqdfields[$i]] === "")) {
$input_errors[] = "The field '" . $reqdfieldsn[$i] . "' is required.";
}
}
usort($config['wol']['wolentry'], "wolcmp");
}
-function gentitle($pgname) {
- global $config;
- return $config['system']['hostname'] . "." . $config['system']['domain'] . " - " . $pgname;
-}
-
?>
index.php
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("m0n0wall webGUI");
+$pgtitle_omit = true;
require("guiconfig.inc");
/* find out whether there's hardware encryption (hifn) */
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("m0n0wall webGUI");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr align="center" valign="top">
<tr>
<td width="25%" class="vncellt">Platform</td>
<td width="75%" class="listr">
- <?=htmlspecialchars($g['platform']);?>
+ <?=htmlspecialchars($g['fullplatform']);?>
</td>
</tr><?php if ($hwcrypto): ?>
<tr>
<tr>
<td width="25%" class="vncellt">CPU usage</td>
<td width="75%" class="listr">
-<?php
-$cpuTicks = explode(" ", `/sbin/sysctl -n kern.cp_time`);
-sleep(1);
-$cpuTicks2 = explode(" ", `/sbin/sysctl -n kern.cp_time`);
-
-$diff = array();
-$diff['user'] = $cpuTicks2[0] - $cpuTicks[0];
-$diff['nice'] = $cpuTicks2[1] - $cpuTicks[1];
-$diff['sys'] = $cpuTicks2[2] - $cpuTicks[2];
-$diff['intr'] = $cpuTicks2[3] - $cpuTicks[3];
-$diff['idle'] = $cpuTicks2[4] - $cpuTicks[4];
-
-$totalDiff = $diff['user'] + $diff['nice'] + $diff['sys'] + $diff['intr'] + $diff['idle'];
-
-$cpuUsage = round(100 * (1 - $diff['idle'] / $totalDiff), 0);
-
-echo "<img src='bar_left.gif' height='15' width='4' border='0' align='absmiddle'>";
-echo "<img src='bar_blue.gif' height='15' width='" . $cpuUsage . "' border='0' align='absmiddle'>";
-echo "<img src='bar_gray.gif' height='15' width='" . (100 - $cpuUsage) . "' border='0' align='absmiddle'>";
-echo "<img src='bar_right.gif' height='15' width='5' border='0' align='absmiddle'> ";
-echo $cpuUsage . "%";
-?>
- </td>
+ <a href="status_graph_cpu.php">view graph</a></td>
</tr>
<tr>
<td width="25%" class="vncellt">Memory usage</td>
</tr>
</table>
<?php include("fend.inc"); ?>
-</body>
-</html>
part of m0n0wall (http://m0n0.ch/wall)
Written by Jim McBeath based on existing m0n0wall files
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("Interfaces", "Assign network ports");
require("guiconfig.inc");
/*
$config['interfaces'][$ifname]['if'] = $ifport;
/* check for wireless interfaces, set or clear ['wireless'] */
- if (preg_match("/^(wi|awi|an)/", $ifport)) {
+ if (preg_match($g['wireless_regex'], $ifport)) {
if (!is_array($config['interfaces'][$ifname]['wireless']))
$config['interfaces'][$ifname]['wireless'] = array();
} else {
}
if (!$portused) {
$config['interfaces'][$newifname]['if'] = $portname;
- if (preg_match("/^(wi|awi|an)/", $portname))
+ if (preg_match($g['wireless_regex'], $portname))
$config['interfaces'][$newifname]['wireless'] = array();
break;
}
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("Interfaces: Assign network ports");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
-<p class="pgtitle">Interfaces: Assign network ports</p>
<?php if ($input_errors) print_input_errors($input_errors); ?>
<?php if (file_exists($d_sysrebootreqd_path)) print_info_box(get_std_save_message(0)); ?>
<form action="interfaces_assign.php" method="post" name="iform" id="iform">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr><td>
+ <tr><td class="tabnavtbl">
<ul id="tabnav">
<li class="tabact">Interface assignments</li>
<li class="tabinact"><a href="interfaces_vlan.php">VLANs</a></li>
</tr>
<?php endif; ?>
</table>
- <input name="Submit" type="submit" class="formbtn" value="Save">
- <p><span class="vexpl"><strong><span class="red">Warning:</span><br>
- </strong>After you click "Save", you must reboot the firewall to make the changes take effect. You may also have to do one or more of the following steps before you can access your firewall again: </span></p>
- <ul>
- <li><span class="vexpl">change the IP address of your computer</span></li>
- <li><span class="vexpl">renew its DHCP lease</span></li>
- <li><span class="vexpl">access the webGUI with the new IP address</span></li>
- </ul></td>
+ <input name="Submit" type="submit" class="formbtn" value="Save"><br><br>
+<p><span class="vexpl"><strong><span class="red">Warning:</span><br>
+</strong>After you click "Save", you must reboot the firewall to make the changes take effect. You may also have to do one or more of the following steps before you can access your firewall again: </span></p>
+<ul>
+ <li><span class="vexpl">change the IP address of your computer</span></li>
+ <li><span class="vexpl">renew its DHCP lease</span></li>
+ <li><span class="vexpl">access the webGUI with the new IP address</span></li>
+</ul></td>
</tr>
</table>
</form>
<?php include("fend.inc"); ?>
-</body>
-</html>
interfaces_lan.php
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("Interfaces", "LAN");
require("guiconfig.inc");
$lancfg = &$config['interfaces']['lan'];
}
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("Interfaces: LAN");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
+<?php include("fbegin.inc"); ?>
<script language="JavaScript">
<!--
function gen_bits(ipaddr) {
}
// -->
</script>
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-<p class="pgtitle">Interfaces: LAN</p>
<?php if ($input_errors) print_input_errors($input_errors); ?>
<?php if ($savemsg) print_info_box($savemsg); ?>
<form action="interfaces_lan.php" method="post" name="iform" id="iform">
<tr>
<td width="22%" valign="top" class="vncellreq">IP address</td>
<td width="78%" class="vtable">
- <input name="ipaddr" type="text" class="formfld" id="hostname" size="20" value="<?=htmlspecialchars($pconfig['ipaddr']);?>" onchange="ipaddr_change()">
+ <?=$mandfldhtml;?><input name="ipaddr" type="text" class="formfld" id="hostname" size="20" value="<?=htmlspecialchars($pconfig['ipaddr']);?>" onchange="ipaddr_change()">
/
<select name="subnet" class="formfld" id="subnet">
<?php for ($i = 31; $i > 0; $i--): ?>
</table>
</form>
<?php include("fend.inc"); ?>
-</body>
-</html>
interfaces_opt.php
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
$pconfig['subnet'] = $optcfg['subnet'];
$pconfig['enable'] = isset($optcfg['enable']);
+$pgtitle = array("Interfaces", "Optional $index (" . htmlspecialchars($optcfg['descr']) . ")");
+
/* Wireless interface? */
if (isset($optcfg['wireless'])) {
require("interfaces_wlan.inc");
}
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("Interfaces: Optional $index (" . htmlspecialchars($optcfg['descr']) . ")");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
+<?php include("fbegin.inc"); ?>
<script language="JavaScript">
<!--
function enable_change(enable_over) {
}
//-->
</script>
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-<p class="pgtitle">Interfaces: Optional <?=$index;?> (<?=htmlspecialchars($optcfg['descr']);?>)</p>
<?php if ($input_errors) print_input_errors($input_errors); ?>
<?php if ($savemsg) print_info_box($savemsg); ?>
<?php if ($optcfg['if']): ?>
<tr>
<td width="22%" valign="top" class="vncellreq">Bridge with</td>
<td width="78%" class="vtable">
-<select name="bridge" class="formfld" id="bridge" onChange="enable_change(false)">
+ <select name="bridge" class="formfld" id="bridge" onChange="enable_change(false)">
<option <?php if (!$pconfig['bridge']) echo "selected";?> value="">none</option>
<?php $opts = array('lan' => "LAN", 'wan' => "WAN");
for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++) {
<tr>
<td width="22%" valign="top" class="vncellreq">IP address</td>
<td width="78%" class="vtable">
- <input name="ipaddr" type="text" class="formfld" id="ipaddr" size="20" value="<?=htmlspecialchars($pconfig['ipaddr']);?>" onchange="ipaddr_change()">
+ <?=$mandfldhtml;?><input name="ipaddr" type="text" class="formfld" id="ipaddr" size="20" value="<?=htmlspecialchars($pconfig['ipaddr']);?>" onchange="ipaddr_change()">
/
<select name="subnet" class="formfld" id="subnet">
<?php for ($i = 31; $i > 0; $i--): ?>
//-->
</script>
<?php else: ?>
-<p><strong>Optional <?=$index;?> has been disabled because there is no OPT<?=$index;?> interface.</strong></p>
+<strong>Optional <?=$index;?> has been disabled because there is no OPT<?=$index;?> interface.</strong>
<?php endif; ?>
<?php include("fend.inc"); ?>
-</body>
-</html>
interfaces_vlan.php
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("Interfaces", "Assign network ports");
require("guiconfig.inc");
if (!is_array($config['vlans']['vlan']))
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("Interfaces: Assign network ports: VLANs");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
-<p class="pgtitle">Interfaces: Assign network ports: VLANs</p>
<?php if ($input_errors) print_input_errors($input_errors); ?>
<?php if (file_exists($d_sysrebootreqd_path)) print_info_box(get_std_save_message(0)); ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr><td>
+ <tr><td class="tabnavtbl">
<ul id="tabnav">
- <li class="tabinact"><a href="interfaces_assign.php">Interface assignments</a></li>
+ <li class="tabinact1"><a href="interfaces_assign.php">Interface assignments</a></li>
<li class="tabact">VLANs</li>
</ul>
</td></tr>
<td class="list"> <a href="interfaces_vlan_edit.php"><img src="plus.gif" width="17" height="17" border="0"></a></td>
</tr>
<tr>
- <td colspan="3" class="list"><p class="vexpl"><span class="red"><strong>
+ <td colspan="3" class="list"><span class="vexpl"><span class="red"><strong>
Note:<br>
</strong></span>
- Not all drivers/NICs support 802.1Q VLAN tagging properly. On cards that do not explicitly support it, VLAN tagging will still work, but the reduced MTU may cause problems. See the m0n0wall homepage for information on supported cards. </p>
+ Not all drivers/NICs support 802.1Q VLAN tagging properly. On cards that do not explicitly support it, VLAN tagging will still work, but the reduced MTU may cause problems. See the m0n0wall homepage for information on supported cards.</span>
</td>
<td class="list"> </td>
</tr>
</tr>
</table>
<?php include("fend.inc"); ?>
-</body>
-</html>
interfaces_vlan_edit.php
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("Interfaces", "Assign network ports", "Edit VLAN");
require("guiconfig.inc");
if (!is_array($config['vlans']['vlan']))
}
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head>
-<title><?=gentitle("Interfaces: Assign network ports: VLANs: Edit");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
-<p class="pgtitle">Interfaces: Assign network ports: VLANs: Edit</p>
<?php if ($input_errors) print_input_errors($input_errors); ?>
<form action="interfaces_vlan_edit.php" method="post" name="iform" id="iform">
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td valign="top" class="vncellreq">VLAN tag </td>
<td class="vtable">
- <input name="tag" type="text" class="formfld" id="tag" size="6" value="<?=htmlspecialchars($pconfig['tag']);?>">
+ <?=$mandfldhtml;?><input name="tag" type="text" class="formfld" id="tag" size="6" value="<?=htmlspecialchars($pconfig['tag']);?>">
<br>
<span class="vexpl">802.1Q VLAN tag (between 1 and 4094) </span></td>
</tr>
</table>
</form>
<?php include("fend.inc"); ?>
-</body>
-</html>
interfaces_wan.php
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("Interfaces", "WAN");
require("guiconfig.inc");
$wancfg = &$config['interfaces']['wan'];
do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
}
+ $_POST['spoofmac'] = str_replace("-", ":", $_POST['spoofmac']);
+
if (($_POST['ipaddr'] && !is_ipaddr($_POST['ipaddr']))) {
$input_errors[] = "A valid IP address must be specified.";
}
}
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("Interfaces: WAN");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
+<?php include("fbegin.inc"); ?>
<script language="JavaScript">
<!--
function enable_change(enable_change) {
}
//-->
</script>
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-<p class="pgtitle">Interfaces: WAN</p>
<?php if ($input_errors) print_input_errors($input_errors); ?>
<?php if ($savemsg) print_info_box($savemsg); ?>
<form action="interfaces_wan.php" method="post" name="iform" id="iform">
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td valign="middle"><strong>Type</strong></td>
- <td> <select name="type" class="formfld" id="type" onchange="type_change()">
+ <td><select name="type" class="formfld" id="type" onchange="type_change()">
<?php $opts = split(" ", "Static DHCP PPPoE PPTP BigPond");
foreach ($opts as $opt): ?>
<option <?php if ($opt == $pconfig['type']) echo "selected";?>>
</tr>
<tr>
<td width="100" valign="top" class="vncellreq">IP address</td>
- <td class="vtable"> <input name="ipaddr" type="text" class="formfld" id="ipaddr" size="20" value="<?=htmlspecialchars($pconfig['ipaddr']);?>">
+ <td class="vtable"><?=$mandfldhtml;?><input name="ipaddr" type="text" class="formfld" id="ipaddr" size="20" value="<?=htmlspecialchars($pconfig['ipaddr']);?>">
/
<select name="subnet" class="formfld" id="subnet">
<?php
<tr>
<td valign="top" class="vncellreq">Point-to-point IP address </td>
<td class="vtable">
- <input name="pointtopoint" type="text" class="formfld" id="pointtopoint" size="20" value="<?=htmlspecialchars($pconfig['pointtopoint']);?>">
+ <?=$mandfldhtml;?><input name="pointtopoint" type="text" class="formfld" id="pointtopoint" size="20" value="<?=htmlspecialchars($pconfig['pointtopoint']);?>">
</td>
</tr><?php endif; ?>
<tr>
<td valign="top" class="vncellreq">Gateway</td>
- <td class="vtable"> <input name="gateway" type="text" class="formfld" id="gateway" size="20" value="<?=htmlspecialchars($pconfig['gateway']);?>">
+ <td class="vtable"><?=$mandfldhtml;?><input name="gateway" type="text" class="formfld" id="gateway" size="20" value="<?=htmlspecialchars($pconfig['gateway']);?>">
</td>
</tr>
<tr>
</tr>
<tr>
<td valign="top" class="vncellreq">Username</td>
- <td class="vtable"><input name="username" type="text" class="formfld" id="username" size="20" value="<?=htmlspecialchars($pconfig['username']);?>">
+ <td class="vtable"><?=$mandfldhtml;?><input name="username" type="text" class="formfld" id="username" size="20" value="<?=htmlspecialchars($pconfig['username']);?>">
</td>
</tr>
<tr>
<td valign="top" class="vncellreq">Password</td>
- <td class="vtable"><input name="password" type="text" class="formfld" id="password" size="20" value="<?=htmlspecialchars($pconfig['password']);?>">
+ <td class="vtable"><?=$mandfldhtml;?><input name="password" type="text" class="formfld" id="password" size="20" value="<?=htmlspecialchars($pconfig['password']);?>">
</td>
</tr>
<tr>
</tr>
<tr>
<td valign="top" class="vncellreq">Username</td>
- <td class="vtable"><input name="pptp_username" type="text" class="formfld" id="pptp_username" size="20" value="<?=htmlspecialchars($pconfig['pptp_username']);?>">
+ <td class="vtable"><?=$mandfldhtml;?><input name="pptp_username" type="text" class="formfld" id="pptp_username" size="20" value="<?=htmlspecialchars($pconfig['pptp_username']);?>">
</td>
</tr>
<tr>
<td valign="top" class="vncellreq">Password</td>
- <td class="vtable"><input name="pptp_password" type="text" class="formfld" id="pptp_password" size="20" value="<?=htmlspecialchars($pconfig['pptp_password']);?>">
+ <td class="vtable"><?=$mandfldhtml;?><input name="pptp_password" type="text" class="formfld" id="pptp_password" size="20" value="<?=htmlspecialchars($pconfig['pptp_password']);?>">
</td>
</tr>
<tr>
<td width="100" valign="top" class="vncellreq">Local IP address</td>
- <td class="vtable"> <input name="pptp_local" type="text" class="formfld" id="pptp_local" size="20" value="<?=htmlspecialchars($pconfig['pptp_local']);?>">
+ <td class="vtable"><?=$mandfldhtml;?><input name="pptp_local" type="text" class="formfld" id="pptp_local" size="20" value="<?=htmlspecialchars($pconfig['pptp_local']);?>">
/
<select name="pptp_subnet" class="formfld" id="pptp_subnet">
<?php for ($i = 31; $i > 0; $i--): ?>
</tr>
<tr>
<td width="100" valign="top" class="vncellreq">Remote IP address</td>
- <td class="vtable"> <input name="pptp_remote" type="text" class="formfld" id="pptp_remote" size="20" value="<?=htmlspecialchars($pconfig['pptp_remote']);?>">
+ <td class="vtable"><?=$mandfldhtml;?><input name="pptp_remote" type="text" class="formfld" id="pptp_remote" size="20" value="<?=htmlspecialchars($pconfig['pptp_remote']);?>">
</td>
</tr>
<tr>
</tr>
<tr>
<td valign="top" class="vncellreq">Username</td>
- <td class="vtable"><input name="bigpond_username" type="text" class="formfld" id="bigpond_username" size="20" value="<?=htmlspecialchars($pconfig['bigpond_username']);?>">
+ <td class="vtable"><?=$mandfldhtml;?><input name="bigpond_username" type="text" class="formfld" id="bigpond_username" size="20" value="<?=htmlspecialchars($pconfig['bigpond_username']);?>">
</td>
</tr>
<tr>
<td valign="top" class="vncellreq">Password</td>
- <td class="vtable"><input name="bigpond_password" type="text" class="formfld" id="bigpond_password" size="20" value="<?=htmlspecialchars($pconfig['bigpond_password']);?>">
+ <td class="vtable"><?=$mandfldhtml;?><input name="bigpond_password" type="text" class="formfld" id="bigpond_password" size="20" value="<?=htmlspecialchars($pconfig['bigpond_password']);?>">
</td>
</tr>
<tr>
//-->
</script>
<?php include("fend.inc"); ?>
-</body>
-</html>
interfaces_wlan.inc
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
POSSIBILITY OF SUCH DAMAGE.
*/
+$wlchannels = array(1,2,3,4,5,6,7,8,9,10,11,12,13,14);
+
function wireless_config_init() {
global $optcfg, $pconfig;
+ $pconfig['standard'] = $optcfg['wireless']['standard'];
$pconfig['mode'] = $optcfg['wireless']['mode'];
$pconfig['ssid'] = $optcfg['wireless']['ssid'];
$pconfig['stationname'] = $optcfg['wireless']['stationname'];
if (!$input_errors) {
+ $optcfg['wireless']['standard'] = $_POST['standard'];
$optcfg['wireless']['mode'] = $_POST['mode'];
$optcfg['wireless']['ssid'] = $_POST['ssid'];
$optcfg['wireless']['stationname'] = $_POST['stationname'];
}
function wireless_config_print() {
- global $optcfg, $pconfig;
+ global $optcfg, $pconfig, $wlchannels;
?>
<tr>
<td colspan="2" valign="top" height="16"></td>
<tr>
<td colspan="2" valign="top" class="listtopic">Wireless configuration</td>
</tr>
+ <?php if (strstr($optcfg['if'], "ath")): ?>
+ <tr>
+ <td valign="top" class="vncellreq">Standard</td>
+ <td class="vtable"><select name="standard" class="formfld" id="standard">
+ <?php
+ $standards = array("11b" => "802.11b", "11g" => "802.11g", "11a" => "802.11a");
+ foreach ($standards as $sn => $sv): ?>
+ <option value="<?=$sn;?>" <?php if ($sn == $pconfig['standard']) echo "selected";?>>
+ <?=$sv;?>
+ </option>
+ <?php endforeach; ?>
+ </select></td>
+ </tr>
+ <?php endif; ?>
<tr>
<td valign="top" class="vncellreq">Mode</td>
- <td class="vtable"> <select name="mode" class="formfld" id="mode">
+ <td class="vtable"><select name="mode" class="formfld" id="mode">
<?php
$opts = array();
- if (strstr($optcfg['if'], "wi"))
+ if (strstr($optcfg['if'], "wi") || strstr($optcfg['if'], "ath"))
$opts[] = "hostap";
$opts[] = "BSS";
$opts[] = "IBSS";
</tr>
<tr>
<td valign="top" class="vncellreq">SSID</td>
- <td class="vtable"><input name="ssid" type="text" class="formfld" id="ssid" size="20" value="<?=htmlspecialchars($pconfig['ssid']);?>">
+ <td class="vtable"><?=$mandfldhtml;?><input name="ssid" type="text" class="formfld" id="ssid" size="20" value="<?=htmlspecialchars($pconfig['ssid']);?>">
</td>
</tr>
<tr>
<td valign="top" class="vncellreq">Channel</td>
<td class="vtable"><select name="channel" class="formfld" id="channel">
+ <option <?php if ($pconfig['channel'] == 0) echo "selected";?> value="0">Auto</option>
<?php
- for ($i = 0; $i <= 14; $i++): ?>
- <option <?php if ($i == $pconfig['channel']) echo "selected";?>>
- <? echo($i==0 ? "Auto" : $i) ?>
+ foreach ($wlchannels as $channel): ?>
+ <option <?php if ($channel == $pconfig['channel']) echo "selected";?> value="<?=$channel;?>">
+ <?=$channel;?>
</option>
- <?php endfor; ?>
- </select></td>
+ <?php endforeach; ?>
+ </select> <br>
+ Note: Not all channels may be supported by your card</td>
</tr>
<tr>
<td valign="top" class="vncell">Station name</td>
<tr>
<td valign="top" class="vncell">WEP</td>
<td class="vtable"> <input name="wep_enable" type="checkbox" id="wep_enable" value="yes" <?php if ($pconfig['wep_enable']) echo "checked"; ?>>
- <strong>Enable WEP</strong><br>
- <table border="0" cellspacing="0" cellpadding="0">
+ <strong>Enable WEP</strong>
+ <table border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
<td> </td>
#!/usr/local/bin/php
-<?php require("guiconfig.inc");
+<?php
+$pgtitle = array("License");
+require("guiconfig.inc");
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("License");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
-<p class="pgtitle">License</p>
- <p><strong>m0n0wall is Copyright © 2002-2004 by Manuel Kasper
+ <p><strong>m0n0wall is Copyright © 2002-2005 by Manuel Kasper
(<a href="mailto:mk@neon1.net">mk@neon1.net</a>).<br>
All rights reserved.</strong></p>
<p> Redistribution and use in source and binary forms, with or without<br>
<br>
Jim McBeath (<a href="mailto:monowall@j.jimmc.org">monowall@j.jimmc.org</a>)<br>
<em><font color="#666666">Filter rule patches
- (ordering, block/pass, disabled); better status page;<br>
- webGUI assign network ports page </font></em><br>
+ (ordering, block/pass, disabled); better status page;</font></em><br>
+ <em><font color="#666666">webGUI assign network ports page</font></em><br>
<br>
Chris Olive (<a href="mailto:chris@technologEase.com">chris@technologEase.com</a>)<br>
<em><font color="#666666">enhanced "execute
<em><font color="#666666">DHCP lease list page</font></em><br>
<br>
Peter Allgeyer (<a href="mailto:allgeyer@web.de">allgeyer@web.de</a>)<br>
- <em><font color="#666666">"reject" type filter rules; dial-on-demand; WAN connect/disconnect</font></em><br>
+ <em><font color="#666666">"reject" type filter rules; dial-on-demand; WAN connect/disconnect; auto-add proxy ARP </font></em><br>
<br>
Thierry Lechat (<a href="mailto:dev@lechat.org">dev@lechat.org</a>)<br>
<em><font color="#666666">SVG-based traffic grapher</font></em><br>
<em><font color="#666666">NAT on optional interfaces</font></em><br>
<br>
Dinesh Nair (<a href="mailto:dinesh@alphaque.com">dinesh@alphaque.com</a>)<br>
- <em><font color="#666666">captive portal: pass-through MAC/IP addresses, RADIUS authentication & accounting;<br>
- <em><font color="#666666"></font></em>HTTP server concurrency limit</font></em><br>
+ <em><font color="#666666">captive portal: pass-through MAC/IP addresses, RADIUS authentication & accounting;</font></em><br>
+ <em><font color="#666666">HTTP server concurrency limit</font></em><br>
<br>
Justin Ellison (<a href="mailto:justin@techadvise.com">justin@techadvise.com</a>)<br>
<em><font color="#666666">traffic shaper TOS matching; magic shaper; DHCP deny unknown clients;<br>
IPsec user FQDNs; DHCP relay</font></em><br>
<br>
Fred Wright (<a href="mailto:fw@well.com">fw@well.com</a>)<br>
- <em><font color="#666666">ipfilter window scaling fix; ipnat ICMP checksum adjustment fix; IPsec dead SA fixes</font></em><br>
+ <em><font color="#666666">ipfilter window scaling fix; ipnat ICMP checksum adjustment fix; IPsec dead SA fixes;</font></em><br>
+ <em><font color="#666666">netgraph PPP PFC fixes; kernel build improvements;</font></em><br>
+ <em><font color="#666666">updated DP83815 short cable bug workaround</font></em><br>
<br>
Michael Hanselmann (<a href="mailto:m0n0@hansmi.ch">m0n0@hansmi.ch</a>)<br>
- <em><font color="#666666">IDE hard disk standby</font></em><br>
+ <em><font color="#666666">IDE hard disk standby; exec.php arrow keys</font></em><br>
<br>
Audun Larsen (<a href="mailto:larsen@xqus.com">larsen@xqus.com</a>)<br>
<em><font color="#666666">CPU/memory usage display</font></em><br>
<br>
Peter Curran (<a href="mailto:peter@closeconsultants.com">peter@closeconsultants.com</a>)<br>
- <em><font color="#666666">OpenVPN support</font></em></p>
+ <em><font color="#666666">OpenVPN support</font></em><br>
+ <br>
+ Pavel A. Grodek (<a href="mailto:pg@abletools.com">pg@abletools.com</a>)<br>
+ <em><font color="#666666">Traffic shaper packet loss rate/queue size</font></em><br>
+ <br>
+ Rob Parker, Keycom PLC (<a href="mailto:rob.parker@keycom.co.uk">rob.parker@keycom.co.uk</a>)<br>
+ <em><font color="#666666">Captive portal per-user bandwidth restrictions</font></em><br>
+ <br>
+ Pascal Suter (<a href="mailto:d-monodev@psuter.ch">d-monodev@psuter.ch</a>)<br>
+ <em><font color="#666666">Captive portal local user database</font></em><br>
+ <br>
+ Matt Juszczak (<a href="mailto:matt@atopia.net">matt@atopia.net</a>)<br>
+ <em><font color="#666666">Captive portal logging</font></em></p>
<hr size="1">
<p>m0n0wall is based upon/includes various free software packages,
listed below.<br>
The author of m0n0wall would like to thank the authors of these
software packages for their efforts.</p>
<p>FreeBSD (<a href="http://www.freebsd.org" target="_blank">http://www.freebsd.org</a>)<br>
- Copyright © 1994-2003 FreeBSD, Inc. All rights reserved.<br>
+ Copyright © 1994-2005 FreeBSD, Inc. All rights reserved.<br>
<br>
This product includes PHP, freely available from <a href="http://www.php.net/" target="_blank">http://www.php.net</a>.<br>
- Copyright © 1999 - 2003 The PHP Group. All rights reserved.<br>
+ Copyright © 1999 - 2005 The PHP Group. All rights reserved.<br>
<br>
mini_httpd (<a href="http://www.acme.com/software/mini_httpd" target="_blank">http://www.acme.com/software/mini_httpd)</a><br>
Copyright © 1999, 2000 by Jef Poskanzer <jef@acme.com>.
Copyright © 1996-2003 Internet Software Consortium. All rights
reserved.<br>
<br>
- ipfilter (<a href="http://www.ipfilter.org" target="_blank">http://www.ipfilter.org</a>)<br>
+ ipfilter (<a href="http://coombs.anu.edu.au/ipfilter" target="_blank">http://coombs.anu.edu.au/ipfilter</a>)<br>
Copyright © 1993-2002 by Darren Reed.<br>
<br>
MPD - Multi-link PPP daemon for FreeBSD (<a href="http://www.dellroad.org/mpd" target="_blank">http://www.dellroad.org/mpd</a>)<br>
<br>
wol (<a href="http://ahh.sourceforge.net/wol" target="_blank">http://ahh.sourceforge.net/wol</a>)<br>
Copyright © 2000,2001,2002,2003,2004 Thomas Krennwallner <krennwallner@aon.at>
- <?php include("fend.inc"); ?>
-</body>
-</html>
+<?php include("fend.inc"); ?>
reboot.php
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("Diagnostics", "Reboot system");
require("guiconfig.inc");
if ($_POST) {
}
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("Reboot system");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
-<p class="pgtitle">Reboot system</p>
<?php if ($rebootmsg): echo print_info_box($rebootmsg); else: ?>
<form action="reboot.php" method="post">
<p><strong>Are you sure you want to reboot the system?</strong></p>
</form>
<?php endif; ?>
<?php include("fend.inc"); ?>
-</body>
-</html>
services_captiveportal.php
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("Services", "Captive portal");
require("guiconfig.inc");
if (!is_array($config['captiveportal'])) {
$pconfig['timeout'] = $config['captiveportal']['timeout'];
$pconfig['idletimeout'] = $config['captiveportal']['idletimeout'];
$pconfig['enable'] = isset($config['captiveportal']['enable']);
+$pconfig['auth_method'] = $config['captiveportal']['auth_method'];
$pconfig['radacct_enable'] = isset($config['captiveportal']['radacct_enable']);
$pconfig['httpslogin_enable'] = isset($config['captiveportal']['httpslogin']);
$pconfig['httpsname'] = $config['captiveportal']['httpsname'];
$config['captiveportal']['timeout'] = $_POST['timeout'];
$config['captiveportal']['idletimeout'] = $_POST['idletimeout'];
$config['captiveportal']['enable'] = $_POST['enable'] ? true : false;
+ $config['captiveportal']['auth_method'] = $_POST['auth_method'];
$config['captiveportal']['radacct_enable'] = $_POST['radacct_enable'] ? true : false;
$config['captiveportal']['httpslogin'] = $_POST['httpslogin_enable'] ? true : false;
$config['captiveportal']['httpsname'] = $_POST['httpsname'];
}
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("Services: Captive portal");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
+<?php include("fbegin.inc"); ?>
<script language="JavaScript">
<!--
-function radacct_change() {
- if (document.iform.radacct_enable.checked) {
- document.iform.logoutwin_enable.checked = 1;
- }
-}
-
function enable_change(enable_change) {
var endis;
endis = !(document.iform.enable.checked || enable_change);
document.iform.radiusport.disabled = endis;
document.iform.radiuskey.disabled = endis;
document.iform.radacct_enable.disabled = endis;
+ document.iform.radiusacctport.disabled = endis;
+ document.iform.auth_method[0].disabled = endis;
+ document.iform.auth_method[1].disabled = endis;
+ document.iform.auth_method[2].disabled = endis;
document.iform.httpslogin_enable.disabled = endis;
document.iform.httpsname.disabled = endis;
document.iform.cert.disabled = endis;
document.iform.nomacfilter.disabled = endis;
document.iform.htmlfile.disabled = endis;
document.iform.errfile.disabled = endis;
-
- if (enable_change && document.iform.radacct_enable.checked) {
- document.iform.logoutwin_enable.checked = 1;
- }
}
//-->
</script>
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-<p class="pgtitle">Services: Captive portal</p>
<?php if ($input_errors) print_input_errors($input_errors); ?>
<?php if ($savemsg) print_info_box($savemsg); ?>
<form action="services_captiveportal.php" method="post" enctype="multipart/form-data" name="iform" id="iform">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr><td>
+ <tr><td class="tabnavtbl">
<ul id="tabnav">
<li class="tabact">Captive portal</li>
<li class="tabinact"><a href="services_captiveportal_mac.php">Pass-through MAC</a></li>
<li class="tabinact"><a href="services_captiveportal_ip.php">Allowed IP addresses</a></li>
+ <li class="tabinact"><a href="services_captiveportal_users.php">Users</a></li>
</ul>
</td></tr>
<tr>
<td width="78%" class="vtable">
<input name="logoutwin_enable" type="checkbox" class="formfld" id="logoutwin_enable" value="yes" <?php if($pconfig['logoutwin_enable']) echo "checked"; ?>>
<strong>Enable logout popup window</strong><br>
- If enabled, a popup window will appear when clients are allowed through the captive portal. This allows clients to explicitly disconnect themselves before the idle or hard timeout occurs. When RADIUS accounting is enabled, this option is implied.</td>
+ If enabled, a popup window will appear when clients are allowed through the captive portal. This allows clients to explicitly disconnect themselves before the idle or hard timeout occurs.</td>
</tr>
<tr>
<td valign="top" class="vncell">Redirection URL</td>
If this option is set, no attempts will be made to ensure that the MAC address of clients stays the same while they're logged in. This is required when the MAC address of cannot be determined (usually because there are routers between m0n0wall and the clients).</td>
</tr>
<tr>
- <td width="22%" valign="top" class="vncell">RADIUS server</td>
+ <td width="22%" valign="top" class="vncell">Authentication</td>
<td width="78%" class="vtable">
<table cellpadding="0" cellspacing="0">
+ <tr>
+ <td colspan="2"><input name="auth_method" type="radio" id="auth_method" value="none" <?php if($pconfig['auth_method']!="local" && $pconfig['auth_method']!="radius") echo "checked"; ?>>
+ No authentication</td>
+ </tr>
+ <tr>
+ <td colspan="2"><input name="auth_method" type="radio" id="auth_method" value="local" <?php if($pconfig['auth_method']=="local") echo "checked"; ?>>
+ Local <a href="services_captiveportal_users.php">user manager</a></td>
+ </tr>
+ <tr>
+ <td colspan="2"><input name="auth_method" type="radio" id="auth_method" value="radius" <?php if($pconfig['auth_method']=="radius") echo "checked"; ?>>
+ RADIUS authentication</td>
+ </tr><tr>
+ <td> </td>
+ <td> </td>
+ </tr>
<tr>
<td>IP address:</td>
<td><input name="radiusip" type="text" class="formfld" id="radiusip" size="20" value="<?=htmlspecialchars($pconfig['radiusip']);?>"></td>
</tr>
<tr>
<td>Accounting: </td>
- <td><input name="radacct_enable" type="checkbox" id="radacct_enable" value="yes" <?php if($pconfig['radacct_enable']) echo "checked"; ?> onClick="radacct_change()"></td>
+ <td><input name="radacct_enable" type="checkbox" id="radacct_enable" value="yes" <?php if($pconfig['radacct_enable']) echo "checked"; ?>></td>
</tr>
<tr>
<td>Accounting port: </td>
<td><input name="radiusacctport" type="text" class="formfld" id="radiusacctport" size="5" value="<?=htmlspecialchars($pconfig['radiusacctport']);?>"></td>
</tr></table>
<br>
- Enter the IP address and port of the RADIUS server which users of the captive portal have to authenticate against. Leave blank to disable RADIUS authentication. Leave port number blank to use the default port (1812). Leave the RADIUS shared secret blank to not use a RADIUS shared secret. RADIUS accounting packets will also be sent to the RADIUS server if accounting is enabled (default port is 1813).
+ When using RADIUS authentication, enter the IP address and port of the RADIUS server which users of the captive portal have to authenticate against. Leave port number blank to use the default port (1812). Leave the RADIUS shared secret blank to not use a RADIUS shared secret. RADIUS accounting packets will also be sent to the RADIUS server if accounting is enabled (default port is 1813).
</tr>
<tr>
<td valign="top" class="vncell">HTTPS login</td>
<tr>
<td width="22%" valign="top" class="vncellreq">Portal page contents</td>
<td width="78%" class="vtable">
- <input type="file" name="htmlfile" class="formfld" id="htmlfile"><br>
+ <?=$mandfldhtml;?><input type="file" name="htmlfile" class="formfld" id="htmlfile"><br>
<?php if ($config['captiveportal']['page']['htmltext']): ?>
<a href="?act=viewhtml" target="_blank">View current page</a>
<br>
//-->
</script>
<?php include("fend.inc"); ?>
-</body>
-</html>
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("Services", "Captive portal");
require("guiconfig.inc");
if (!is_array($config['captiveportal']['allowedip']))
}
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("Services: Captive portal");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
-<p class="pgtitle">Services: Captive portal: Allowed IP addresses</p>
<form action="services_captiveportal_ip.php" method="post">
<?php if ($savemsg) print_info_box($savemsg); ?>
<?php if (file_exists($d_allowedipsdirty_path)): ?><p>
<input name="apply" type="submit" class="formbtn" id="apply" value="Apply changes"></p>
<?php endif; ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr><td>
+ <tr><td class="tabnavtbl">
<ul id="tabnav">
- <li class="tabinact"><a href="services_captiveportal.php">Captive portal</a></li>
+ <li class="tabinact1"><a href="services_captiveportal.php">Captive portal</a></li>
<li class="tabinact"><a href="services_captiveportal_mac.php">Pass-through MAC</a></li>
<li class="tabact">Allowed IP addresses</li>
+ <li class="tabinact"><a href="services_captiveportal_users.php">Users</a></li>
</ul>
</td></tr>
<tr>
</table>
</form>
<?php include("fend.inc"); ?>
-</body>
-</html>
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("Services", "Captive portal", "Edit allowed IP address");
require("guiconfig.inc");
if (!is_array($config['captiveportal']['allowedip']))
}
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("Services: Captive portal: Edit allowed IP address");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
-<p class="pgtitle">Services: Captive portal: Edit allowed IP address</p>
<?php if ($input_errors) print_input_errors($input_errors); ?>
<form action="services_captiveportal_ip_edit.php" method="post" name="iform" id="iform">
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td width="22%" valign="top" class="vncellreq">IP address</td>
<td width="78%" class="vtable">
- <input name="ip" type="text" class="formfld" id="ip" size="17" value="<?=htmlspecialchars($pconfig['ip']);?>">
+ <?=$mandfldhtml;?><input name="ip" type="text" class="formfld" id="ip" size="17" value="<?=htmlspecialchars($pconfig['ip']);?>">
<br>
<span class="vexpl">IP address</span></td>
</tr>
</table>
</form>
<?php include("fend.inc"); ?>
-</body>
-</html>
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("Services", "Captive portal");
require("guiconfig.inc");
if (!is_array($config['captiveportal']['passthrumac']))
}
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("Services: Captive portal");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
-<p class="pgtitle">Services: Captive portal: Pass-through MAC addresses</p>
<form action="services_captiveportal_mac.php" method="post">
<?php if ($savemsg) print_info_box($savemsg); ?>
<?php if (file_exists($d_passthrumacsdirty_path)): ?><p>
<input name="apply" type="submit" class="formbtn" id="apply" value="Apply changes"></p>
<?php endif; ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr><td>
+ <tr><td class="tabnavtbl">
<ul id="tabnav">
- <li class="tabinact"><a href="services_captiveportal.php">Captive portal</a></li>
+ <li class="tabinact1"><a href="services_captiveportal.php">Captive portal</a></li>
<li class="tabact">Pass-through MAC</li>
<li class="tabinact"><a href="services_captiveportal_ip.php">Allowed IP addresses</a></li>
+ <li class="tabinact"><a href="services_captiveportal_users.php">Users</a></li>
</ul>
</td></tr>
<tr>
</table>
</form>
<?php include("fend.inc"); ?>
-</body>
-</html>
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("Services", "Captive portal", "Edit pass-through MAC address");
require("guiconfig.inc");
if (!is_array($config['captiveportal']['passthrumac']))
do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
+ $_POST['mac'] = str_replace("-", ":", $_POST['mac']);
+
if (($_POST['mac'] && !is_macaddr($_POST['mac']))) {
$input_errors[] = "A valid MAC address must be specified. [".$_POST['mac']."]";
}
}
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("Services: Captive portal: Edit pass-through MAC address");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
-<p class="pgtitle">Services: Captive portal: Edit pass-through MAC address</p>
<?php if ($input_errors) print_input_errors($input_errors); ?>
<form action="services_captiveportal_mac_edit.php" method="post" name="iform" id="iform">
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td width="22%" valign="top" class="vncellreq">MAC address</td>
<td width="78%" class="vtable">
- <input name="mac" type="text" class="formfld" id="mac" size="17" value="<?=htmlspecialchars($pconfig['mac']);?>">
+ <?=$mandfldhtml;?><input name="mac" type="text" class="formfld" id="mac" size="17" value="<?=htmlspecialchars($pconfig['mac']);?>">
<br>
<span class="vexpl">MAC address (6 hex octets separated by colons)</span></td>
</tr>
</table>
</form>
<?php include("fend.inc"); ?>
-</body>
-</html>
--- /dev/null
+#!/usr/local/bin/php
+<?php
+/*
+ services_captiveportal_users.php
+ part of m0n0wall (http://m0n0.ch/wall)
+
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
+ All rights reserved.
+ Copyright (C) 2005 Pascal Suter <d-monodev@psuter.ch>.
+ All rights reserved.
+ (files was created by Pascal based on the source code of services_captiveportal.php from Manuel)
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+*/
+$pgtitle = array("Services", "Captive portal");
+require("guiconfig.inc");
+if(isset($_POST['save'])){
+ //value-checking
+ if(trim($_POST['password1'])!="********" &&
+ trim($_POST['password1'])!="" &&
+ trim($_POST['password1'])!=trim($_POST['password2'])){
+ //passwords are to be changed but don't match
+ $input_errors[]="passwords don't match";
+ }
+ if((trim($_POST['password1'])=="" || trim($_POST['password1'])=="********") &&
+ (trim($_POST['password2'])=="" || trim($_POST['password2'])=="********")){
+ //assume password should be left as is if a password is set already.
+ if(!empty($config['users'][$_POST['old_username']]['password'])){
+ $_POST['password1']="********";
+ $_POST['password2']="********";
+ } else {
+ $input_errors[]="password must not be empty";
+ }
+ } else {
+ if(trim($_POST['password1'])!=trim($_POST['password2'])){
+ //passwords are to be changed or set but don't match
+ $input_errors[]="passwords don't match";
+ } else {
+ //check password for invalid characters
+ if(!preg_match('/^[a-zA-Z0-9_\-\.@\~\(\)\&\*\+§?!\$£°\%;:]*$/',$_POST['username'])){
+ $input_errors[] = "password contains illegal characters, only letters from A-Z and a-z, _, -, .,@,~,(,),&,*,+,§,?,!,$,£,°,%,;,: and numbers are allowed";
+ //test pw: AZaz_-.@~()&*+§?!$£°%;:
+ }
+ }
+ }
+ if($_POST['username']==""){
+ $input_errors[] = "username must not be empty!";
+ }
+ //check for a valid expirationdate if one is set at all (valid means, strtotime() puts out a time stamp
+ //so any strtotime compatible time format may be used. to keep it simple for the enduser, we only claim
+ //to accept MM/DD/YYYY as inputs. advanced users may use inputs like "+1 day", which will be converted to
+ //MM/DD/YYYY based on "now" since otherwhise such an entry would lead to a never expiring expirationdate
+ if(trim($_POST['expirationdate'])!=""){
+ if(strtotime($_POST['expirationdate'])>0){
+ if(strtotime("-1 day")>strtotime(date("m/d/Y",strtotime($_POST['expirationdate'])))){
+ $input_errors[] = "selected expiration date lies in the past";
+ } else {
+ //convert from any strtotime compatible date to MM/DD/YYYY
+ $expdate = strtotime($_POST['expirationdate']);
+ $_POST['expirationdate'] = date("m/d/Y",$expdate);
+ }
+ } else {
+ $input_errors[] = "invalid expiration date format, use MM/DD/YYYY instead";
+ }
+ }
+ //check username: only allow letters from A-Z and a-z, _, -, . and numbers from 0-9 (note: username can
+ //not contain characters which are not allowed in an xml-token. i.e. if you'd use @ in a username, config.xml
+ //could not be parsed anymore!
+ if(!preg_match('/^[a-zA-Z0-9_\-\.]*$/',$_POST['username'])){
+ $input_errors[] = "username contains illegal characters, only letters from A-Z and a-z, _, -, . and numbers are allowed";
+ }
+
+ if(!empty($input_errors)){
+ //there are illegal inputs --> print out error message and show formular again (and fill in all recently entered values
+ //except passwords
+ $_GET['act']="new";
+ $_POST['old_username']=($_POST['old_username'] ? $_POST['old_username'] : $_POST['username']);
+ $_GET['username']=$_POST['old_username'];
+ foreach(Array("username","fullname","expirationdate") as $field){
+ $config['users'][$_POST['old_username']][$field]=$_POST[$field];
+ }
+ } else {
+ //all values are okay --> saving changes
+ $_POST['username']=trim($_POST['username']);
+ if($_POST['old_username']!="" && $_POST['old_username']!=$_POST['username']){
+ //change the username (which is used as array-index)
+ $config['users'][$_POST['username']]=$config['users'][$_POST['old_username']];
+ unset($config['users'][$_POST['old_username']]);
+ }
+ foreach(Array('fullname','expirationdate') as $field){
+ $config['users'][$_POST['username']][$field]=trim($_POST[$field]);
+ }
+ if(trim($_POST['password1'])!="********" && trim($_POST['password1'])!=""){
+ $config['users'][$_POST['username']]['password']=md5(trim($_POST['password1']));
+ }
+ write_config();
+ $savemsg=$_POST['username']." successfully saved<br>";
+ }
+} else if ($_GET['act']=="delete" && isset($_GET['username'])){
+ unset($config['users'][$_GET['username']]);
+ write_config();
+ $savemsg=$_GET['username']." successfully deleted<br>";
+}
+//erase expired accounts
+$changed=false;
+if(is_array($config['users'])){
+ foreach($config['users'] as $username => $user){
+ if(trim($user['expirationdate'])!="" && strtotime("-1 day")>strtotime($user['expirationdate']) && empty($input_errors)){
+ unset($config['users'][$username]);
+ $changed=true;
+ $savemsg.="$username has expired --> $username was deleted<br>";
+ }
+ }
+ if($changed){
+ write_config();
+ }
+}
+
+?>
+<?php include("fbegin.inc"); ?>
+<script language="javascript" type="text/javascript" src="datetimepicker.js">
+//Date Time Picker script- by TengYong Ng of http://www.rainforestnet.com
+//Script featured on JavaScript Kit (http://www.javascriptkit.com)
+//For this script, visit http://www.javascriptkit.com
+</script>
+<?php if ($input_errors) print_input_errors($input_errors); ?>
+<?php if ($savemsg) print_info_box($savemsg); ?>
+<table width="100%" border="0" cellpadding="0" cellspacing="0">
+ <tr><td>
+ <ul id="tabnav">
+ <li class="tabinact1"><a href="services_captiveportal.php">Captive portal</a></li>
+ <li class="tabinact"><a href="services_captiveportal_mac.php">Pass-through MAC</a></li>
+ <li class="tabinact"><a href="services_captiveportal_ip.php">Allowed IP addresses</a></li>
+ <li class="tabact">Users</li>
+ </ul>
+ </td></tr>
+ <tr>
+ <td class="tabcont">
+<?php
+if($_GET['act']=="new" || $_GET['act']=="edit"){
+ if($_GET['act']=="edit" && isset($_GET['username'])){
+ $user=$config['users'][$_GET['username']];
+ }
+?>
+ <form action="services_captiveportal_users.php" method="post" name="iform" id="iform">
+ <table width="100%" border="0" cellpadding="6" cellspacing="0">
+ <tr>
+ <td width="22%" valign="top" class="vncellreq">Username</td>
+ <td width="78%" class="vtable">
+ <input name="username" type="text" class="formfld" id="username" size="20" value="<?=$_GET['username'];?>">
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncellreq">Password</td>
+ <td width="78%" class="vtable">
+ <input name="password1" type="password" class="formfld" id="password1" size="20" value="<?php echo ($_GET['act']=='edit' ? "********" : "" ); ?>"> <br>
+ <input name="password2" type="password" class="formfld" id="password2" size="20" value="<?php echo ($_GET['act']=='edit' ? "********" : "" ); ?>">
+ (confirmation) </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell">Full name</td>
+ <td width="78%" class="vtable">
+ <input name="fullname" type="text" class="formfld" id="fullname" size="20" value="<?=htmlspecialchars($user['fullname']);?>">
+ <br>
+ User's full name, for your own information only</td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell">Expiration date</td>
+ <td width="78%" class="vtable">
+ <input name="expirationdate" type="text" class="formfld" id="expirationdate" size="10" value="<?=$user['expirationdate'];?>">
+ <a href="javascript:NewCal('expirationdate','mmddyyyy')"><img src="cal.gif" width="16" height="16" border="0" alt="Pick a date"></a>
+ <br>
+ <span class="vexpl">Leave blank if the account shouldn't expire, otherwise enter the expiration date in the following format: mm/dd/yyyy</span></td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top"> </td>
+ <td width="78%">
+ <input name="save" type="submit" class="formbtn" value="Save">
+ <input name="old_username" type="hidden" value="<?=$_GET['username'];?>">
+ </td>
+ </tr>
+ </table>
+ </form>
+<?php
+} else {
+?>
+ <table width="100%" border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td width="35%" class="listhdrr">Username</td>
+ <td width="20%" class="listhdrr">Full name</td>
+ <td width="35%" class="listhdr">Expires</td>
+ <td width="10%" class="list"></td>
+ </tr>
+<?php
+ if(is_array($config['users'])){
+ foreach($config['users'] as $username => $user){
+?>
+ <tr>
+ <td class="listlr">
+ <?=$username; ?>
+ </td>
+ <td class="listr">
+ <?=htmlspecialchars($user['fullname']);?>
+ </td>
+ <td class="listbg">
+ <?=$user['expirationdate']; ?>
+ </td>
+ <td valign="middle" nowrap class="list"> <a href="services_captiveportal_users.php?act=edit&username=<?=$username; ?>"><img src="e.gif" width="17" height="17" border="0"></a>
+ <a href="services_captiveportal_users.php?act=delete&username=<?=$username; ?>" onclick="return confirm('Do you really want to delete this User?')"><img src="x.gif" width="17" height="17" border="0"></a></td>
+ </tr>
+<?php
+ }
+ } ?>
+ <tr>
+ <td class="list" colspan="3"></td>
+ <td class="list"> <a href="services_captiveportal_users.php?act=new"><img src="plus.gif" width="17" height="17" border="0"></a></td>
+ </tr>
+ </table>
+<?php } ?>
+
+ </td>
+ </tr>
+ </table>
+<?php include("fend.inc"); ?>
services_dhcp.php
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("Services", "DHCP server");
require("guiconfig.inc");
$if = $_GET['if'];
if (($_POST['wins1'] && !is_ipaddr($_POST['wins1'])) || ($_POST['wins2'] && !is_ipaddr($_POST['wins2']))) {
$input_errors[] = "A valid IP address must be specified for the primary/secondary WINS server.";
}
- if ($_POST['deftime'] && (!is_numeric($_POST['deftime']) || ($_POST['deftime'] < 60))) {
- $input_errors[] = "The default lease time must be at least 60 seconds.";
+ if ($_POST['deftime'] && (!is_numericint($_POST['deftime']))) {
+ $input_errors[] = "The default lease time must be an integer.";
}
- if ($_POST['maxtime'] && (!is_numeric($_POST['maxtime']) || ($_POST['maxtime'] < 60) || ($_POST['maxtime'] <= $_POST['deftime']))) {
- $input_errors[] = "The maximum lease time must be at least 60 seconds and higher than the default lease time.";
+ if ($_POST['maxtime'] && (!is_numericint($_POST['maxtime']) || ($_POST['maxtime'] <= $_POST['deftime']))) {
+ $input_errors[] = "The maximum lease time must be higher than the default lease time.";
}
if (!$input_errors) {
}
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("Services: DHCP server");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
+<?php include("fbegin.inc"); ?>
<script language="JavaScript">
<!--
function enable_change(enable_over) {
}
//-->
</script>
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-<p class="pgtitle">Services: DHCP server</p>
<form action="services_dhcp.php" method="post" name="iform" id="iform">
<?php if ($input_errors) print_input_errors($input_errors); ?>
<?php if ($savemsg) print_info_box($savemsg); ?>
<input name="apply" type="submit" class="formbtn" id="apply" value="Apply changes"></p>
<?php endif; ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr><td>
+ <tr><td class="tabnavtbl">
<ul id="tabnav">
-<?php foreach ($iflist as $ifent => $ifname):
+<?php $i = 0; foreach ($iflist as $ifent => $ifname):
if ($ifent == $if): ?>
<li class="tabact"><?=htmlspecialchars($ifname);?></li>
<?php else: ?>
- <li class="tabinact"><a href="services_dhcp.php?if=<?=$ifent;?>"><?=htmlspecialchars($ifname);?></a></li>
+ <li class="<?php if ($i == 0) echo "tabinact1"; else echo "tabinact";?>"><a href="services_dhcp.php?if=<?=$ifent;?>"><?=htmlspecialchars($ifname);?></a></li>
<?php endif; ?>
-<?php endforeach; ?>
+<?php $i++; endforeach; ?>
</ul>
</td></tr>
<tr>
<tr>
<td width="22%" valign="top" class="vncellreq">Range</td>
<td width="78%" class="vtable">
- <input name="range_from" type="text" class="formfld" id="range_from" size="20" value="<?=htmlspecialchars($pconfig['range_from']);?>">
- to <input name="range_to" type="text" class="formfld" id="range_to" size="20" value="<?=htmlspecialchars($pconfig['range_to']);?>"></td>
+ <?=$mandfldhtml;?><input name="range_from" type="text" class="formfld" id="range_from" size="20" value="<?=htmlspecialchars($pconfig['range_from']);?>">
+ to <?=$mandfldhtmlspc;?><input name="range_to" type="text" class="formfld" id="range_to" size="20" value="<?=htmlspecialchars($pconfig['range_to']);?>"></td>
</tr>
<tr>
<td width="22%" valign="top" class="vncell">WINS servers</td>
</span></p></td>
</tr>
</table>
- <br>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="35%" class="listhdrr">MAC address </td>
//-->
</script>
<?php include("fend.inc"); ?>
-</body>
-</html>
services_dhcp_edit.php
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("Services", "DHCP server", "Edit static mapping");
require("guiconfig.inc");
$if = $_GET['if'];
$pconfig['mac'] = $a_maps[$id]['mac'];
$pconfig['ipaddr'] = $a_maps[$id]['ipaddr'];
$pconfig['descr'] = $a_maps[$id]['descr'];
+} else {
+ $pconfig['mac'] = $_GET['mac'];
}
if ($_POST) {
do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
+ $_POST['mac'] = str_replace("-", ":", $_POST['mac']);
+
if (($_POST['ipaddr'] && !is_ipaddr($_POST['ipaddr']))) {
$input_errors[] = "A valid IP address must be specified.";
}
}
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("Services: DHCP: Edit static mapping");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
-<p class="pgtitle">Services: DHCP: Edit static mapping</p>
<?php if ($input_errors) print_input_errors($input_errors); ?>
<form action="services_dhcp_edit.php" method="post" name="iform" id="iform">
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td width="22%" valign="top" class="vncellreq">MAC address</td>
<td width="78%" class="vtable">
- <input name="mac" type="text" class="formfld" id="mac" size="30" value="<?=htmlspecialchars($pconfig['mac']);?>">
+ <?=$mandfldhtml;?><input name="mac" type="text" class="formfld" id="mac" size="30" value="<?=htmlspecialchars($pconfig['mac']);?>">
<br>
<span class="vexpl">Enter a MAC address in the following format:
xx:xx:xx:xx:xx:xx</span></td>
</table>
</form>
<?php include("fend.inc"); ?>
-</body>
-</html>
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("Services", "DHCP relay");
+require("guiconfig.inc");
+
function get_wan_dhcp_server() {
global $config, $g;
$dhclientfn = $g['vardb_path'] . "/dhclient.leases";
return $dhcpserver[1];
}
-
-require("guiconfig.inc");
-
$if = $_GET['if'];
if ($_POST['if'])
$if = $_POST['if'];
/* make sure that the DHCP server isn't enabled on this interface */
if (isset($config['dhcpd'][$if]['enable']))
$input_errors[] = "You must disable the DHCP server on the {$iflist[$if]} interface before enabling the DHCP Relay.";
+
/* make sure that the DHCP server isn't running on any of the implied interfaces */
foreach ($config['interfaces'] as $ifname => $ifcfg) {
$subnet = $ifcfg['ipaddr'] . "/" . $ifcfg['subnet'];
}
if (!isset($destif))
$destif = "wan";
- if (isset($config['dhcpd'][$destif]['enable']))
+ if (isset($config['dhcpd'][$destif]['enable']) && !$input_errors)
$input_errors[] = "You must disable the DHCP server on the {$destif} interface before enabling the DHCP Relay.";
/* if proxydhcp is selected, make sure DHCP is enabled on WAN */
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("Services: DHCP relay");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
+<?php include("fbegin.inc"); ?>
<script language="JavaScript">
<!--
function enable_change(enable_over) {
}
//-->
</script>
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-<p class="pgtitle">Services: DHCP relay</p>
<form action="services_dhcp_relay.php" method="post" name="iform" id="iform">
<?php if ($input_errors) print_input_errors($input_errors); ?>
<?php if ($savemsg) print_info_box($savemsg); ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr><td>
+ <tr><td class="tabnavtbl">
<ul id="tabnav">
-<?php foreach ($iflist as $ifent => $ifname):
+<?php $i = 0; foreach ($iflist as $ifent => $ifname):
if ($ifent == $if): ?>
<li class="tabact"><?=htmlspecialchars($ifname);?></li>
<?php else: ?>
- <li class="tabinact"><a href="services_dhcp_relay.php?if=<?=$ifent;?>"><?=htmlspecialchars($ifname);?></a></li>
+ <li class="<?php if ($i == 0) echo "tabinact1"; else echo "tabinact";?>"><a href="services_dhcp_relay.php?if=<?=$ifent;?>"><?=htmlspecialchars($ifname);?></a></li>
<?php endif; ?>
-<?php endforeach; ?>
+<?php $i++; endforeach; ?>
</ul>
</td></tr>
<tr>
//-->
</script>
<?php include("fend.inc"); ?>
-</body>
-</html>
services_dnsmasq.php
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Bob Zoller <bob@kludgebox.com> and Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Bob Zoller <bob@kludgebox.com> and Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("Services", "DNS forwarder");
require("guiconfig.inc");
$pconfig['enable'] = isset($config['dnsmasq']['enable']);
}
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("Services: DNS forwarder");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
-<p class="pgtitle">Services: DNS forwarder</p>
<form action="services_dnsmasq.php" method="post">
<?php if ($savemsg) print_info_box($savemsg); ?>
<?php if (file_exists($d_hostsdirty_path)): ?><p>
<?php endif; ?>
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
- <td class="vtable"><p>
+ <td class="vtable">
<input name="enable" type="checkbox" id="enable" value="yes" <?php if ($pconfig['enable']) echo "checked";?>>
- <strong>Enable DNS forwarder<br>
- </strong></p></td>
+ <strong>Enable DNS forwarder</strong></td>
</tr>
<tr>
- <td class="vtable"><p>
+ <td class="vtable">
<input name="regdhcp" type="checkbox" id="regdhcp" value="yes" <?php if ($pconfig['regdhcp']) echo "checked";?>>
<strong>Register DHCP leases in DNS forwarder<br>
</strong>If this option is set, then machines that specify
their hostname when requesting a DHCP lease will be registered
in the DNS forwarder, so that their name can be resolved.
You should also set the domain in <a href="system.php">System:
- General setup</a> to the proper value.</p>
+ General setup</a> to the proper value.
</td>
</tr>
<tr>
forwarders below.</p></td>
</tr>
</table>
- <br>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="20%" class="listhdrr">Host</td>
</table>
</form>
<?php include("fend.inc"); ?>
-</body>
-</html>
services_dnsmasq_edit.php
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Bob Zoller <bob@kludgebox.com> and Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Bob Zoller <bob@kludgebox.com> and Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("Services", "DNS forwarder", "Edit host");
require("guiconfig.inc");
if (!is_array($config['dnsmasq']['hosts'])) {
}
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("Services: DNS forwarder: Edit host");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
-<p class="pgtitle">Services: DNS forwarder: Edit host</p>
<?php if ($input_errors) print_input_errors($input_errors); ?>
<form action="services_dnsmasq_edit.php" method="post" name="iform" id="iform">
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td width="22%" valign="top" class="vncellreq">Domain</td>
<td width="78%" class="vtable">
- <input name="domain" type="text" class="formfld" id="domain" size="40" value="<?=htmlspecialchars($pconfig['domain']);?>">
+ <?=$mandfldhtml;?><input name="domain" type="text" class="formfld" id="domain" size="40" value="<?=htmlspecialchars($pconfig['domain']);?>">
<br> <span class="vexpl">Domain of the host<br>
e.g. <em>blah.com</em></span></td>
</tr>
<tr>
<td width="22%" valign="top" class="vncellreq">IP address</td>
<td width="78%" class="vtable">
- <input name="ip" type="text" class="formfld" id="ip" size="40" value="<?=htmlspecialchars($pconfig['ip']);?>">
+ <?=$mandfldhtml;?><input name="ip" type="text" class="formfld" id="ip" size="40" value="<?=htmlspecialchars($pconfig['ip']);?>">
<br> <span class="vexpl">IP address of the host<br>
e.g. <em>192.168.100.100</em></span></td>
</tr>
</table>
</form>
<?php include("fend.inc"); ?>
-</body>
-</html>
services_dyndns.php
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("Services", "Dynamic DNS");
require("guiconfig.inc");
if (!is_array($config['dnsupdate'])) {
$pconfig['dnsupdate_ttl'] = 60;
$pconfig['dnsupdate_keydata'] = $config['dnsupdate']['keydata'];
$pconfig['dnsupdate_keyname'] = $config['dnsupdate']['keyname'];
-$pconfig['dnsupdate_keytype'] = $config['dnsupdate']['keytype'];
-if (!$pconfig['dnsupdate_keytype'])
- $pconfig['dnsupdate_keytype'] = "zone";
$pconfig['dnsupdate_usetcp'] = isset($config['dnsupdate']['usetcp']);
if ($_POST) {
$config['dnsupdate']['host'] = $_POST['dnsupdate_host'];
$config['dnsupdate']['ttl'] = $_POST['dnsupdate_ttl'];
$config['dnsupdate']['keyname'] = $_POST['dnsupdate_keyname'];
- $config['dnsupdate']['keytype'] = $_POST['dnsupdate_keytype'];
$config['dnsupdate']['keydata'] = $_POST['dnsupdate_keydata'];
$config['dnsupdate']['usetcp'] = $_POST['dnsupdate_usetcp'] ? true : false;
}
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("Services: Dynamic DNS client");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
+<?php include("fbegin.inc"); ?>
<script language="JavaScript">
<!--
function enable_change(enable_change) {
document.iform.dnsupdate_host.disabled = endis;
document.iform.dnsupdate_ttl.disabled = endis;
document.iform.dnsupdate_keyname.disabled = endis;
- document.iform.dnsupdate_keytype[0].disabled = endis;
- document.iform.dnsupdate_keytype[1].disabled = endis;
- document.iform.dnsupdate_keytype[2].disabled = endis;
document.iform.dnsupdate_keydata.disabled = endis;
document.iform.dnsupdate_usetcp.disabled = endis;
}
//-->
</script>
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-<p class="pgtitle">Services: Dynamic DNS client</p>
<?php if ($input_errors) print_input_errors($input_errors); ?>
<?php if ($savemsg) print_info_box($savemsg); ?>
<form action="services_dyndns.php" method="post" name="iform" id="iform">
<tr>
<td width="22%" valign="top" class="vncellreq">Service type</td>
<td width="78%" class="vtable">
-<select name="type" class="formfld" id="type">
+ <select name="type" class="formfld" id="type">
<?php $types = explode(",", "DynDNS,DHS,ODS,DyNS,HN.ORG,ZoneEdit,GNUDip,DynDNS (static),DynDNS (custom),easyDNS,EZ-IP,TZO");
$vals = explode(" ", "dyndns dhs ods dyns hn zoneedit gnudip dyndns-static dyndns-custom easydns ezip tzo");
$j = 0; for ($j = 0; $j < count($vals); $j++): ?>
<tr>
<td width="22%" valign="top" class="vncellreq">Hostname</td>
<td width="78%" class="vtable">
- <input name="host" type="text" class="formfld" id="host" size="30" value="<?=htmlspecialchars($pconfig['host']);?>">
+ <?=$mandfldhtml;?><input name="host" type="text" class="formfld" id="host" size="30" value="<?=htmlspecialchars($pconfig['host']);?>">
</td>
</tr>
<tr>
<tr>
<td width="22%" valign="top" class="vncellreq">Username</td>
<td width="78%" class="vtable">
- <input name="username" type="text" class="formfld" id="username" size="20" value="<?=htmlspecialchars($pconfig['username']);?>">
+ <?=$mandfldhtml;?><input name="username" type="text" class="formfld" id="username" size="20" value="<?=htmlspecialchars($pconfig['username']);?>">
</td>
</tr>
<tr>
<td width="22%" valign="top" class="vncellreq">Password</td>
<td width="78%" class="vtable">
- <input name="password" type="password" class="formfld" id="password" size="20" value="<?=htmlspecialchars($pconfig['password']);?>">
+ <?=$mandfldhtml;?><input name="password" type="password" class="formfld" id="password" size="20" value="<?=htmlspecialchars($pconfig['password']);?>">
</td>
</tr>
<tr>
<tr>
<td colspan="2" valign="top" class="optsect_t">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
- <tr><td class="optsect_s"><strong>RFC 2163 Dynamic DNS updates</strong></td>
- <td align="right" class="optsect_s"><input name="dnsupdate_enable" type="checkbox" value="yes" <?php if ($pconfig['dnsupdate_enable']) echo "checked"; ?> onClick="enable_change(false)"> <strong>Enable</strong></td></tr>
+ <tr>
+ <td class="optsect_s"><strong>RFC 2136 Dynamic DNS updates</strong></td>
+ <td align="right" class="optsect_s"><input name="dnsupdate_enable" type="checkbox" value="yes" <?php if ($pconfig['dnsupdate_enable']) echo "checked"; ?> onClick="enable_change(false)"> <strong>Enable</strong></td></tr>
</table></td>
</tr>
<tr>
<td width="22%" valign="top" class="vncellreq">Hostname</td>
<td width="78%" class="vtable">
- <input name="dnsupdate_host" type="text" class="formfld" id="dnsupdate_host" size="30" value="<?=htmlspecialchars($pconfig['dnsupdate_host']);?>">
+ <?=$mandfldhtml;?><input name="dnsupdate_host" type="text" class="formfld" id="dnsupdate_host" size="30" value="<?=htmlspecialchars($pconfig['dnsupdate_host']);?>">
</td>
</tr>
<tr>
<td valign="top" class="vncellreq">TTL</td>
<td class="vtable">
- <input name="dnsupdate_ttl" type="text" class="formfld" id="dnsupdate_ttl" size="6" value="<?=htmlspecialchars($pconfig['dnsupdate_ttl']);?>">
+ <?=$mandfldhtml;?><input name="dnsupdate_ttl" type="text" class="formfld" id="dnsupdate_ttl" size="6" value="<?=htmlspecialchars($pconfig['dnsupdate_ttl']);?>">
seconds</td>
</tr>
<tr>
<td valign="top" class="vncellreq">Key name</td>
<td class="vtable">
- <input name="dnsupdate_keyname" type="text" class="formfld" id="dnsupdate_keyname" size="30" value="<?=htmlspecialchars($pconfig['dnsupdate_keyname']);?>">
+ <?=$mandfldhtml;?><input name="dnsupdate_keyname" type="text" class="formfld" id="dnsupdate_keyname" size="30" value="<?=htmlspecialchars($pconfig['dnsupdate_keyname']);?>">
<br>
This must match the setting on the DNS server.</td>
</tr>
- <tr>
- <td valign="top" class="vncellreq">Key type </td>
- <td class="vtable">
- <input name="dnsupdate_keytype" type="radio" value="zone" <?php if ($pconfig['dnsupdate_keytype'] == "zone") echo "checked"; ?>> Zone
- <input name="dnsupdate_keytype" type="radio" value="host" <?php if ($pconfig['dnsupdate_keytype'] == "host") echo "checked"; ?>> Host
- <input name="dnsupdate_keytype" type="radio" value="user" <?php if ($pconfig['dnsupdate_keytype'] == "user") echo "checked"; ?>> User
- </tr>
<tr>
<td valign="top" class="vncellreq">Key</td>
<td class="vtable">
- <input name="dnsupdate_keydata" type="text" class="formfld" id="dnsupdate_keydata" size="70" value="<?=htmlspecialchars($pconfig['dnsupdate_keydata']);?>">
+ <?=$mandfldhtml;?><input name="dnsupdate_keydata" type="text" class="formfld" id="dnsupdate_keydata" size="70" value="<?=htmlspecialchars($pconfig['dnsupdate_keydata']);?>">
<br>
Paste an HMAC-MD5 key here.</td>
</tr>
//-->
</script>
<?php include("fend.inc"); ?>
-</body>
-</html>
services_proxyarp.php
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("Services", "Proxy ARP");
require("guiconfig.inc");
if (!is_array($config['proxyarp']['proxyarpnet'])) {
}
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("Services: Proxy ARP");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
-<p class="pgtitle">Services: Proxy ARP</p>
<form action="services_proxyarp.php" method="post">
<?php if ($savemsg) print_info_box($savemsg); ?>
<?php if (file_exists($d_proxyarpdirty_path)): ?><p>
replies on an interface for other IP addresses than its own (e.g. for 1:1, advanced outbound or server NAT). It is not
necessary on the WAN interface if you have a subnet routed to you or if you use PPPoE/PPTP, and it only works on the WAN interface if it's configured with a static IP address or DHCP.</p>
<?php include("fend.inc"); ?>
-</body>
-</html>
services_proxyarp_edit.php
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("Services", "Proxy ARP", "Edit");
require("guiconfig.inc");
if (!is_array($config['proxyarp']['proxyarpnet'])) {
}
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("Services: Proxy ARP: Edit");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
+<?php include("fbegin.inc"); ?>
<script language="JavaScript">
<!--
function typesel_change() {
}
//-->
</script>
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-<p class="pgtitle">Services: Proxy ARP: Edit</p>
<?php if ($input_errors) print_input_errors($input_errors); ?>
<form action="services_proxyarp_edit.php" method="post" name="iform" id="iform">
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>Type: </td>
+ <td></td>
<td><select name="type" class="formfld" onChange="typesel_change()">
<option value="single" <?php if (!$pconfig['range_from'] && $pconfig['subnet_bits'] == 32) echo "selected"; ?>>
Single address</option>
</tr>
<tr>
<td>Address: </td>
+ <td><?=$mandfldhtmlspc;?></td>
<td><input name="subnet" type="text" class="formfld" id="subnet" size="20" value="<?=htmlspecialchars($pconfig['subnet']);?>">
/
<select name="subnet_bits" class="formfld" id="select">
</tr>
<tr>
<td>Range: </td>
+ <td><?=$mandfldhtmlspc;?></td>
<td><input name="range_from" type="text" class="formfld" id="range_from" size="20" value="<?=htmlspecialchars($pconfig['range_from']);?>">
-
<input name="range_to" type="text" class="formfld" id="range_to" size="20" value="<?=htmlspecialchars($pconfig['range_to']);?>">
//-->
</script>
<?php include("fend.inc"); ?>
-</body>
-</html>
services_snmp.php
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("Services", "SNMP");
require("guiconfig.inc");
if (!is_array($config['snmpd'])) {
}
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("Services: SNMP");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
+<?php include("fbegin.inc"); ?>
<script language="JavaScript">
<!--
function enable_change(enable_change) {
}
//-->
</script>
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-<p class="pgtitle">Services: SNMP</p>
<?php if ($input_errors) print_input_errors($input_errors); ?>
<?php if ($savemsg) print_info_box($savemsg); ?>
<form action="services_snmp.php" method="post" name="iform" id="iform">
<tr>
<td width="22%" valign="top" class="vncellreq">Community</td>
<td width="78%" class="vtable">
- <input name="rocommunity" type="text" class="formfld" id="rocommunity" size="40" value="<?=htmlspecialchars($pconfig['rocommunity']);?>">
+ <?=$mandfldhtml;?><input name="rocommunity" type="text" class="formfld" id="rocommunity" size="40" value="<?=htmlspecialchars($pconfig['rocommunity']);?>">
<br>
In most cases, "public" is used here</td>
</tr>
//-->
</script>
<?php include("fend.inc"); ?>
-</body>
-</html>
services_wol.php
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("Services", "Wake on LAN");
require("guiconfig.inc");
if (!is_array($config['wol']['wolentry'])) {
$mac = $_POST['mac_input'];
$if = $_POST['interface'];
}
+
+ $mac = str_replace("-", ":", $mac);
/* input validation */
if (!$mac || !is_macaddr($mac))
}
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("Services: Wake on LAN");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
-<p class="pgtitle">Services: Wake on LAN</font></p>
<?php if ($input_errors) print_input_errors($input_errors); ?>
<?php if ($savemsg) print_info_box($savemsg); ?>
<form action="services_wol.php" method="post" name="iform" id="iform">
<tr>
<td width="22%" valign="top" class="vncellreq">Interface</td>
<td width="78%" class="vtable">
-<select name="interface" class="formfld">
+ <select name="interface" class="formfld">
<?php $interfaces = array('lan' => 'LAN');
for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++) {
if (isset($config['interfaces']['opt' . $i]['enable']) &&
<tr>
<td width="22%" valign="top" class="vncellreq">MAC address</td>
<td width="78%" class="vtable">
- <input name="mac_input" type="text" class="formfld" id="mac_input" size="20" value="<?=htmlspecialchars($mac);?>">
+ <?=$mandfldhtml;?><input name="mac_input" type="text" class="formfld" id="mac_input" size="20" value="<?=htmlspecialchars($mac);?>">
<br>
Enter a MAC address <span class="vexpl"> in the following format: xx:xx:xx:xx:xx:xx</span></td></tr>
<tr>
</table>
</form>
<?php include("fend.inc"); ?>
-</body>
-</html>
services_wol_edit.php
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("Services", "Wake on LAN", "Edit");
require("guiconfig.inc");
if (!is_array($config['wol']['wolentry'])) {
do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
+ $_POST['mac'] = str_replace("-", ":", $_POST['mac']);
+
if (($_POST['mac'] && !is_macaddr($_POST['mac']))) {
$input_errors[] = "A valid MAC address must be specified.";
}
}
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("Services: Wake on LAN: Edit entry");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
-<p class="pgtitle">Services: Wake on LAN: Edit entry</p>
<?php if ($input_errors) print_input_errors($input_errors); ?>
<form action="services_wol_edit.php" method="post" name="iform" id="iform">
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td width="22%" valign="top" class="vncellreq">Interface</td>
<td width="78%" class="vtable">
-<select name="interface" class="formfld">
+ <select name="interface" class="formfld">
<?php $interfaces = array('lan' => 'LAN');
for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++) {
if (isset($config['interfaces']['opt' . $i]['enable']) &&
<tr>
<td width="22%" valign="top" class="vncellreq">MAC address</td>
<td width="78%" class="vtable">
- <input name="mac" type="text" class="formfld" id="mac" size="20" value="<?=htmlspecialchars($pconfig['mac']);?>">
+ <?=$mandfldhtml;?><input name="mac" type="text" class="formfld" id="mac" size="20" value="<?=htmlspecialchars($pconfig['mac']);?>">
<br>
<span class="vexpl">Enter a MAC address in the following format:
xx:xx:xx:xx:xx:xx<em></em></span></td>
</table>
</form>
<?php include("fend.inc"); ?>
-</body>
-</html>
status_captiveportal.php
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("Status", "Captive portal");
require("guiconfig.inc");
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("Status: Captive portal");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
-<p class="pgtitle">Status: Captive portal</p>
<?php
if ($_GET['act'] == "del") {
</form>
</p>
<?php include("fend.inc"); ?>
-</body>
-</html>
status_graph.php
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("Status", "Traffic graph");
require("guiconfig.inc");
$curif = "wan";
else
$ifnum = $config['interfaces'][$curif]['if'];
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("Status: Traffic graph");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
-<p class="pgtitle">Status: Traffic graph</p>
<?php
$ifdescrs = array('wan' => 'WAN', 'lan' => 'LAN');
<embed src="graph.php?ifnum=<?=$ifnum;?>&ifname=<?=rawurlencode($ifdescrs[$curif]);?>" type="image/svg+xml"
width="550" height="275" pluginspage="http://www.adobe.com/svg/viewer/install/auto" />
</div>
-<p><span class="red"><strong>Note:</strong></span> the <a href="http://www.adobe.com/svg/viewer/install/" target="_blank">Adobe SVG viewer</a> is required to view the graph.
+<br><span class="red"><strong>Note:</strong></span> the <a href="http://www.adobe.com/svg/viewer/install/" target="_blank">Adobe SVG viewer</a> is required to view the graph.
<?php include("fend.inc"); ?>
-</body>
-</html>
--- /dev/null
+#!/usr/local/bin/php
+<?php
+/*
+ status_graph_cpu.php
+ part of m0n0wall (http://m0n0.ch/wall)
+
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+*/
+
+$pgtitle = array("Status", "CPU load");
+require("guiconfig.inc");
+?>
+<?php include("fbegin.inc"); ?>
+<div align="center">
+<embed src="graph_cpu.php" type="image/svg+xml"
+ width="550" height="275" pluginspage="http://www.adobe.com/svg/viewer/install/auto" />
+</div>
+<br><span class="red"><strong>Note:</strong></span> the <a href="http://www.adobe.com/svg/viewer/install/" target="_blank">Adobe SVG viewer</a> is required to view the graph.
+<?php include("fend.inc"); ?>
status_interfaces.php
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("Status", "Interfaces");
require("guiconfig.inc");
$wancfg = &$config['interfaces']['wan'];
if (preg_match("/channel (\S*)/", $ici, $matches)) {
$ifinfo['channel'] = $matches[1];
}
- if (preg_match("/ssid (\S*)/", $ici, $matches)) {
- $ifinfo['ssid'] = $matches[1];
+ if (preg_match("/ssid (\".*?\"|\S*)/", $ici, $matches)) {
+ if ($matches[1][0] == '"')
+ $ifinfo['ssid'] = substr($matches[1], 1, -1);
+ else
+ $ifinfo['ssid'] = $matches[1];
}
}
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("Status: Interfaces");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
-<p class="pgtitle">Status: Interfaces</p>
<form action="" method="post">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<?php $i = 0; $ifdescrs = array('wan' => 'WAN', 'lan' => 'LAN');
interface</td>
</tr>
<tr>
- <td width="22%" class="listhdrr">Status</td>
+ <td width="22%" class="vncellt">Status</td>
<td width="78%" class="listr">
<?=htmlspecialchars($ifinfo['status']);?>
</td>
</tr><?php if ($ifinfo['dhcplink']): ?>
<tr>
- <td width="22%" class="listhdrr">DHCP</td>
+ <td width="22%" class="vncellt">DHCP</td>
<td width="78%" class="listr">
<?=htmlspecialchars($ifinfo['dhcplink']);?>
<?php if ($ifinfo['dhcplink'] == "up"): ?>
</td>
</tr><?php endif; if ($ifinfo['pppoelink']): ?>
<tr>
- <td width="22%" class="listhdrr">PPPoE</td>
+ <td width="22%" class="vncellt">PPPoE</td>
<td width="78%" class="listr">
<?=htmlspecialchars($ifinfo['pppoelink']);?>
<?php if ($ifinfo['pppoelink'] == "up"): ?>
</td>
</tr><?php endif; if ($ifinfo['pptplink']): ?>
<tr>
- <td width="22%" class="listhdrr">PPTP</td>
+ <td width="22%" class="vncellt">PPTP</td>
<td width="78%" class="listr">
<?=htmlspecialchars($ifinfo['pptplink']);?>
<?php if ($ifinfo['pptplink'] == "up"): ?>
</td>
</tr><?php endif; if ($ifinfo['macaddr']): ?>
<tr>
- <td width="22%" class="listhdrr">MAC address</td>
+ <td width="22%" class="vncellt">MAC address</td>
<td width="78%" class="listr">
<?=htmlspecialchars($ifinfo['macaddr']);?>
</td>
<?php if ($ifinfo['dhcplink'] != "down" && $ifinfo['pppoelink'] != "down" && $ifinfo['pptplink'] != "down"): ?>
<?php if ($ifinfo['ipaddr']): ?>
<tr>
- <td width="22%" class="listhdrr">IP address</td>
+ <td width="22%" class="vncellt">IP address</td>
<td width="78%" class="listr">
<?=htmlspecialchars($ifinfo['ipaddr']);?>
</td>
</tr><?php endif; ?><?php if ($ifinfo['subnet']): ?>
<tr>
- <td width="22%" class="listhdrr">Subnet mask</td>
+ <td width="22%" class="vncellt">Subnet mask</td>
<td width="78%" class="listr">
<?=htmlspecialchars($ifinfo['subnet']);?>
</td>
</tr><?php endif; ?><?php if ($ifinfo['gateway']): ?>
<tr>
- <td width="22%" class="listhdrr">Gateway</td>
+ <td width="22%" class="vncellt">Gateway</td>
<td width="78%" class="listr">
<?=htmlspecialchars($ifinfo['gateway']);?>
</td>
</tr><?php endif; if ($ifdescr == "wan" && file_exists("{$g['varetc_path']}/nameservers.conf")): ?>
- <td width="22%" class="listhdrr">ISP DNS servers</td>
+ <td width="22%" class="vncellt">ISP DNS servers</td>
<td width="78%" class="listr"><?php echo nl2br(file_get_contents("{$g['varetc_path']}/nameservers.conf")); ?></td>
<?php endif; endif; if ($ifinfo['media']): ?>
<tr>
- <td width="22%" class="listhdrr">Media</td>
+ <td width="22%" class="vncellt">Media</td>
<td width="78%" class="listr">
<?=htmlspecialchars($ifinfo['media']);?>
</td>
</tr><?php endif; ?><?php if ($ifinfo['channel']): ?>
<tr>
- <td width="22%" class="listhdrr">Channel</td>
+ <td width="22%" class="vncellt">Channel</td>
<td width="78%" class="listr">
<?=htmlspecialchars($ifinfo['channel']);?>
</td>
</tr><?php endif; ?><?php if ($ifinfo['ssid']): ?>
<tr>
- <td width="22%" class="listhdrr">SSID</td>
+ <td width="22%" class="vncellt">SSID</td>
<td width="78%" class="listr">
<?=htmlspecialchars($ifinfo['ssid']);?>
</td>
</tr><?php endif; ?>
<tr>
- <td width="22%" class="listhdrr">In/out packets</td>
+ <td width="22%" class="vncellt">In/out packets</td>
<td width="78%" class="listr">
<?=htmlspecialchars($ifinfo['inpkts'] . "/" . $ifinfo['outpkts'] . " (" .
format_bytes($ifinfo['inbytes']) . "/" . format_bytes($ifinfo['outbytes']) . ")");?>
</td>
</tr><?php if (isset($ifinfo['inerrs'])): ?>
<tr>
- <td width="22%" class="listhdrr">In/out errors</td>
+ <td width="22%" class="vncellt">In/out errors</td>
<td width="78%" class="listr">
<?=htmlspecialchars($ifinfo['inerrs'] . "/" . $ifinfo['outerrs']);?>
</td>
</tr><?php endif; ?><?php if (isset($ifinfo['collisions'])): ?>
<tr>
- <td width="22%" class="listhdrr">Collisions</td>
+ <td width="22%" class="vncellt">Collisions</td>
<td width="78%" class="listr">
<?=htmlspecialchars($ifinfo['collisions']);?>
</td>
<?php $i++; endforeach; ?>
</table>
</form>
-<p><strong class="red">Note:<br>
+<br>
+<strong class="red">Note:<br>
</strong>Using dial-on-demand will bring the connection up again if any packet
triggers it. To substantiate this point: disconnecting manually
will <strong>not</strong> prevent dial-on-demand from making connections
to the outside! Don't use dial-on-demand if you want to make sure that the line is kept disconnected.
<?php include("fend.inc"); ?>
-</body>
-</html>
status_wireless.php
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("Status", "Wireless");
require("guiconfig.inc");
function get_wireless_info($ifdescr) {
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("Status: Wireless");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
- <p class="pgtitle">Status: Wireless</p>
- <?php $i = 0; $ifdescrs = array();
-
- if (is_array($config['interfaces']['wan']['wireless']) &&
- strstr($config['interfaces']['wan']['if'], "wi"))
- $ifdescrs['wan'] = 'WAN';
-
- if (is_array($config['interfaces']['lan']['wireless']) &&
- strstr($config['interfaces']['lan']['if'], "wi"))
- $ifdescrs['lan'] = 'LAN';
-
- for ($j = 1; isset($config['interfaces']['opt' . $j]); $j++) {
- if (is_array($config['interfaces']['opt' . $j]['wireless']) &&
- isset($config['interfaces']['opt' . $j]['enable']) &&
- strstr($config['interfaces']['opt' . $j]['if'], "wi"))
- $ifdescrs['opt' . $j] = $config['interfaces']['opt' . $j]['descr'];
- }
-
- if (count($ifdescrs) > 0): ?>
+<?php $i = 0; $ifdescrs = array();
+
+ if (is_array($config['interfaces']['wan']['wireless']) &&
+ (strstr($config['interfaces']['wan']['if'], "wi") || strstr($config['interfaces']['wan']['if'], "ath")))
+ $ifdescrs['wan'] = 'WAN';
+
+ if (is_array($config['interfaces']['lan']['wireless']) &&
+ (strstr($config['interfaces']['lan']['if'], "wi") || strstr($config['interfaces']['lan']['if'], "ath")))
+ $ifdescrs['lan'] = 'LAN';
+
+ for ($j = 1; isset($config['interfaces']['opt' . $j]); $j++) {
+ if (is_array($config['interfaces']['opt' . $j]['wireless']) &&
+ isset($config['interfaces']['opt' . $j]['enable']) &&
+ (strstr($config['interfaces']['opt' . $j]['if'], "wi") || strstr($config['interfaces']['opt' . $j]['if'], "ath")))
+ $ifdescrs['opt' . $j] = $config['interfaces']['opt' . $j]['descr'];
+ }
+
+ if (count($ifdescrs) > 0): ?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<?php
foreach ($ifdescrs as $ifdescr => $ifname):
<?=htmlspecialchars($ifname);?> interface (SSID "<?=htmlspecialchars($config['interfaces'][$ifdescr]['wireless']['ssid']);?>")</td>
</tr>
<tr>
- <td width="22%" valign="top" class="listhdrr">Signal strength
+ <td width="22%" valign="top" class="vncellt">Signal strength
cache</td>
<td width="78%" class="listrpad">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
</table></td>
</tr><?php if ($ifinfo['aslist']): ?>
<tr>
- <td width="22%" valign="top" class="listhdrr">Associated stations
+ <td width="22%" valign="top" class="vncellt">Associated stations
</td>
<td width="78%" class="listrpad">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<?php $i++; endforeach; ?>
</table>
<?php else: ?>
-<p><strong>No supported wireless interfaces were found for status display.</strong></p>
+<strong>No supported wireless interfaces were found for status display (only cards that use the wi[n] driver are supported).</strong>
<?php endif; ?>
<?php include("fend.inc"); ?>
-</body>
-</html>
system.php
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("System", "General setup");
require("guiconfig.inc");
$pconfig['hostname'] = $config['system']['hostname'];
}
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("System: General setup");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
- <p class="pgtitle">System: General setup</p>
<?php if ($input_errors) print_input_errors($input_errors); ?>
<?php if ($savemsg) print_info_box($savemsg); ?>
-<form action="system.php" method="post">
+ <form action="system.php" method="post">
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td width="22%" valign="top" class="vncellreq">Hostname</td>
- <td width="78%" class="vtable"> <input name="hostname" type="text" class="formfld" id="hostname" size="40" value="<?=htmlspecialchars($pconfig['hostname']);?>">
+ <td width="78%" class="vtable"><?=$mandfldhtml;?><input name="hostname" type="text" class="formfld" id="hostname" size="40" value="<?=htmlspecialchars($pconfig['hostname']);?>">
<br> <span class="vexpl">name of the firewall host, without
domain part<br>
e.g. <em>firewall</em></span></td>
</tr>
<tr>
<td width="22%" valign="top" class="vncellreq">Domain</td>
- <td width="78%" class="vtable"> <input name="domain" type="text" class="formfld" id="domain" size="40" value="<?=htmlspecialchars($pconfig['domain']);?>">
+ <td width="78%" class="vtable"><?=$mandfldhtml;?><input name="domain" type="text" class="formfld" id="domain" size="40" value="<?=htmlspecialchars($pconfig['domain']);?>">
<br> <span class="vexpl">e.g. <em>mycorp.com</em> </span></td>
</tr>
<tr>
<td width="22%" valign="top" class="vncell">DNS servers</td>
- <td width="78%" class="vtable"> <p>
+ <td width="78%" class="vtable">
<input name="dns1" type="text" class="formfld" id="dns1" size="20" value="<?=htmlspecialchars($pconfig['dns1']);?>">
<br>
<input name="dns2" type="text" class="formfld" id="dns22" size="20" value="<?=htmlspecialchars($pconfig['dns2']);?>">
If this option is set, m0n0wall will use DNS servers assigned
by a DHCP/PPP server on WAN for its own purposes (including
the DNS forwarder). They will not be assigned to DHCP and
- PPTP VPN clients, though.</span></p></td>
+ PPTP VPN clients, though.</span></td>
</tr>
<tr>
<td valign="top" class="vncell">Username</td>
</table>
</form>
<?php include("fend.inc"); ?>
-</body>
-</html>
system_advanced.php
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("System", "Advanced setup");
require("guiconfig.inc");
$pconfig['filteringbridge_enable'] = isset($config['bridge']['filteringbridge']);
$pconfig['expanddiags'] = isset($config['system']['webgui']['expanddiags']);
if ($g['platform'] == "generic-pc")
$pconfig['harddiskstandby'] = $config['system']['harddiskstandby'];
+$pconfig['bypassstaticroutes'] = isset($config['filter']['bypassstaticroutes']);
$pconfig['noantilockout'] = isset($config['system']['webgui']['noantilockout']);
$pconfig['tcpidletimeout'] = $config['filter']['tcpidletimeout'];
+$pconfig['preferoldsa_enable'] = isset($config['ipsec']['preferoldsa']);
if ($_POST) {
$config['system']['harddiskstandby'] = $_POST['harddiskstandby'];
}
$config['system']['webgui']['noantilockout'] = $_POST['noantilockout'] ? true : false;
+ $config['filter']['bypassstaticroutes'] = $_POST['bypassstaticroutes'] ? true : false;
$config['filter']['tcpidletimeout'] = $_POST['tcpidletimeout'];
+ $oldpreferoldsa = $config['ipsec']['preferoldsa'];
+ $config['ipsec']['preferoldsa'] = $_POST['preferoldsa_enable'] ? true : false;
write_config();
config_lock();
$retval = filter_configure();
$retval |= interfaces_optional_configure();
+ if ($config['ipsec']['preferoldsa'] != $oldpreferoldsa)
+ $retval |= vpn_ipsec_configure();
config_unlock();
}
$savemsg = get_std_save_message($retval);
}
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("System: Advanced functions");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
+<?php include("fbegin.inc"); ?>
<script language="JavaScript">
<!--
function enable_change(enable_over) {
}
// -->
</script>
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
- <p class="pgtitle">System: Advanced functions</p>
<?php if ($input_errors) print_input_errors($input_errors); ?>
<?php if ($savemsg) print_info_box($savemsg); ?>
<p><span class="vexpl"><span class="red"><strong>Note: </strong></span>the
<td width="22%" valign="top" class="vncell">Hard disk standby time </td>
<td width="78%" class="vtable">
<select name="harddiskstandby" class="formfld">
- <?php
- /* Values from ATA-2
- http://www.t13.org/project/d0948r3-ATA-2.pdf
- Page 66 */
- $sbvals = explode(" ", "0.5,6 1,12 2,24 3,36 4,48 5,60 7.5,90 10,120 15,180 20,240 30,241 60,242");
- ?>
+ <?php $sbvals = array(1,2,3,4,5,10,15,20,30,60); ?>
<option value="" <?php if(!$pconfig['harddiskstandby']) echo('selected');?>>Always on</option>
- <?php
- foreach ($sbvals as $sbval):
- list($min,$val) = explode(",", $sbval); ?>
- <option value="<?=$val;?>" <?php if($pconfig['harddiskstandby'] == $val) echo('selected');?>><?=$min;?> minutes</option>
+ <?php foreach ($sbvals as $sbval): ?>
+ <option value="<?=$sbval;?>" <?php if($pconfig['harddiskstandby'] == $sbval) echo 'selected';?>><?=$sbval;?> minutes</option>
<?php endforeach; ?>
</select>
<br>
<td width="78%" class="vtable">
<input name="expanddiags" type="checkbox" id="expanddiags" value="yes" <?php if ($pconfig['expanddiags']) echo "checked"; ?>>
<strong>Keep diagnostics in navigation expanded </strong></td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell">Static route filtering</td>
+ <td width="78%" class="vtable">
+ <input name="bypassstaticroutes" type="checkbox" id="bypassstaticroutes" value="yes" <?php if ($pconfig['bypassstaticroutes']) echo "checked"; ?>>
+ <strong>Bypass firewall rules for traffic on the same interface</strong><br>
+ This option only applies if you have defined one or more static routes. If it is enabled, traffic that enters and leaves through the same interface will not be checked by the firewall. This may be desirable in some situations where multiple subnets are connected to the same interface. </td>
</tr>
<tr>
<td width="22%" valign="top" class="vncell">webGUI anti-lockout</td>
By default, access to the webGUI on the LAN interface is always permitted, regardless of the user-defined filter rule set. Enable this feature to control webGUI access (make sure to have a filter rule in place that allows you in, or you will lock yourself out!).<br>
Hint:
the "set LAN IP address" option in the console menu resets this setting as well.</td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell">IPsec SA preferral</td>
+ <td width="78%" class="vtable">
+ <input name="preferoldsa_enable" type="checkbox" id="preferoldsa_enable" value="yes" <?php if ($pconfig['preferoldsa_enable']) echo "checked"; ?>>
+ <strong>Prefer old IPsec SAs</strong><br>
+ By default, if several SAs match, the newest one is preferred if it's at least 30 seconds old.
+ Select this option to always prefer old SAs over new ones.
+ </td>
</tr>
<tr>
<td width="22%" valign="top"> </td>
//-->
</script>
<?php include("fend.inc"); ?>
-</body>
-</html>
system_firmware.php
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
POSSIBILITY OF SUCH DAMAGE.
*/
-$d_isfwfile = 1; require("guiconfig.inc");
+$d_isfwfile = 1;
+$pgtitle = array("System", "Firmware");
+require("guiconfig.inc");
/* checks with m0n0.ch to see if a newer firmware version is available;
returns any HTML message it gets from the server */
function check_firmware_version() {
global $g;
- $post = "platform=" . rawurlencode($g['platform']) .
+ $post = "platform=" . rawurlencode($g['fullplatform']) .
"&version=" . rawurlencode(trim(file_get_contents("/etc/version")));
$rfd = @fsockopen("m0n0.ch", 80, $errno, $errstr, 3);
} else if ($mode == "upgrade") {
if (is_uploaded_file($_FILES['ulfile']['tmp_name'])) {
/* verify firmware image(s) */
- if (!stristr($_FILES['ulfile']['name'], $g['platform']) && !$_POST['sig_override'])
- $input_errors[] = "The uploaded image file is not for this platfom ({$g['platform']}).";
+ if (!stristr($_FILES['ulfile']['name'], $g['fullplatform']) && !$_POST['sig_override'])
+ $input_errors[] = "The uploaded image file is not for this platform ({$g['fullplatform']}).";
else if (!file_exists($_FILES['ulfile']['tmp_name'])) {
/* probably out of memory for the MFS */
$input_errors[] = "Image upload failed (out of memory?)";
$fwinfo = check_firmware_version();
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("System: Firmware");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
-<p class="pgtitle">System: Firmware</p>
<?php if ($input_errors) print_input_errors($input_errors); ?>
<?php if ($savemsg) print_info_box($savemsg); ?>
<?php if ($fwinfo) echo $fwinfo; ?>
<?php else: ?>
<?php if (!file_exists($d_firmwarelock_path)): ?>
<p>Click "Enable firmware
- upload" below, then choose the image file (<?=$g['platform'];?>-*.img)
+ upload" below, then choose the image file (<?=$g['fullplatform'];?>-*.img)
to be uploaded.<br>Click "Upgrade firmware"
to start the upgrade process.</p>
<form action="system_firmware.php" method="post" enctype="multipart/form-data">
</form>
<?php endif; endif; ?>
<?php include("fend.inc"); ?>
-</body>
-</html>
system_routes.php
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("System", "Static routes");
require("guiconfig.inc");
if (!is_array($config['staticroutes']['route']))
}
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("System: Static routes");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
-<p class="pgtitle">System: Static routes</p>
<form action="system_routes.php" method="post">
<?php if ($savemsg) print_info_box($savemsg); ?>
<?php if (file_exists($d_staticroutesdirty_path)): ?><p>
</table>
</form>
<?php include("fend.inc"); ?>
-</body>
-</html>
system_routes_edit.php
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("System", "Static routes", "Edit");
require("guiconfig.inc");
if (!is_array($config['staticroutes']['route']))
}
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("System: Static routes: Edit route");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
-<p class="pgtitle">System: Static routes: Edit route</p>
<?php if ($input_errors) print_input_errors($input_errors); ?>
<form action="system_routes_edit.php" method="post" name="iform" id="iform">
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td width="22%" valign="top" class="vncellreq">Interface</td>
<td width="78%" class="vtable">
-<select name="interface" class="formfld">
+ <select name="interface" class="formfld">
<?php $interfaces = array('lan' => 'LAN', 'wan' => 'WAN', 'pptp' => 'PPTP');
for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++) {
$interfaces['opt' . $i] = $config['interfaces']['opt' . $i]['descr'];
<tr>
<td width="22%" valign="top" class="vncellreq">Destination network</td>
<td width="78%" class="vtable">
- <input name="network" type="text" class="formfld" id="network" size="20" value="<?=htmlspecialchars($pconfig['network']);?>">
+ <?=$mandfldhtml;?><input name="network" type="text" class="formfld" id="network" size="20" value="<?=htmlspecialchars($pconfig['network']);?>">
/
<select name="network_subnet" class="formfld" id="network_subnet">
<?php for ($i = 32; $i >= 1; $i--): ?>
<tr>
<td width="22%" valign="top" class="vncellreq">Gateway</td>
<td width="78%" class="vtable">
- <input name="gateway" type="text" class="formfld" id="gateway" size="40" value="<?=htmlspecialchars($pconfig['gateway']);?>">
+ <?=$mandfldhtml;?><input name="gateway" type="text" class="formfld" id="gateway" size="40" value="<?=htmlspecialchars($pconfig['gateway']);?>">
<br> <span class="vexpl">Gateway to be used to reach the destination network</span></td>
</tr>
<tr>
</table>
</form>
<?php include("fend.inc"); ?>
-</body>
-</html>
--- /dev/null
+#!/usr/local/bin/php
+<?php
+/*
+ uploadconfig.php
+ part of m0n0wall (http://m0n0.ch/wall)
+
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+*/
+
+require("guiconfig.inc");
+
+header("Content-Type: text/plain");
+
+/* get config.xml in POST variable "config" */
+if ($_POST['config']) {
+ $fd = @fopen("{$g['tmp_path']}/config.xml", "w");
+ if (!$fd) {
+ echo "ERR Could not save configuration.\n";
+ exit(0);
+ }
+ fwrite($fd, $_POST['config']);
+ fclose($fd);
+ if (config_install("{$g['tmp_path']}/config.xml") == 0) {
+ echo "OK\n";
+ system_reboot();
+ } else {
+ echo "ERR Could not install configuration.\n";
+ }
+} else {
+ echo "ERR Invalid configuration received.\n";
+}
+
+exit(0);
+?>
vpn_ipsec.php
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("VPN", "IPsec");
require("guiconfig.inc");
if (!is_array($config['ipsec']['tunnel'])) {
}
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("VPN: IPsec");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
-<p class="pgtitle">VPN: IPsec</p>
<form action="vpn_ipsec.php" method="post">
<?php if ($savemsg) print_info_box($savemsg); ?>
<?php if (file_exists($d_ipsecconfdirty_path)): ?><p>
<input name="apply" type="submit" class="formbtn" id="apply" value="Apply changes"></p>
<?php endif; ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr><td>
+ <tr><td class="tabnavtbl">
<ul id="tabnav">
<li class="tabact">Tunnels</li>
<li class="tabinact"><a href="vpn_ipsec_mobile.php">Mobile clients</a></li>
<td class="tabcont">
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
- <td class="vtable"><p><span class="vexpl"> </span>
+ <td class="vtable">
<input name="enable" type="checkbox" id="enable" value="yes" <?php if ($pconfig['enable']) echo "checked";?>>
- <strong>Enable IPsec<br>
- </strong></p></td>
+ <strong>Enable IPsec</strong></td>
</tr>
<tr>
<td> <input name="submit" type="submit" class="formbtn" value="Save">
</table>
</form>
<?php include("fend.inc"); ?>
-</body>
-</html>
vpn_ipsec_edit.php
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("VPN", "IPsec", "Edit tunnel");
require("guiconfig.inc");
if (!is_array($config['ipsec']['tunnel'])) {
if (isset($id) && $a_ipsec[$id]) {
$pconfig['disabled'] = isset($a_ipsec[$id]['disabled']);
- $pconfig['auto'] = isset($a_ipsec[$id]['auto']);
+ //$pconfig['auto'] = isset($a_ipsec[$id]['auto']);
if (!isset($a_ipsec[$id]['local-subnet']))
$pconfig['localnet'] = "lan";
$pconfig['p2ealgos'] = explode(",", "3des,blowfish,cast128,rijndael");
$pconfig['p2halgos'] = explode(",", "hmac_sha1,hmac_md5");
$pconfig['p2pfsgroup'] = "0";
+ $pconfig['remotebits'] = 32;
}
if ($_POST) {
if (($_POST['p2lifetime'] && !is_numeric($_POST['p2lifetime']))) {
$input_errors[] = "The P2 lifetime must be an integer.";
}
- if ($_POST['remotebits'] && (!is_numeric($_POST['remotebits']) || ($_POST['remotebits'] <= 0) || ($_POST['remotebits'] > 32))) {
+ if ($_POST['remotebits'] && (!is_numeric($_POST['remotebits']) || ($_POST['remotebits'] < 0) || ($_POST['remotebits'] > 32))) {
$input_errors[] = "The remote network bits are invalid.";
}
if (($_POST['remotenet'] && !is_ipaddr($_POST['remotenet']))) {
if (!$input_errors) {
$ipsecent['disabled'] = $_POST['disabled'] ? true : false;
- $ipsecent['auto'] = $_POST['auto'] ? true : false;
+ //$ipsecent['auto'] = $_POST['auto'] ? true : false;
$ipsecent['interface'] = $pconfig['interface'];
pconfig_to_address($ipsecent['local-subnet'], $_POST['localnet'], $_POST['localnetmask']);
$ipsecent['remote-subnet'] = $_POST['remotenet'] . "/" . $_POST['remotebits'];
}
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("VPN: IPsec: Edit tunnel");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
+<?php include("fbegin.inc"); ?>
<script language="JavaScript">
<!--
function typesel_change() {
}
//-->
</script>
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-<p class="pgtitle">VPN: IPsec: Edit tunnel</p>
<?php if ($input_errors) print_input_errors($input_errors); ?>
<form action="vpn_ipsec_edit.php" method="post" name="iform" id="iform">
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<span class="vexpl">Set this option to disable this tunnel without
removing it from the list.</span></td>
</tr>
- <tr>
+ <!-- <tr>
<td width="22%" valign="top" class="vncellreq">Auto-establish</td>
<td width="78%" class="vtable">
<input name="auto" type="checkbox" id="auto" value="yes" <?php if ($pconfig['auto']) echo "checked"; ?>>
<strong>Automatically establish this tunnel</strong><br>
<span class="vexpl">Set this option to automatically re-establish this tunnel after reboots/reconfigures. If this is not set, the tunnel is established on demand.</span></td>
- </tr>
+ </tr> -->
<tr>
<td width="22%" valign="top" class="vncellreq">Interface</td>
- <td width="78%" class="vtable"> <select name="interface" class="formfld">
+ <td width="78%" class="vtable"><select name="interface" class="formfld">
<?php $interfaces = array('wan' => 'WAN', 'lan' => 'LAN');
for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++) {
$interfaces['opt' . $i] = $config['interfaces']['opt' . $i]['descr'];
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>Type: </td>
+ <td></td>
<td><select name="localnettype" class="formfld" onChange="typesel_change()">
<?php $sel = is_specialnet($pconfig['localnet']); ?>
<option value="single" <?php if (($pconfig['localnetmask'] == 32) && !$sel) { echo "selected"; $sel = 1; } ?>>
</tr>
<tr>
<td>Address: </td>
+ <td><?=$mandfldhtmlspc;?></td>
<td><input name="localnet" type="text" class="formfld" id="localnet" size="20" value="<?php if (!is_specialnet($pconfig['localnet'])) echo htmlspecialchars($pconfig['localnet']);?>">
/
<select name="localnetmask" class="formfld" id="localnetmask">
<tr>
<td width="22%" valign="top" class="vncellreq">Remote subnet</td>
<td width="78%" class="vtable">
- <input name="remotenet" type="text" class="formfld" id="remotenet" size="20" value="<?=$pconfig['remotenet'];?>">
+ <?=$mandfldhtml;?><input name="remotenet" type="text" class="formfld" id="remotenet" size="20" value="<?=$pconfig['remotenet'];?>">
/
<select name="remotebits" class="formfld" id="remotebits">
- <?php for ($i = 32; $i > 0; $i--): ?>
+ <?php for ($i = 32; $i >= 0; $i--): ?>
<option value="<?=$i;?>" <?php if ($i == $pconfig['remotebits']) echo "selected"; ?>>
<?=$i;?>
</option>
<tr>
<td width="22%" valign="top" class="vncellreq">Remote gateway</td>
<td width="78%" class="vtable">
- <input name="remotegw" type="text" class="formfld" id="remotegw" size="20" value="<?=$pconfig['remotegw'];?>">
+ <?=$mandfldhtml;?><input name="remotegw" type="text" class="formfld" id="remotegw" size="20" value="<?=$pconfig['remotegw'];?>">
<br>
Enter the public IP address of the remote gateway</td>
</tr>
<tr>
<td width="22%" valign="top" class="vncellreq">Negotiation mode</td>
<td width="78%" class="vtable">
-<select name="p1mode" class="formfld">
+ <select name="p1mode" class="formfld">
<?php $modes = explode(" ", "main aggressive"); foreach ($modes as $mode): ?>
<option value="<?=$mode;?>" <?php if ($mode == $pconfig['p1mode']) echo "selected"; ?>>
<?=htmlspecialchars($mode);?>
<tr>
<td width="22%" valign="top" class="vncellreq">My identifier</td>
<td width="78%" class="vtable">
-<select name="p1myidentt" class="formfld">
+ <select name="p1myidentt" class="formfld">
<?php foreach ($my_identifier_list as $mode => $modename): ?>
<option value="<?=$mode;?>" <?php if ($mode == $pconfig['p1myidentt']) echo "selected"; ?>>
<?=htmlspecialchars($modename);?>
<tr>
<td width="22%" valign="top" class="vncellreq">Encryption algorithm</td>
<td width="78%" class="vtable">
-<select name="p1ealgo" class="formfld">
+ <select name="p1ealgo" class="formfld">
<?php foreach ($p1_ealgos as $algo => $algoname): ?>
<option value="<?=$algo;?>" <?php if ($algo == $pconfig['p1ealgo']) echo "selected"; ?>>
<?=htmlspecialchars($algoname);?>
<tr>
<td width="22%" valign="top" class="vncellreq">Hash algorithm</td>
<td width="78%" class="vtable">
-<select name="p1halgo" class="formfld">
+ <select name="p1halgo" class="formfld">
<?php foreach ($p1_halgos as $algo => $algoname): ?>
<option value="<?=$algo;?>" <?php if ($algo == $pconfig['p1halgo']) echo "selected"; ?>>
<?=htmlspecialchars($algoname);?>
<tr>
<td width="22%" valign="top" class="vncellreq">DH key group</td>
<td width="78%" class="vtable">
-<select name="p1dhgroup" class="formfld">
+ <select name="p1dhgroup" class="formfld">
<?php $keygroups = explode(" ", "1 2 5"); foreach ($keygroups as $keygroup): ?>
<option value="<?=$keygroup;?>" <?php if ($keygroup == $pconfig['p1dhgroup']) echo "selected"; ?>>
<?=htmlspecialchars($keygroup);?>
<tr>
<td width="22%" valign="top" class="vncellreq">Pre-Shared Key</td>
<td width="78%" class="vtable">
- <input name="p1pskey" type="text" class="formfld" id="p1pskey" size="40" value="<?=htmlspecialchars($pconfig['p1pskey']);?>">
+ <?=$mandfldhtml;?><input name="p1pskey" type="text" class="formfld" id="p1pskey" size="40" value="<?=htmlspecialchars($pconfig['p1pskey']);?>">
</td>
</tr>
<tr>
<tr>
<td width="22%" valign="top" class="vncellreq">Protocol</td>
<td width="78%" class="vtable">
-<select name="p2proto" class="formfld">
+ <select name="p2proto" class="formfld">
<?php foreach ($p2_protos as $proto => $protoname): ?>
<option value="<?=$proto;?>" <?php if ($proto == $pconfig['p2proto']) echo "selected"; ?>>
<?=htmlspecialchars($protoname);?>
<tr>
<td width="22%" valign="top" class="vncellreq">PFS key group</td>
<td width="78%" class="vtable">
-<select name="p2pfsgroup" class="formfld">
+ <select name="p2pfsgroup" class="formfld">
<?php foreach ($p2_pfskeygroups as $keygroup => $keygroupname): ?>
<option value="<?=$keygroup;?>" <?php if ($keygroup == $pconfig['p2pfsgroup']) echo "selected"; ?>>
<?=htmlspecialchars($keygroupname);?>
//-->
</script>
<?php include("fend.inc"); ?>
-</body>
-</html>
vpn_ipsec_keys.php
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("VPN", "IPsec");
require("guiconfig.inc");
if (!is_array($config['ipsec']['mobilekey'])) {
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("VPN: IPsec");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
-<p class="pgtitle">VPN: IPsec</p>
<form action="vpn_ipsec.php" method="post">
<?php if ($savemsg) print_info_box($savemsg); ?>
<?php if (file_exists($d_ipsecconfdirty_path)): ?><p>
<input name="apply" type="submit" class="formbtn" id="apply" value="Apply changes"></p>
<?php endif; ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr><td>
+ <tr><td class="tabnavtbl">
<ul id="tabnav">
- <li class="tabinact"><a href="vpn_ipsec.php">Tunnels</a></li>
+ <li class="tabinact1"><a href="vpn_ipsec.php">Tunnels</a></li>
<li class="tabinact"><a href="vpn_ipsec_mobile.php">Mobile clients</a></li>
<li class="tabact">Pre-shared keys</li>
</ul>
</table>
</form>
<?php include("fend.inc"); ?>
-</body>
-</html>
vpn_ipsec_keys_edit.php
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("VPN", "IPsec", "Edit pre-shared key");
require("guiconfig.inc");
if (!is_array($config['ipsec']['mobilekey'])) {
}
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("VPN: IPsec: Edit pre-shared key");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
-<p class="pgtitle">VPN: IPsec: Edit pre-shared key</p>
<?php if ($input_errors) print_input_errors($input_errors); ?>
<form action="vpn_ipsec_keys_edit.php" method="post" name="iform" id="iform">
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td valign="top" class="vncellreq">Identifier</td>
<td class="vtable">
- <input name="ident" type="text" class="formfld" id="ident" size="30" value="<?=$pconfig['ident'];?>">
+ <?=$mandfldhtml;?><input name="ident" type="text" class="formfld" id="ident" size="30" value="<?=$pconfig['ident'];?>">
<br>
This can be either an IP address, fully qualified domain name or an e-mail address.
</td>
<tr>
<td width="22%" valign="top" class="vncellreq">Pre-shared key</td>
<td width="78%" class="vtable">
- <input name="psk" type="text" class="formfld" id="psk" size="40" value="<?=htmlspecialchars($pconfig['psk']);?>">
+ <?=$mandfldhtml;?><input name="psk" type="text" class="formfld" id="psk" size="40" value="<?=htmlspecialchars($pconfig['psk']);?>">
</td>
</tr>
<tr>
</table>
</form>
<?php include("fend.inc"); ?>
-</body>
-</html>
vpn_ipsec_mobile.php
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("VPN", "IPsec");
require("guiconfig.inc");
if (!is_array($config['ipsec']['mobileclients'])) {
}
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("VPN: IPsec");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
-<p class="pgtitle">VPN: IPsec</p>
<form action="vpn_ipsec.php" method="post">
<?php if ($input_errors) print_input_errors($input_errors); ?>
<?php if (file_exists($d_ipsecconfdirty_path)): ?><p>
</form>
<form action="vpn_ipsec_mobile.php" method="post" name="iform" id="iform">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr><td>
+ <tr><td class="tabnavtbl">
<ul id="tabnav">
- <li class="tabinact"><a href="vpn_ipsec.php">Tunnels</a></li>
+ <li class="tabinact1"><a href="vpn_ipsec.php">Tunnels</a></li>
<li class="tabact">Mobile clients</li>
<li class="tabinact"><a href="vpn_ipsec_keys.php">Pre-shared keys</a></li>
</ul>
</tr>
<tr>
<td width="22%" valign="top" class="vncellreq">Negotiation mode</td>
- <td width="78%" bgcolor="#FFFFFF" class="vtable">
-<select name="p1mode" class="formfld">
+ <td width="78%" class="vtable">
+ <select name="p1mode" class="formfld">
<?php $modes = explode(" ", "main aggressive"); foreach ($modes as $mode): ?>
<option value="<?=$mode;?>" <?php if ($mode == $pconfig['p1mode']) echo "selected"; ?>>
<?=htmlspecialchars($mode);?>
</tr>
<tr>
<td width="22%" valign="top" class="vncellreq">My identifier</td>
- <td width="78%" bgcolor="#FFFFFF" class="vtable">
-<select name="p1myidentt" class="formfld">
+ <td width="78%" class="vtable">
+ <select name="p1myidentt" class="formfld">
<?php foreach ($my_identifier_list as $mode => $modename): ?>
<option value="<?=$mode;?>" <?php if ($mode == $pconfig['p1myidentt']) echo "selected"; ?>>
<?=htmlspecialchars($modename);?>
</tr>
<tr>
<td width="22%" valign="top" class="vncellreq">Encryption algorithm</td>
- <td width="78%" bgcolor="#FFFFFF" class="vtable">
-<select name="p1ealgo" class="formfld">
+ <td width="78%" class="vtable">
+ <select name="p1ealgo" class="formfld">
<?php foreach ($p1_ealgos as $algo => $algoname): ?>
<option value="<?=$algo;?>" <?php if ($algo == $pconfig['p1ealgo']) echo "selected"; ?>>
<?=htmlspecialchars($algoname);?>
</tr>
<tr>
<td width="22%" valign="top" class="vncellreq">Hash algorithm</td>
- <td width="78%" bgcolor="#FFFFFF" class="vtable">
-<select name="p1halgo" class="formfld">
+ <td width="78%" class="vtable">
+ <select name="p1halgo" class="formfld">
<?php foreach ($p1_halgos as $algo => $algoname): ?>
<option value="<?=$algo;?>" <?php if ($algo == $pconfig['p1halgo']) echo "selected"; ?>>
<?=htmlspecialchars($algoname);?>
</tr>
<tr>
<td width="22%" valign="top" class="vncellreq">DH key group</td>
- <td width="78%" bgcolor="#FFFFFF" class="vtable">
-<select name="p1dhgroup" class="formfld">
+ <td width="78%" class="vtable">
+ <select name="p1dhgroup" class="formfld">
<?php $keygroups = explode(" ", "1 2 5"); foreach ($keygroups as $keygroup): ?>
<option value="<?=$keygroup;?>" <?php if ($keygroup == $pconfig['p1dhgroup']) echo "selected"; ?>>
<?=htmlspecialchars($keygroup);?>
</tr>
<tr>
<td width="22%" valign="top" class="vncell">Lifetime</td>
- <td width="78%" bgcolor="#FFFFFF" class="vtable">
+ <td width="78%" class="vtable">
<input name="p1lifetime" type="text" class="formfld" id="p1lifetime" size="20" value="<?=$pconfig['p1lifetime'];?>">
seconds</td>
</tr>
</tr>
<tr>
<td width="22%" valign="top" class="vncellreq">Protocol</td>
- <td width="78%" bgcolor="#FFFFFF" class="vtable">
-<select name="p2proto" class="formfld">
+ <td width="78%" class="vtable">
+ <select name="p2proto" class="formfld">
<?php foreach ($p2_protos as $proto => $protoname): ?>
<option value="<?=$proto;?>" <?php if ($proto == $pconfig['p2proto']) echo "selected"; ?>>
<?=htmlspecialchars($protoname);?>
</tr>
<tr>
<td width="22%" valign="top" class="vncellreq">Encryption algorithms</td>
- <td width="78%" bgcolor="#FFFFFF" class="vtable">
+ <td width="78%" class="vtable">
<?php foreach ($p2_ealgos as $algo => $algoname): ?>
<input type="checkbox" name="p2ealgos[]" value="<?=$algo;?>" <?php if (in_array($algo, $pconfig['p2ealgos'])) echo "checked"; ?>>
<?=htmlspecialchars($algoname);?>
</tr>
<tr>
<td width="22%" valign="top" class="vncellreq">Hash algorithms</td>
- <td width="78%" bgcolor="#FFFFFF" class="vtable">
+ <td width="78%" class="vtable">
<?php foreach ($p2_halgos as $algo => $algoname): ?>
<input type="checkbox" name="p2halgos[]" value="<?=$algo;?>" <?php if (in_array($algo, $pconfig['p2halgos'])) echo "checked"; ?>>
<?=htmlspecialchars($algoname);?>
</tr>
<tr>
<td width="22%" valign="top" class="vncellreq">PFS key group</td>
- <td width="78%" bgcolor="#FFFFFF" class="vtable">
-<select name="p2pfsgroup" class="formfld">
+ <td width="78%" class="vtable">
+ <select name="p2pfsgroup" class="formfld">
<?php foreach ($p2_pfskeygroups as $keygroup => $keygroupname): ?>
<option value="<?=$keygroup;?>" <?php if ($keygroup == $pconfig['p2pfsgroup']) echo "selected"; ?>>
<?=htmlspecialchars($keygroupname);?>
</tr>
<tr>
<td width="22%" valign="top" class="vncell">Lifetime</td>
- <td width="78%" bgcolor="#FFFFFF" class="vtable">
+ <td width="78%" class="vtable">
<input name="p2lifetime" type="text" class="formfld" id="p2lifetime" size="20" value="<?=$pconfig['p2lifetime'];?>">
seconds</td>
</tr>
</table>
</form>
<?php include("fend.inc"); ?>
-</body>
-</html>
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("VPN", "OpenVPN");
require("guiconfig.inc");
require_once("openvpn.inc");
$pconfig = $config['ovpn']['server'];
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("VPN: OpenVPN");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
-<p class="pgtitle">VPN: OpenVPN</p>
<?php if ($input_errors) print_input_errors($input_errors); ?>
<?php if (file_exists($d_sysrebootreqd_path)) print_info_box(get_std_save_message(0)); ?>
</table>
</form>
<?php include("fend.inc"); ?>
-</body>
-</html>
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("VPN", "OpenVPN");
require("guiconfig.inc");
require_once("openvpn.inc");
}
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("VPN: OpenVPN");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
-<p class="pgtitle">VPN: OpenVPN</p>
<?php if ($input_errors) print_input_errors($input_errors); ?>
<?php if (file_exists($d_sysrebootreqd_path) && !file_exists($d_ovpnclidirty_path)) print_info_box(get_std_save_message(0)); ?>
<form action="vpn_openvpn_cli.php" method="post" enctype="multipart/form-data" name="iform" id="iform">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td>
<ul id="tabnav">
- <li class="tabinact"><a href="vpn_openvpn.php">Server</a></li>
+ <li class="tabinact1"><a href="vpn_openvpn.php">Server</a></li>
<li class="tabact">Client</li>
</ul>
</td></tr>
</table>
</form>
<?php include("fend.inc"); ?>
-</body>
-</html>
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("VPN", "OpenVPN", "Edit client");
require("guiconfig.inc");
require_once("openvpn.inc");
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("VPN: OpenVPN: Edit client");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
-<p class="pgtitle">VPN: OpenVPN: Edit client</p>
<?php if ($input_errors) print_input_errors($input_errors); ?>
<form action="vpn_openvpn_cli_edit.php" method="post" enctype="multipart/form-data" name="iform" id="iform">
</form>
<?php include("fend.inc"); ?>
-</body>
-</html>
vpn_pptp.php
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("VPN", "PPTP");
require("guiconfig.inc");
if (!is_array($config['pptpd']['radius'])) {
}
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head>
-<title><?=gentitle("VPN: PPTP");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
+<?php include("fbegin.inc"); ?>
<script language="JavaScript">
<!--
function get_radio_value(obj)
}
//-->
</script>
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-<p class="pgtitle">VPN: PPTP</p>
<form action="vpn_pptp.php" method="post" name="iform" id="iform">
<?php if ($input_errors) print_input_errors($input_errors); ?>
<?php if ($savemsg) print_info_box($savemsg); ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr><td>
+ <tr><td class="tabnavtbl">
<ul id="tabnav">
<li class="tabact">Configuration</li>
<li class="tabinact"><a href="vpn_pptp_users.php">Users</a></li>
<tr>
<td width="22%" valign="top" class="vncellreq">PPTP redirection</td>
<td width="78%" class="vtable">
- <input name="redir" type="text" class="formfld" id="redir" size="20" value="<?=htmlspecialchars($pconfig['redir']);?>">
+ <?=$mandfldhtml;?><input name="redir" type="text" class="formfld" id="redir" size="20" value="<?=htmlspecialchars($pconfig['redir']);?>">
<br>
Enter the IP address of a host which will accept incoming
PPTP connections.</td>
<tr>
<td width="22%" valign="top" class="vncellreq">Server address</td>
<td width="78%" class="vtable">
- <input name="localip" type="text" class="formfld" id="localip" size="20" value="<?=htmlspecialchars($pconfig['localip']);?>">
+ <?=$mandfldhtml;?><input name="localip" type="text" class="formfld" id="localip" size="20" value="<?=htmlspecialchars($pconfig['localip']);?>">
<br>
Enter the IP address the PPTP server should use on its side
for all clients.</td>
<td width="22%" valign="top" class="vncellreq">Remote address
range</td>
<td width="78%" class="vtable">
- <input name="remoteip" type="text" class="formfld" id="remoteip" size="20" value="<?=htmlspecialchars($pconfig['remoteip']);?>">
+ <?=$mandfldhtml;?><input name="remoteip" type="text" class="formfld" id="remoteip" size="20" value="<?=htmlspecialchars($pconfig['remoteip']);?>">
/
<?=$g['pptp_subnet'];?>
<br>
<tr>
<td width="22%" valign="top" class="vncell">RADIUS</td>
<td width="78%" class="vtable">
- <p>
<input name="radiusenable" type="checkbox" id="radiusenable" onclick="enable_change(false)" value="yes" <?php if ($pconfig['radiusenable']) echo "checked"; ?>>
<strong>Use a RADIUS server for authentication<br>
</strong>When set, all users will be authenticated using
<br>
<input name="radacct_enable" type="checkbox" id="radacct_enable" onclick="enable_change(false)" value="yes" <?php if ($pconfig['radacct_enable']) echo "checked"; ?>>
<strong>Enable RADIUS accounting <br>
- </strong>Sends accounting packets to the RADIUS server. </p></td>
+ </strong>Sends accounting packets to the RADIUS server.</td>
</tr>
<tr>
<td width="22%" valign="top" class="vncell">RADIUS server </td>
- <td width="78%" class="vtable">
- <p>
+ <td width="78%" class="vtable">
<input name="radiusserver" type="text" class="formfld" id="radiusserver" size="20" value="<?=htmlspecialchars($pconfig['radiusserver']);?>">
<br>
- Enter the IP address of the RADIUS server.</p></td>
+ Enter the IP address of the RADIUS server.</td>
</tr>
<tr>
<td width="22%" valign="top" class="vncell">RADIUS shared secret</td>
- <td width="78%" valign="top" class="vtable">
- <p>
+ <td width="78%" valign="top" class="vtable">
<input name="radiussecret" type="password" class="formfld" id="radiussecret" size="20" value="<?=htmlspecialchars($pconfig['radiussecret']);?>">
<br>
Enter the shared secret that will be used to authenticate
- to the RADIUS server.</p></td>
+ to the RADIUS server.</td>
</tr>
<tr>
<td height="16" colspan="2" valign="top"></td>
//-->
</script>
<?php include("fend.inc"); ?>
-</body>
-</html>
vpn_pptp_users.php
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("VPN", "PPTP");
require("guiconfig.inc");
if (!is_array($config['pptpd']['user'])) {
}
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("VPN: PPTP: Users");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
-<p class="pgtitle">VPN: PPTP: Users</p>
<form action="vpn_pptp_users.php" method="post">
<?php if ($savemsg) print_info_box($savemsg); ?>
<?php if (isset($config['pptpd']['radius']['enable']))
<input name="apply" type="submit" class="formbtn" id="apply" value="Apply changes"></p>
<?php endif; ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr><td>
+ <tr><td class="tabnavtbl">
<ul id="tabnav">
- <li class="tabinact"><a href="vpn_pptp.php">Configuration</a></li>
+ <li class="tabinact1"><a href="vpn_pptp.php">Configuration</a></li>
<li class="tabact">Users</li>
</ul>
</td></tr>
</table>
</form>
<?php include("fend.inc"); ?>
-</body>
-</html>
vpn_pptp_users_edit.php
part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
+ Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
POSSIBILITY OF SUCH DAMAGE.
*/
+$pgtitle = array("VPN", "PPTP", "Edit user");
require("guiconfig.inc");
if (!is_array($config['pptpd']['user'])) {
}
}
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title><?=gentitle("VPN: PPTP: Users: Edit");?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link href="gui.css" rel="stylesheet" type="text/css">
-</head>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
-<p class="pgtitle">VPN: PPTP: Users: Edit</p>
<?php if ($input_errors) print_input_errors($input_errors); ?>
<form action="vpn_pptp_users_edit.php" method="post" name="iform" id="iform">
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td width="22%" valign="top" class="vncellreq">Username</td>
<td width="78%" class="vtable">
-<input name="username" type="text" class="formfld" id="username" size="20" value="<?=htmlspecialchars($pconfig['username']);?>">
+ <?=$mandfldhtml;?><input name="username" type="text" class="formfld" id="username" size="20" value="<?=htmlspecialchars($pconfig['username']);?>">
</td>
<tr>
<td width="22%" valign="top" class="vncellreq">Password</td>
<td width="78%" class="vtable">
- <input name="password" type="password" class="formfld" id="password" size="20">
- <br> <input name="password2" type="password" class="formfld" id="password2" size="20">
+ <?=$mandfldhtml;?><input name="password" type="password" class="formfld" id="password" size="20">
+ <br><?=$mandfldhtml;?><input name="password2" type="password" class="formfld" id="password2" size="20">
(confirmation)<?php if (isset($id) && $a_secret[$id]): ?><br>
<span class="vexpl">If you want to change the users' password,
enter it here twice.</span><?php endif; ?></td>
</table>
</form>
<?php include("fend.inc"); ?>
-</body>
-</html>