From 28f4a00a9ce3f67df8540d0573d4eda0816610f3 Mon Sep 17 00:00:00 2001 From: Chris Buechler Date: Sat, 17 Jul 2010 17:56:11 -0400 Subject: correctly add new pass-through MAC entries --- usr/local/www/services_captiveportal_mac_edit.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'usr/local/www') diff --git a/usr/local/www/services_captiveportal_mac_edit.php b/usr/local/www/services_captiveportal_mac_edit.php index b55e750..d5dace5 100755 --- a/usr/local/www/services_captiveportal_mac_edit.php +++ b/usr/local/www/services_captiveportal_mac_edit.php @@ -131,11 +131,12 @@ if ($_POST) { captiveportal_free_ipfw_ruleno($ruleno); $rules = "delete {$ruleno}\n"; $rules .= "delete " . ++$ruleno . "\n"; - $rules .= captiveportal_passthrumac_configure_entry($mac); - file_put_contents("{$g['tmp_path']}/tmpmacedit{$id}", $rules); - mwexec("/sbin/ipfw -q {$g['tmp_path']}/tmpmacedit{$id}"); - @unlink("{$g['tmp_path']}/tmpmacedit{$id}"); } + + $rules .= captiveportal_passthrumac_configure_entry($mac); + file_put_contents("{$g['tmp_path']}/tmpmacedit{$id}", $rules); + mwexec("/sbin/ipfw -q {$g['tmp_path']}/tmpmacedit{$id}"); + @unlink("{$g['tmp_path']}/tmpmacedit{$id}"); header("Location: services_captiveportal_mac.php"); exit; -- cgit v1.1 From 0caadd8bb6e1cb515cc78aa7eafe84af9798f98b Mon Sep 17 00:00:00 2001 From: Chris Buechler Date: Sat, 17 Jul 2010 18:19:05 -0400 Subject: fix double click to edit --- usr/local/www/system_groupmanager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'usr/local/www') diff --git a/usr/local/www/system_groupmanager.php b/usr/local/www/system_groupmanager.php index a167790..12d2e41 100644 --- a/usr/local/www/system_groupmanager.php +++ b/usr/local/www/system_groupmanager.php @@ -411,7 +411,7 @@ function presubmit() { else $grpimg = "/themes/{$g['theme']}/images/icons/icon_system-group.png"; ?> - + -- cgit v1.1 From 47e68f487386fa5b8a8ecea425185c7501a125fb Mon Sep 17 00:00:00 2001 From: smos Date: Sun, 18 Jul 2010 22:19:39 +0200 Subject: Commit first stab at a custom graph tab. Doesn't do anything yet, shouldn't break any existing graphs. --- usr/local/www/status_rrd_graph.php | 70 ++++++++++++++++++++++++++++++++------ 1 file changed, 59 insertions(+), 11 deletions(-) (limited to 'usr/local/www') diff --git a/usr/local/www/status_rrd_graph.php b/usr/local/www/status_rrd_graph.php index 115d12c..d6e9736 100755 --- a/usr/local/www/status_rrd_graph.php +++ b/usr/local/www/status_rrd_graph.php @@ -115,6 +115,30 @@ if ($_GET['option']) { } } +if($curcat == "custom") { + if (is_numeric($_GET['start'])) { + if($start < ($now - (3600 * 24 * 365 * 5))) { + $start = $now - (4 * 3600); + } + $start = $_GET['start']; + } else { + $start = $now - (4 * 3600); + } +} + +if (is_numeric($_GET['end'])) { + $end = $_GET['end']; +} else { + $end = $now; +} + +/* this should never happen */ +if($end < $start) { + $end = $now; +} + +$seconds = $end - $start; + if ($_GET['style']) { $curstyle = $_GET['style']; } else { @@ -244,6 +268,8 @@ function get_dates($curperiod, $graph) { if($curcat == "cellular") { $tabactive = True; } else { $tabactive = False; } $tab_array[] = array("Cellular", $tabactive, "status_rrd_graph.php?cat=cellular"); } + if($curcat == "custom") { $tabactive = True; } else { $tabactive = False; } + $tab_array[] = array("Custom", $tabactive, "status_rrd_graph.php?cat=custom"); if($curcat == "settings") { $tabactive = True; } else { $tabactive = False; } $tab_array[] = array("Settings", $tabactive, "status_rrd_graph_settings.php"); display_top_tabs($tab_array); @@ -263,6 +289,19 @@ function get_dates($curperiod, $graph) { - - + $value) { + echo "\n"; + } } ?> @@ -322,7 +367,10 @@ function get_dates($curperiod, $graph) { "; + if($curcat == "custom") { + + + } foreach($graphs as $graph) { /* check which databases are valid for our category */ foreach($ui_databases as $curdatabase) { -- cgit v1.1 From 5709072a7e46165ae9d774c5c9c5818a89231d7e Mon Sep 17 00:00:00 2001 From: jim-p Date: Mon, 19 Jul 2010 11:08:12 -0400 Subject: Only perform this check if the group being created actually has members. --- usr/local/www/system_groupmanager.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'usr/local/www') diff --git a/usr/local/www/system_groupmanager.php b/usr/local/www/system_groupmanager.php index 12d2e41..8b5c3c3 100644 --- a/usr/local/www/system_groupmanager.php +++ b/usr/local/www/system_groupmanager.php @@ -152,10 +152,12 @@ if ($_POST) { local_group_set($group); /* Refresh users in this group since their privileges may have changed. */ - $a_user = &$config['system']['user']; - foreach ($a_user as & $user) { - if (in_array($user['uid'], $group['member'])) - local_user_set($user); + if (is_array($group['member'])) { + $a_user = &$config['system']['user']; + foreach ($a_user as & $user) { + if (in_array($user['uid'], $group['member'])) + local_user_set($user); + } } write_config(); -- cgit v1.1 From 496dcc199b5435cbd941b4ba89c9ded875f914fd Mon Sep 17 00:00:00 2001 From: jim-p Date: Tue, 20 Jul 2010 08:26:39 -0400 Subject: Replace this exec to find with a glob(). Fixes #751. --- usr/local/www/status_rrd_graph.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'usr/local/www') diff --git a/usr/local/www/status_rrd_graph.php b/usr/local/www/status_rrd_graph.php index d6e9736..c0d8814 100755 --- a/usr/local/www/status_rrd_graph.php +++ b/usr/local/www/status_rrd_graph.php @@ -28,7 +28,6 @@ POSSIBILITY OF SUCH DAMAGE. */ /* - pfSense_BUILDER_BINARIES: /usr/bin/find pfSense_MODULE: system */ @@ -50,8 +49,7 @@ if(! isset($config['rrd']['enable'])) { } $rrddbpath = "/var/db/rrd/"; -/* XXX: (billm) do we have an exec() type function that does this type of thing? */ -exec("cd $rrddbpath;/usr/bin/find -name *.rrd", $databases); +$databases = glob("{$rrddbpath}*.rrd"); if ($_GET['cat']) { $curcat = $_GET['cat']; -- cgit v1.1 From 1a8bf19a68b0a87fe7a9716a7c978ab8d2cdb616 Mon Sep 17 00:00:00 2001 From: jim-p Date: Tue, 20 Jul 2010 15:11:34 -0400 Subject: Fix typos --- usr/local/www/system_advanced_notifications.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'usr/local/www') diff --git a/usr/local/www/system_advanced_notifications.php b/usr/local/www/system_advanced_notifications.php index cdd8b2d..0ee67c7 100644 --- a/usr/local/www/system_advanced_notifications.php +++ b/usr/local/www/system_advanced_notifications.php @@ -111,13 +111,13 @@ if ($_POST) { if($config['notifications']['growl']['ipaddress'] && $config['notifications']['growl']['password'] = $_POST['password']) { register_via_growl(); - notify_via_growl(gettext("This is a test message form pfSense. It is safe to ignore this message.")); + notify_via_growl(gettext("This is a test message from pfSense. It is safe to ignore this message.")); } // Send test message via smtp if(file_exists("/var/db/notices_lastmsg.txt")) unlink("/var/db/notices_lastmsg.txt"); - $savemsg = notify_via_smtp(gettext("This is a test message form pfSense. It is safe to ignore this message.")); + $savemsg = notify_via_smtp(gettext("This is a test message from pfSense. It is safe to ignore this message.")); pfSenseHeader("system_advanced_notifications.php"); exit; -- cgit v1.1 From f5e511d3fa553583b25ca9624fa4b9ee5a2d8882 Mon Sep 17 00:00:00 2001 From: Ermal Date: Wed, 21 Jul 2010 18:19:11 +0000 Subject: Remove priority from HFSC it is a null config option. Center most of the text in the center of a "; +$output_form .= "
"; $output_form .= ""; -} +} else $output_form .= ""; -- cgit v1.1 From c55e45800d839e6e46d2704097d43563247fb06c Mon Sep 17 00:00:00 2001 From: Chris Buechler Date: Wed, 21 Jul 2010 23:18:00 -0400 Subject: only match with a space behind the IP, otherwise 10.0.0.6 CARP IP may match against interface IP 10.0.0.60, and show incorrect info on the CARP status page --- usr/local/www/carp_status.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'usr/local/www') diff --git a/usr/local/www/carp_status.php b/usr/local/www/carp_status.php index 793a9ae..44dee95 100755 --- a/usr/local/www/carp_status.php +++ b/usr/local/www/carp_status.php @@ -107,7 +107,7 @@ include("head.inc");

and add some space between objects. --- usr/local/www/firewall_shaper.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'usr/local/www') diff --git a/usr/local/www/firewall_shaper.php b/usr/local/www/firewall_shaper.php index 6618389..e456c61 100755 --- a/usr/local/www/firewall_shaper.php +++ b/usr/local/www/firewall_shaper.php @@ -341,9 +341,9 @@ $tree .= ""; if (!$dontshow || $newqueue) { -$output_form .= "
"; -$output_form .= "Queue Actions"; -$output_form .= ""; +$output_form .= "
"; +$output_form .= "
Queue Actions
"; +$output_form .= "

"; $output_form .= ""; if ($can_add || $addnewaltq) { @@ -368,9 +368,9 @@ if ($can_add || $addnewaltq) { $output_form .= " value=\"Disable shaper on interface\">"; $output_form .= ""; } -$output_form .= "
- + -- cgit v1.1 From d2ff48a06df5edbcd786994a77f28c7997974a0f Mon Sep 17 00:00:00 2001 From: Ermal Date: Thu, 22 Jul 2010 19:10:01 +0000 Subject: Use correct boolean values as the logic implies. --- usr/local/www/services_rfc2136_edit.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'usr/local/www') diff --git a/usr/local/www/services_rfc2136_edit.php b/usr/local/www/services_rfc2136_edit.php index 97f8770..a7d9e7b 100644 --- a/usr/local/www/services_rfc2136_edit.php +++ b/usr/local/www/services_rfc2136_edit.php @@ -81,7 +81,7 @@ if ($_POST) { if (!$input_errors) { $rfc2136 = array(); - $rfc2136['enable'] = $_POST['enable'] ? false : true; + $rfc2136['enable'] = $_POST['enable'] ? true : false; $rfc2136['host'] = $_POST['host']; $rfc2136['ttl'] = $_POST['ttl']; $rfc2136['keyname'] = $_POST['keyname']; -- cgit v1.1 From d6a0379d291f5e98500776618559343f40254e40 Mon Sep 17 00:00:00 2001 From: Ermal Date: Thu, 22 Jul 2010 23:16:24 +0000 Subject: Add a subnet option to allowed ip addresses on CP. --- usr/local/www/services_captiveportal_ip.php | 6 ++++++ usr/local/www/services_captiveportal_ip_edit.php | 11 +++++++++++ 2 files changed, 17 insertions(+) (limited to 'usr/local/www') diff --git a/usr/local/www/services_captiveportal_ip.php b/usr/local/www/services_captiveportal_ip.php index 29acb1c..1979519 100755 --- a/usr/local/www/services_captiveportal_ip.php +++ b/usr/local/www/services_captiveportal_ip.php @@ -59,10 +59,16 @@ if ($_GET['act'] == "del") { $ipent = $a_allowedips[$_GET['id']]; if (isset($config['captiveportal']['enable'])) { + if (!empty($ipent['sn'])) + $ipent['ip'] .= "/{$ipent['sn']}"; mwexec("/sbin/ipfw table 3 delete " . $ipent['ip']); mwexec("/sbin/ipfw table 4 delete " . $ipent['ip']); mwexec("/sbin/ipfw table 5 delete " . $ipent['ip']); mwexec("/sbin/ipfw table 6 delete " . $ipent['ip']); + mwexec("/sbin/ipfw table 7 delete " . $ipent['ip']); + mwexec("/sbin/ipfw table 8 delete " . $ipent['ip']); + mwexec("/sbin/ipfw table 9 delete " . $ipent['ip']); + mwexec("/sbin/ipfw table 10 delete " . $ipent['ip']); } unset($a_allowedips[$_GET['id']]); diff --git a/usr/local/www/services_captiveportal_ip_edit.php b/usr/local/www/services_captiveportal_ip_edit.php index 419327d..633900d 100755 --- a/usr/local/www/services_captiveportal_ip_edit.php +++ b/usr/local/www/services_captiveportal_ip_edit.php @@ -70,6 +70,7 @@ if (isset($_POST['id'])) if (isset($id) && $a_allowedips[$id]) { $pconfig['ip'] = $a_allowedips[$id]['ip']; + $pconfig['sn'] = $a_allowedips[$id]['sn']; $pconfig['dir'] = $a_allowedips[$id]['dir']; $pconfig['bw_up'] = $a_allowedips[$id]['bw_up']; $pconfig['bw_down'] = $a_allowedips[$id]['bw_down']; @@ -108,6 +109,7 @@ if ($_POST) { if (!$input_errors) { $ip = array(); $ip['ip'] = $_POST['ip']; + $ip['sn'] = $_POST['sn']; $ip['dir'] = $_POST['dir']; $ip['descr'] = $_POST['descr']; if ($_POST['bw_up']) @@ -116,9 +118,13 @@ if ($_POST) { $ip['bw_down'] = $_POST['bw_down']; if (isset($id) && $a_allowedips[$id]) { $oldip = $a_allowedips[$id]['ip']; + if (!empty($a_allowedips[$id]['sn'])) + $oldip .= "/{$a_allowedips[$id]['sn']}"; $a_allowedips[$id] = $ip; } else { $oldip = $ip['ip']; + if (!empty($$ip['sn'])) + $oldip .= "/{$$ip['sn']}"; $a_allowedips[] = $ip; } allowedips_sort(); @@ -168,6 +174,11 @@ include("head.inc"); -- cgit v1.1 From 002bc4ab3268e6e5cb3a01ce73a4c1624d09050a Mon Sep 17 00:00:00 2001 From: smos Date: Fri, 23 Jul 2010 09:59:58 +0200 Subject: Fix the glob() to return only the files, not the pathnames, use chdir() before. Fix a possible injection of ../ in the database path by using basename() Fix the week graph math so it is correct. --- usr/local/www/status_rrd_graph.php | 9 +++++---- usr/local/www/status_rrd_graph_img.php | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) (limited to 'usr/local/www') diff --git a/usr/local/www/status_rrd_graph.php b/usr/local/www/status_rrd_graph.php index c0d8814..770b61b 100755 --- a/usr/local/www/status_rrd_graph.php +++ b/usr/local/www/status_rrd_graph.php @@ -49,7 +49,9 @@ if(! isset($config['rrd']['enable'])) { } $rrddbpath = "/var/db/rrd/"; -$databases = glob("{$rrddbpath}*.rrd"); +chdir($rrddbpath); +$databases = glob("*.rrd"); + if ($_GET['cat']) { $curcat = $_GET['cat']; @@ -206,8 +208,8 @@ function get_dates($curperiod, $graph) { $end = mktime(0, 0, 0, $curmonth, (($curday + $offset) + 1), $curyear); break; case "week": - $start = mktime(0, 0, 0, $curmonth, (($curday + $curweekday) - $offset), $curyear); - $end = mktime(0, 0, 0, $curmonth, (($curday + $curweekday) + 7), $curyear); + $start = mktime(0, 0, 0, $curmonth, (($curday - $curweekday) + $offset), $curyear); + $end = mktime(0, 0, 0, $curmonth, (($curday - $curweekday) + 7), $curyear); break; case "month": $start = mktime(0, 0, 0, ($curmonth + $offset), 0, $curyear); @@ -330,7 +332,6 @@ function get_dates($curperiod, $graph) { echo " selected "; } echo ">" . htmlspecialchars($prettyprint) . "\n"; - } ?> diff --git a/usr/local/www/status_rrd_graph_img.php b/usr/local/www/status_rrd_graph_img.php index 567d272..321e6f9 100644 --- a/usr/local/www/status_rrd_graph_img.php +++ b/usr/local/www/status_rrd_graph_img.php @@ -28,7 +28,7 @@ POSSIBILITY OF SUCH DAMAGE. */ /* - pfSense_BUILDER_BINARIES: /usr/bin/find /bin/rm /usr/local/bin/rrdtool + pfSense_BUILDER_BINARIES: /bin/rm /usr/local/bin/rrdtool pfSense_MODULE: system */ @@ -40,7 +40,7 @@ require_once("rrd.inc"); $pgtitle = array("System","RRD Graphs","Image viewer"); if ($_GET['database']) { - $curdatabase = $_GET['database']; + $curdatabase = basename($_GET['database']); } else { $curdatabase = "wan-traffic.rrd"; } @@ -146,8 +146,9 @@ $havg = timeDiff($average, $defOptions); $hperiod = timeDiff($seconds, $defOptions); $data = true; -/* XXX: (billm) do we have an exec() type function that does this type of thing? */ -exec("cd $rrddbpath;/usr/bin/find -name *.rrd", $databases); +$rrddbpath = "/var/db/rrd/"; +chdir($rrddbpath); +$databases = glob("*.rrd"); rsort($databases); /* compare bytes/sec counters, divide bps by 8 */ -- cgit v1.1 From 9dc3798253279a13ddaae6d6a04269f85c27de5b Mon Sep 17 00:00:00 2001 From: smos Date: Fri, 23 Jul 2010 10:28:02 +0200 Subject: Further correct week graph, weeks start at monday, not sunday. Make previous week work too. --- usr/local/www/status_rrd_graph.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'usr/local/www') diff --git a/usr/local/www/status_rrd_graph.php b/usr/local/www/status_rrd_graph.php index 770b61b..a3103f8 100755 --- a/usr/local/www/status_rrd_graph.php +++ b/usr/local/www/status_rrd_graph.php @@ -192,7 +192,7 @@ function get_dates($curperiod, $graph) { $curyear = date('Y', $now); $curmonth = date('m', $now); $curweek = date('W', $now); - $curweekday = date('w', $now); + $curweekday = date('N', $now) - 1; // We want to start on monday $curday = date('d', $now); switch($curperiod) { @@ -208,8 +208,16 @@ function get_dates($curperiod, $graph) { $end = mktime(0, 0, 0, $curmonth, (($curday + $offset) + 1), $curyear); break; case "week": - $start = mktime(0, 0, 0, $curmonth, (($curday - $curweekday) + $offset), $curyear); - $end = mktime(0, 0, 0, $curmonth, (($curday - $curweekday) + 7), $curyear); + switch($offset) { + case 0; + $weekoffset = 0; + break; + default: + $weekoffset = ($offset * 7) - 7; + break; + } + $start = mktime(0, 0, 0, $curmonth, (($curday - $curweekday) + $weekoffset), $curyear); + $end = mktime(0, 0, 0, $curmonth, (($curday - $curweekday) + $weekoffset + 7), $curyear); break; case "month": $start = mktime(0, 0, 0, ($curmonth + $offset), 0, $curyear); -- cgit v1.1 From 6b0c5ae66c89f75cca03895cb52769db9faa6836 Mon Sep 17 00:00:00 2001 From: smos Date: Fri, 23 Jul 2010 11:40:11 +0200 Subject: The custom graph option now works, this needs for a certain someone to integrate a nice date picker that updates the fields with the correct seconds. Add tab for VPN databases which we don't have yet. --- usr/local/www/status_rrd_graph.php | 126 +++++++++++++++++++++++-------------- 1 file changed, 79 insertions(+), 47 deletions(-) (limited to 'usr/local/www') diff --git a/usr/local/www/status_rrd_graph.php b/usr/local/www/status_rrd_graph.php index a3103f8..036a3b2 100755 --- a/usr/local/www/status_rrd_graph.php +++ b/usr/local/www/status_rrd_graph.php @@ -109,12 +109,22 @@ if ($_GET['option']) { continue 2; } } + case "vpn": + foreach($databases as $database) { + if(preg_match("/[-]vpn\.rrd/i", $database)) { + /* pick off the 1st database we find that matches the VPN graphs */ + $name = explode("-", $database); + $curoption = "$name[0]"; + continue 2; + } + } default: $curoption = "wan"; break; } } +$now = time(); if($curcat == "custom") { if (is_numeric($_GET['start'])) { if($start < ($now - (3600 * 24 * 365 * 5))) { @@ -157,6 +167,7 @@ $dbheader = array("allgraphs-traffic.rrd", "allgraphs-quality.rrd", "allgraphs-wireless.rrd", "allgraphs-cellular.rrd", + "allgraphs-vpn.rrd", "allgraphs-packets.rrd", "system-allgraphs.rrd", "system-throughput.rrd", @@ -174,6 +185,9 @@ foreach($databases as $database) { if(stristr($database, "cellular")) { $cellular = true; } + if(stristr($database, "vpn")) { + $vpn = true; + } } /* append the existing array to the header */ $ui_databases = array_merge($dbheader, $databases); @@ -276,6 +290,10 @@ function get_dates($curperiod, $graph) { if($curcat == "cellular") { $tabactive = True; } else { $tabactive = False; } $tab_array[] = array("Cellular", $tabactive, "status_rrd_graph.php?cat=cellular"); } + if($vpn) { + if($curcat == "vpn") { $tabactive = True; } else { $tabactive = False; } + $tab_array[] = array("VPN", $tabactive, "status_rrd_graph.php?cat=vpn"); + } if($curcat == "custom") { $tabactive = True; } else { $tabactive = False; } $tab_array[] = array("Custom", $tabactive, "status_rrd_graph.php?cat=custom"); if($curcat == "settings") { $tabactive = True; } else { $tabactive = False; } @@ -369,59 +387,73 @@ function get_dates($curperiod, $graph) { } } ?> - - + + + + + + \n"; + } + } else { + foreach($graphs as $graph) { + /* check which databases are valid for our category */ + foreach($ui_databases as $curdatabase) { + if(! preg_match("/($curcat)/i", $curdatabase)) { + continue; + } + $optionc = split("-", $curdatabase); + $search = array("-", ".rrd", $optionc); + $replace = array(" :: ", "", $friendly); + switch($curoption) { + case "outbound": + /* only show interfaces with a gateway */ + $optionc = "$optionc[0]"; + if(!interface_has_gateway($optionc)) { + if(!preg_match("/($optionc)-(quality)/", $curdatabase)) { + continue 2; + } + } + if(! preg_match("/($optionc)[-.]/i", $curdatabase)) { continue 2; } - } - if(! preg_match("/($optionc)[-.]/i", $curdatabase)) { - continue 2; - } - break; - case "allgraphs": - /* make sure we do not show the placeholder databases in the all view */ - if((stristr($curdatabase, "outbound")) || (stristr($curdatabase, "allgraphs"))) { - continue 2; - } - break; - default: - /* just use the name here */ - if(! preg_match("/($curoption)[-.]/i", $curdatabase)) { - continue 2; - } - } - if(in_array($curdatabase, $databases)) { - $dates = get_dates($curperiod, $graph); - $start = $dates['start']; - $end = $dates['end']; - echo "\n"; + break; + case "allgraphs": + /* make sure we do not show the placeholder databases in the all view */ + if((stristr($curdatabase, "outbound")) || (stristr($curdatabase, "allgraphs"))) { + continue 2; + } + break; + default: + /* just use the name here */ + if(! preg_match("/($curoption)[-.]/i", $curdatabase)) { + continue 2; + } + } + if(in_array($curdatabase, $databases)) { + $dates = get_dates($curperiod, $graph); + $start = $dates['start']; + $end = $dates['end']; + echo "\n"; + } } } } -- cgit v1.1 From edd2d8b736bb445880fb70f4413875d450a6ec54 Mon Sep 17 00:00:00 2001 From: smos Date: Fri, 23 Jul 2010 16:04:39 +0200 Subject: Add OpenVPN users database, sync the tabs on the settings page. Graphing page doesn't know about openvpn users yet. But that's ok. --- usr/local/www/status_rrd_graph.php | 26 ++++++++--------- usr/local/www/status_rrd_graph_settings.php | 43 +++++++++++++++++------------ 2 files changed, 38 insertions(+), 31 deletions(-) (limited to 'usr/local/www') diff --git a/usr/local/www/status_rrd_graph.php b/usr/local/www/status_rrd_graph.php index 036a3b2..08e2df3 100755 --- a/usr/local/www/status_rrd_graph.php +++ b/usr/local/www/status_rrd_graph.php @@ -109,9 +109,9 @@ if ($_GET['option']) { continue 2; } } - case "vpn": + case "vpnusers": foreach($databases as $database) { - if(preg_match("/[-]vpn\.rrd/i", $database)) { + if(preg_match("/[-]vpnusers\.rrd/i", $database)) { /* pick off the 1st database we find that matches the VPN graphs */ $name = explode("-", $database); $curoption = "$name[0]"; @@ -167,7 +167,7 @@ $dbheader = array("allgraphs-traffic.rrd", "allgraphs-quality.rrd", "allgraphs-wireless.rrd", "allgraphs-cellular.rrd", - "allgraphs-vpn.rrd", + "allgraphs-vpnusers.rrd", "allgraphs-packets.rrd", "system-allgraphs.rrd", "system-throughput.rrd", @@ -176,17 +176,17 @@ $dbheader = array("allgraphs-traffic.rrd", "outbound-traffic.rrd"); foreach($databases as $database) { - if(stristr($database, "wireless")) { + if(stristr($database, "-wireless")) { $wireless = true; } - if(stristr($database, "queues")) { + if(stristr($database, "-queues")) { $queues = true; } - if(stristr($database, "cellular")) { + if(stristr($database, "-cellular")) { $cellular = true; } - if(stristr($database, "vpn")) { - $vpn = true; + if(stristr($database, "-vpnusers")) { + $vpnusers = true; } } /* append the existing array to the header */ @@ -278,9 +278,9 @@ function get_dates($curperiod, $graph) { $tab_array[] = array("Quality", $tabactive, "status_rrd_graph.php?cat=quality"); if($queues) { if($curcat == "queues") { $tabactive = True; } else { $tabactive = False; } - $tab_array[] = array("Queues", $tabactive, "status_rrd_graph.php?cat=queues"); + $tab_array[] = array("Queues", $tabactive, "status_rrd_graph.php?cat=queues"); if($curcat == "queuedrops") { $tabactive = True; } else { $tabactive = False; } - $tab_array[] = array("QueueDrops", $tabactive, "status_rrd_graph.php?cat=queuedrops"); + $tab_array[] = array("QueueDrops", $tabactive, "status_rrd_graph.php?cat=queuedrops"); } if($wireless) { if($curcat == "wireless") { $tabactive = True; } else { $tabactive = False; } @@ -290,9 +290,9 @@ function get_dates($curperiod, $graph) { if($curcat == "cellular") { $tabactive = True; } else { $tabactive = False; } $tab_array[] = array("Cellular", $tabactive, "status_rrd_graph.php?cat=cellular"); } - if($vpn) { - if($curcat == "vpn") { $tabactive = True; } else { $tabactive = False; } - $tab_array[] = array("VPN", $tabactive, "status_rrd_graph.php?cat=vpn"); + if($vpnusers) { + if($curcat == "vpnusers") { $tabactive = True; } else { $tabactive = False; } + $tab_array[] = array("VPN", $tabactive, "status_rrd_graph.php?cat=vpnusers"); } if($curcat == "custom") { $tabactive = True; } else { $tabactive = False; } $tab_array[] = array("Custom", $tabactive, "status_rrd_graph.php?cat=custom"); diff --git a/usr/local/www/status_rrd_graph_settings.php b/usr/local/www/status_rrd_graph_settings.php index d1398c4..7f8d4ae 100755 --- a/usr/local/www/status_rrd_graph_settings.php +++ b/usr/local/www/status_rrd_graph_settings.php @@ -106,32 +106,39 @@ include("head.inc"); -- cgit v1.1 From 8aa09d6d344bbad31a21cf62cf618ec77182b6a5 Mon Sep 17 00:00:00 2001 From: Chris Buechler Date: Fri, 23 Jul 2010 18:30:13 -0400 Subject: remove empty note, redirect to correct page --- usr/local/www/services_rfc2136.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'usr/local/www') diff --git a/usr/local/www/services_rfc2136.php b/usr/local/www/services_rfc2136.php index 80edc0b..a8e9913 100644 --- a/usr/local/www/services_rfc2136.php +++ b/usr/local/www/services_rfc2136.php @@ -48,7 +48,7 @@ if ($_GET['act'] == "del") { write_config(); - header("Location: services_dyndns.php"); + header("Location: services_rfc2136.php"); exit; } @@ -105,9 +105,9 @@ include("head.inc"); -- cgit v1.1 From 3869a323ffa9507de3d2422e0a2349015f86a66e Mon Sep 17 00:00:00 2001 From: smos Date: Sat, 24 Jul 2010 21:40:22 +0200 Subject: Add the openvpn users graph, add the colors to all the themes colors include. Add vpn tab on the settings page, it didn't show although it should. --- usr/local/www/status_rrd_graph_img.php | 20 ++++++++++++++++++++ usr/local/www/status_rrd_graph_settings.php | 9 +++++++-- usr/local/www/themes/code-red/rrdcolors.inc.php | 1 + usr/local/www/themes/metallic/rrdcolors.inc.php | 1 + usr/local/www/themes/nervecenter/rrdcolors.inc.php | 1 + .../www/themes/pfsense-dropdown/rrdcolors.inc.php | 1 + usr/local/www/themes/pfsense/rrdcolors.inc.php | 1 + usr/local/www/themes/pfsense_ng/rrdcolors.inc.php | 1 + usr/local/www/themes/the_wall/rrdcolors.inc.php | 1 + 9 files changed, 34 insertions(+), 2 deletions(-) (limited to 'usr/local/www') diff --git a/usr/local/www/status_rrd_graph_img.php b/usr/local/www/status_rrd_graph_img.php index 321e6f9..89baadd 100644 --- a/usr/local/www/status_rrd_graph_img.php +++ b/usr/local/www/status_rrd_graph_img.php @@ -206,6 +206,7 @@ if(file_exists($rrdcolors)) { $colorwireless = array('333333','a83c3c','999999'); $colorspamdtime = array('DDDDFF', 'AAAAFF', 'DDDDFF', '000066'); $colorspamdconn = array('00AA00BB', 'FFFFFFFF', '00660088', 'FFFFFF88', '006600'); + $colorvpnusers = array('990000'); } switch ($curstyle) { @@ -571,6 +572,25 @@ elseif((strstr($curdatabase, "-wireless.rrd")) && (file_exists("$rrddbpath$curda $graphcmd .= "COMMENT:\"\\n\" "; $graphcmd .= "COMMENT:\"\t\t\t\t\t\t\t\t\t\t\t\t\t`date +\"%b %d %H\:%M\:%S %Y\"`\" "; } +elseif((strstr($curdatabase, "-vpnusers.rrd")) && (file_exists("$rrddbpath$curdatabase"))) { + /* define graphcmd for vpn users stats */ + $graphcmd = "$rrdtool graph $rrdtmppath$curdatabase-$curgraph.png "; + $graphcmd .= "--start $start --end $end "; + $graphcmd .= "--vertical-label \"users\" "; + $graphcmd .= "--color SHADEA#eeeeee --color SHADEB#eeeeee "; + $graphcmd .= "--title \"`hostname` - {$prettydb} - {$hperiod} - {$havg} average\" "; + $graphcmd .= "--height 200 --width 620 "; + $graphcmd .= "DEF:\"$curif-users=$rrddbpath$curdatabase:users:AVERAGE\" "; + $graphcmd .= "LINE2:\"$curif-users#{$colorvpnusers[0]}:$curif-users\" "; + $graphcmd .= "COMMENT:\"\\n\" "; + $graphcmd .= "COMMENT:\"\t\t\t maximum\t\t average\t current\\n\" "; + $graphcmd .= "COMMENT:\"Users Online\t\" "; + $graphcmd .= "GPRINT:\"$curif-users:MAX:%7.2lf \" "; + $graphcmd .= "GPRINT:\"$curif-users:AVERAGE:%7.2lf \" "; + $graphcmd .= "GPRINT:\"$curif-users:LAST:%7.2lf \" "; + $graphcmd .= "COMMENT:\"\\n\" "; + $graphcmd .= "COMMENT:\"\t\t\t\t\t\t\t\t\t\t\t\t\t`date +\"%b %d %H\:%M\:%S %Y\"`\" "; +} elseif((strstr($curdatabase, "-states.rrd")) && (file_exists("$rrddbpath$curdatabase"))) { /* define graphcmd for states stats */ $graphcmd = "$rrdtool graph $rrdtmppath$curdatabase-$curgraph.png "; diff --git a/usr/local/www/status_rrd_graph_settings.php b/usr/local/www/status_rrd_graph_settings.php index 7f8d4ae..cfd1a0e 100755 --- a/usr/local/www/status_rrd_graph_settings.php +++ b/usr/local/www/status_rrd_graph_settings.php @@ -77,9 +77,11 @@ if ($_POST) { } } + + $rrddbpath = "/var/db/rrd/"; -/* XXX: (billm) do we have an exec() type function that does this type of thing? */ -exec("cd $rrddbpath;/usr/bin/find -name *.rrd", $databases); +chdir($rrddbpath); +$databases = glob("*.rrd"); foreach($databases as $database) { if(stristr($database, "wireless")) { @@ -91,6 +93,9 @@ foreach($databases as $database) { if(stristr($database, "cellular")) { $cellular = true; } + if(stristr($database, "-vpnusers")) { + $vpnusers = true; + } } $pgtitle = array("Status","RRD Graphs"); diff --git a/usr/local/www/themes/code-red/rrdcolors.inc.php b/usr/local/www/themes/code-red/rrdcolors.inc.php index cbd6a8d..1ab0fd0 100755 --- a/usr/local/www/themes/code-red/rrdcolors.inc.php +++ b/usr/local/www/themes/code-red/rrdcolors.inc.php @@ -46,5 +46,6 @@ $colorqualityloss = "ee0000"; $colorwireless = array('990000','a83c3c','b36666'); $colorspamdtime = array('DDDDFF', 'AAAAFF', 'DDDDFF', '000066'); $colorspamdconn = array('00AA00BB', 'FFFFFFFF', '00660088', 'FFFFFF88', '006600'); +$colorvpnusers = array('990000'); ?> diff --git a/usr/local/www/themes/metallic/rrdcolors.inc.php b/usr/local/www/themes/metallic/rrdcolors.inc.php index e3153fd..8e74545 100644 --- a/usr/local/www/themes/metallic/rrdcolors.inc.php +++ b/usr/local/www/themes/metallic/rrdcolors.inc.php @@ -46,5 +46,6 @@ $colorqualityloss = "ee0000"; $colorwireless = array('333333','a83c3c','999999'); $colorspamdtime = array('DDDDFF', 'AAAAFF', 'DDDDFF', '000066'); $colorspamdconn = array('00AA00BB', 'FFFFFFFF', '00660088', 'FFFFFF88', '006600'); +$colorvpnusers = array('990000'); ?> diff --git a/usr/local/www/themes/nervecenter/rrdcolors.inc.php b/usr/local/www/themes/nervecenter/rrdcolors.inc.php index e3153fd..8e74545 100644 --- a/usr/local/www/themes/nervecenter/rrdcolors.inc.php +++ b/usr/local/www/themes/nervecenter/rrdcolors.inc.php @@ -46,5 +46,6 @@ $colorqualityloss = "ee0000"; $colorwireless = array('333333','a83c3c','999999'); $colorspamdtime = array('DDDDFF', 'AAAAFF', 'DDDDFF', '000066'); $colorspamdconn = array('00AA00BB', 'FFFFFFFF', '00660088', 'FFFFFF88', '006600'); +$colorvpnusers = array('990000'); ?> diff --git a/usr/local/www/themes/pfsense-dropdown/rrdcolors.inc.php b/usr/local/www/themes/pfsense-dropdown/rrdcolors.inc.php index e3153fd..8e74545 100644 --- a/usr/local/www/themes/pfsense-dropdown/rrdcolors.inc.php +++ b/usr/local/www/themes/pfsense-dropdown/rrdcolors.inc.php @@ -46,5 +46,6 @@ $colorqualityloss = "ee0000"; $colorwireless = array('333333','a83c3c','999999'); $colorspamdtime = array('DDDDFF', 'AAAAFF', 'DDDDFF', '000066'); $colorspamdconn = array('00AA00BB', 'FFFFFFFF', '00660088', 'FFFFFF88', '006600'); +$colorvpnusers = array('990000'); ?> diff --git a/usr/local/www/themes/pfsense/rrdcolors.inc.php b/usr/local/www/themes/pfsense/rrdcolors.inc.php index e3153fd..8e74545 100644 --- a/usr/local/www/themes/pfsense/rrdcolors.inc.php +++ b/usr/local/www/themes/pfsense/rrdcolors.inc.php @@ -46,5 +46,6 @@ $colorqualityloss = "ee0000"; $colorwireless = array('333333','a83c3c','999999'); $colorspamdtime = array('DDDDFF', 'AAAAFF', 'DDDDFF', '000066'); $colorspamdconn = array('00AA00BB', 'FFFFFFFF', '00660088', 'FFFFFF88', '006600'); +$colorvpnusers = array('990000'); ?> diff --git a/usr/local/www/themes/pfsense_ng/rrdcolors.inc.php b/usr/local/www/themes/pfsense_ng/rrdcolors.inc.php index e3153fd..8e74545 100644 --- a/usr/local/www/themes/pfsense_ng/rrdcolors.inc.php +++ b/usr/local/www/themes/pfsense_ng/rrdcolors.inc.php @@ -46,5 +46,6 @@ $colorqualityloss = "ee0000"; $colorwireless = array('333333','a83c3c','999999'); $colorspamdtime = array('DDDDFF', 'AAAAFF', 'DDDDFF', '000066'); $colorspamdconn = array('00AA00BB', 'FFFFFFFF', '00660088', 'FFFFFF88', '006600'); +$colorvpnusers = array('990000'); ?> diff --git a/usr/local/www/themes/the_wall/rrdcolors.inc.php b/usr/local/www/themes/the_wall/rrdcolors.inc.php index e3153fd..8e74545 100644 --- a/usr/local/www/themes/the_wall/rrdcolors.inc.php +++ b/usr/local/www/themes/the_wall/rrdcolors.inc.php @@ -46,5 +46,6 @@ $colorqualityloss = "ee0000"; $colorwireless = array('333333','a83c3c','999999'); $colorspamdtime = array('DDDDFF', 'AAAAFF', 'DDDDFF', '000066'); $colorspamdconn = array('00AA00BB', 'FFFFFFFF', '00660088', 'FFFFFF88', '006600'); +$colorvpnusers = array('990000'); ?> -- cgit v1.1 From 6216690bf06f77d39559445bb8f2da42f255e54c Mon Sep 17 00:00:00 2001 From: smos Date: Sat, 24 Jul 2010 22:10:43 +0200 Subject: Correct my email address, adjust copyright to 2010 --- usr/local/www/diag_logs_relayd.php | 2 +- usr/local/www/status_gateway_groups.php | 2 +- usr/local/www/status_gateways.php | 2 +- usr/local/www/status_lb_pool.php | 2 +- usr/local/www/status_lb_vs.php | 2 +- usr/local/www/status_rrd_graph.php | 2 +- usr/local/www/status_rrd_graph_img.php | 2 +- usr/local/www/status_rrd_graph_settings.php | 2 +- usr/local/www/status_upnp.php | 2 +- usr/local/www/system_gateway_groups.php | 2 +- usr/local/www/system_gateway_groups_edit.php | 2 +- usr/local/www/system_gateways.php | 2 +- usr/local/www/system_gateways_edit.php | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) (limited to 'usr/local/www') diff --git a/usr/local/www/diag_logs_relayd.php b/usr/local/www/diag_logs_relayd.php index 8ce35b8..57df0e1 100755 --- a/usr/local/www/diag_logs_relayd.php +++ b/usr/local/www/diag_logs_relayd.php @@ -5,7 +5,7 @@ part of pfSense Copyright (C) 2008 Bill Marquette . - Copyright (C) 2008 Seth Mos . + Copyright (C) 2008 Seth Mos . All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/usr/local/www/status_gateway_groups.php b/usr/local/www/status_gateway_groups.php index 5ed4aa9..2a91b77 100755 --- a/usr/local/www/status_gateway_groups.php +++ b/usr/local/www/status_gateway_groups.php @@ -4,7 +4,7 @@ status_gateway_groups.php part of pfSense (http://pfsense.com) - Copyright (C) 2007 Seth Mos . + Copyright (C) 2010 Seth Mos . All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/usr/local/www/status_gateways.php b/usr/local/www/status_gateways.php index 72e14b2..bffdb3b 100755 --- a/usr/local/www/status_gateways.php +++ b/usr/local/www/status_gateways.php @@ -4,7 +4,7 @@ status_gateways.php part of pfSense (http://www.pfsense.com/) - Copyright (C) 2006 Seth Mos . + Copyright (C) 2010 Seth Mos . All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/usr/local/www/status_lb_pool.php b/usr/local/www/status_lb_pool.php index 18b4c57..5a87e35 100755 --- a/usr/local/www/status_lb_pool.php +++ b/usr/local/www/status_lb_pool.php @@ -4,7 +4,7 @@ status_lb_pool.php part of pfSense (http://www.pfsense.com/) - Copyright (C) 2006 Seth Mos . + Copyright (C) 2010 Seth Mos . All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/usr/local/www/status_lb_vs.php b/usr/local/www/status_lb_vs.php index 0589425..5d74cf3 100755 --- a/usr/local/www/status_lb_vs.php +++ b/usr/local/www/status_lb_vs.php @@ -4,7 +4,7 @@ status_lb_vs.php part of pfSense (http://www.pfsense.com/) - Copyright (C) 2007 Seth Mos . + Copyright (C) 2010 Seth Mos . All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/usr/local/www/status_rrd_graph.php b/usr/local/www/status_rrd_graph.php index 08e2df3..97454c9 100755 --- a/usr/local/www/status_rrd_graph.php +++ b/usr/local/www/status_rrd_graph.php @@ -3,7 +3,7 @@ /* status_rrd_graph.php Part of pfSense - Copyright (C) 2007 Seth Mos + Copyright (C) 2007 Seth Mos All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/usr/local/www/status_rrd_graph_img.php b/usr/local/www/status_rrd_graph_img.php index 89baadd..c559d3d 100644 --- a/usr/local/www/status_rrd_graph_img.php +++ b/usr/local/www/status_rrd_graph_img.php @@ -3,7 +3,7 @@ /* status_rrd_graph_img.php Part of pfSense - Copyright (C) 2009 Seth Mos + Copyright (C) 2009 Seth Mos All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/usr/local/www/status_rrd_graph_settings.php b/usr/local/www/status_rrd_graph_settings.php index cfd1a0e..b173e00 100755 --- a/usr/local/www/status_rrd_graph_settings.php +++ b/usr/local/www/status_rrd_graph_settings.php @@ -3,7 +3,7 @@ /* status_rrd_graph.php Part of pfSense - Copyright (C) 2007 Seth Mos + Copyright (C) 2007 Seth Mos All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/usr/local/www/status_upnp.php b/usr/local/www/status_upnp.php index 024633f..e5908d3 100644 --- a/usr/local/www/status_upnp.php +++ b/usr/local/www/status_upnp.php @@ -4,7 +4,7 @@ status_upnp.php part of pfSense (http://www.pfsense.com/) - Copyright (C) 2006 Seth Mos . + Copyright (C) 2010 Seth Mos . All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/usr/local/www/system_gateway_groups.php b/usr/local/www/system_gateway_groups.php index 43dfea7..f767aff 100755 --- a/usr/local/www/system_gateway_groups.php +++ b/usr/local/www/system_gateway_groups.php @@ -4,7 +4,7 @@ system_gateway_groups.php part of pfSense (http://pfsense.com) - Copyright (C) 2007 Seth Mos . + Copyright (C) 2010 Seth Mos . All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/usr/local/www/system_gateway_groups_edit.php b/usr/local/www/system_gateway_groups_edit.php index 1a504c5..268a5da 100755 --- a/usr/local/www/system_gateway_groups_edit.php +++ b/usr/local/www/system_gateway_groups_edit.php @@ -4,7 +4,7 @@ system_gateway_groups_edit.php part of pfSense (http://pfsense.com) - Copyright (C) 2007 Seth Mos . + Copyright (C) 2010 Seth Mos . All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/usr/local/www/system_gateways.php b/usr/local/www/system_gateways.php index 82004a7..d789d76 100755 --- a/usr/local/www/system_gateways.php +++ b/usr/local/www/system_gateways.php @@ -4,7 +4,7 @@ system_gateways.php part of pfSense (http://pfsense.com) - Copyright (C) 2007 Seth Mos . + Copyright (C) 2010 Seth Mos . All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/usr/local/www/system_gateways_edit.php b/usr/local/www/system_gateways_edit.php index 98d1e81..e679b90 100755 --- a/usr/local/www/system_gateways_edit.php +++ b/usr/local/www/system_gateways_edit.php @@ -4,7 +4,7 @@ system_gateways_edit.php part of pfSense (http://pfsense.com) - Copyright (C) 2007 Seth Mos . + Copyright (C) 2010 Seth Mos . All rights reserved. Redistribution and use in source and binary forms, with or without -- cgit v1.1 From 36b03cc70e4318391a096825421532e26ccfc66d Mon Sep 17 00:00:00 2001 From: Chris Buechler Date: Sun, 25 Jul 2010 15:08:07 -0400 Subject: Use more appropriate advice here for community string --- usr/local/www/services_snmp.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'usr/local/www') diff --git a/usr/local/www/services_snmp.php b/usr/local/www/services_snmp.php index 9540d98..a9f8b7b 100755 --- a/usr/local/www/services_snmp.php +++ b/usr/local/www/services_snmp.php @@ -290,7 +290,7 @@ function enable_change(whichone) { -- cgit v1.1 From 09fec59d1abbfa403aa4d6808403070938a32f3b Mon Sep 17 00:00:00 2001 From: jim-p Date: Tue, 27 Jul 2010 08:56:19 -0400 Subject: Fix path to dhcpd.conf in status.php --- usr/local/www/status.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'usr/local/www') diff --git a/usr/local/www/status.php b/usr/local/www/status.php index bc2656d..d1985e3 100755 --- a/usr/local/www/status.php +++ b/usr/local/www/status.php @@ -168,7 +168,7 @@ defCmdT("pftop -w 150 -a -b -v speed","/usr/local/sbin/pftop -w 150 -a -b -v spe defCmdT("resolv.conf","cat /etc/resolv.conf"); defCmdT("Processes","ps xauww"); -defCmdT("dhcpd.conf","cat /var/etc/dhcpd.conf"); +defCmdT("dhcpd.conf","cat /var/dhcpd/etc/dhcpd.conf"); defCmdT("ez-ipupdate.cache","cat /conf/ez-ipupdate.cache"); defCmdT("df","/bin/df"); -- cgit v1.1 From 1ca3ccd499f05ba77c1334490f3461591a788785 Mon Sep 17 00:00:00 2001 From: jim-p Date: Tue, 27 Jul 2010 09:16:41 -0400 Subject: Fix test for checking the prefer old IPsec SA box. --- usr/local/www/system_advanced_misc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'usr/local/www') diff --git a/usr/local/www/system_advanced_misc.php b/usr/local/www/system_advanced_misc.php index 41f0979..1bdefe9 100644 --- a/usr/local/www/system_advanced_misc.php +++ b/usr/local/www/system_advanced_misc.php @@ -224,7 +224,7 @@ include("head.inc"); + + + +
Carp Interface
CARP Interface
Virtual IP
Status
IP address +
IP address
\n"; + echo "\"$prettydb\n"; + echo "


\n"; + echo "
\n"; - echo "\"$prettydb\n"; - echo "


\n"; - echo "
\n"; + echo "\"$prettydb\n"; + echo "


\n"; + echo "

- Note:
+
- Add something meaningful here. +

 
Read Community String -
In most cases, "public" is used here
+
The community string is like a password, restricting access to querying SNMP to hosts knowing the community string. Use a strong value here to protect from unauthorized information disclosure.
- /> + />
Date: Tue, 27 Jul 2010 19:15:39 +0000 Subject: Fixes #745. Validate group name against existing interfaces. --- usr/local/www/interfaces_groups_edit.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'usr/local/www') diff --git a/usr/local/www/interfaces_groups_edit.php b/usr/local/www/interfaces_groups_edit.php index 51feffd..430bd7b 100755 --- a/usr/local/www/interfaces_groups_edit.php +++ b/usr/local/www/interfaces_groups_edit.php @@ -71,6 +71,11 @@ if ($_POST) { if (preg_match("/([^a-zA-Z])+/", $_POST['ifname'], $match)) $input_errors[] = "Only letters A-Z are allowed as the group name."; + $ifaces = get_configured_interface_with_descr(); + foreach ($ifaces as $gif => $gdescr) { + if ($gdescr == $_POST['ifname'] || $gif == $_POST['ifname']) + $input_errors[] = "The specified group name is already used by an interface. Please choose another name."; + } $ifgroupentry = array(); $ifgroupentry['ifname'] = $_POST['ifname']; $members = ""; -- cgit v1.1 From db0bfe367b078ce68050fb359e5ce73a9055ede7 Mon Sep 17 00:00:00 2001 From: Ermal Date: Tue, 27 Jul 2010 21:42:45 +0000 Subject: Do not blacklist radius for authentication method on the webGUI. --- usr/local/www/system_usermanager_settings.php | 2 -- 1 file changed, 2 deletions(-) (limited to 'usr/local/www') diff --git a/usr/local/www/system_usermanager_settings.php b/usr/local/www/system_usermanager_settings.php index 352d5cc..0a52028 100755 --- a/usr/local/www/system_usermanager_settings.php +++ b/usr/local/www/system_usermanager_settings.php @@ -136,8 +136,6 @@ if(!$pconfig['backend']) Date: Tue, 27 Jul 2010 20:00:06 -0400 Subject: Allow setting page items such as /services_captiveportal.php which signals the GUI that the contents of the page are being controlled from a remote machine and disallow the GUI page from being edited. --- usr/local/www/head.inc | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'usr/local/www') diff --git a/usr/local/www/head.inc b/usr/local/www/head.inc index 3b1f028..076f274 100755 --- a/usr/local/www/head.inc +++ b/usr/local/www/head.inc @@ -76,4 +76,17 @@ $pagetitle = gentitle( $pgtitle ); if (!isset($closehead)) echo ""; + +/* If this page is being remotely managed then do not allow the loading of the contents. */ +if($config['remote_managed_pages']['item']) { + foreach($config['remote_managed_pages']['item'] as $rmp) { + if($rmp == $_SERVER['SCRIPT_NAME']) { + include("fbegin.inc"); + print_info_box_np("This page is currently being managed by a remote machine."); + include("fend.inc"); + exit; + } + } +} + ?> \ No newline at end of file -- cgit v1.1 From cf652f81e5f83b6aa71830e452b5d583d4de7db7 Mon Sep 17 00:00:00 2001 From: Chris Buechler Date: Tue, 27 Jul 2010 20:32:31 -0400 Subject: add patch from vcoque to fix gettext --- usr/local/www/diag_nanobsd.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'usr/local/www') diff --git a/usr/local/www/diag_nanobsd.php b/usr/local/www/diag_nanobsd.php index 3409a34..db96484 100755 --- a/usr/local/www/diag_nanobsd.php +++ b/usr/local/www/diag_nanobsd.php @@ -67,10 +67,11 @@ nanobsd_detect_slice_info(); $NANOBSD_SIZE = nanobsd_get_size(); if($_POST['bootslice']) { + $statusmsg = gettext("Setting slice information, please wait..."); echo << - gettext("Setting slice information, please wait...") + $statusmsg

  EOF; @@ -82,10 +83,11 @@ EOF; } if($_POST['destslice']) { + $statusmsg = gettext("Duplicating slice. Please wait, this will take a moment..."); echo << - gettext("Duplicating slice. Please wait, this will take a moment...") + $statusmsg

  EOF; -- cgit v1.1 From 23b517ab6033db36a08b3f22f530122ec98aabd9 Mon Sep 17 00:00:00 2001 From: Chris Buechler Date: Wed, 28 Jul 2010 03:18:23 -0400 Subject: fix several cosmetic issues. add an icon type for the "both" direction, fix icons for other directions --- usr/local/www/services_captiveportal_ip.php | 26 ++++++++++++++++++------ usr/local/www/services_captiveportal_ip_edit.php | 4 ++-- 2 files changed, 22 insertions(+), 8 deletions(-) (limited to 'usr/local/www') diff --git a/usr/local/www/services_captiveportal_ip.php b/usr/local/www/services_captiveportal_ip.php index 1979519..171f583 100755 --- a/usr/local/www/services_captiveportal_ip.php +++ b/usr/local/www/services_captiveportal_ip.php @@ -115,13 +115,23 @@ include("head.inc");

- "; + "; + } + if($ip['dir'] == "both") { + echo " "; + } + echo strtolower($ip['ip']); + if($ip['sn'] != "32" && is_numeric($ip['sn'])) { + $sn = $ip['sn']; + echo "/$sn"; + } + if($ip['dir'] == "from") { + echo " any"; + } + ?> - - any"; - ?>   @@ -158,6 +168,10 @@ include("head.inc"); x.x.x.x any    All connections from the IP address are allowed
     All connections to and from the IP address are allowed
  diff --git a/usr/local/www/services_captiveportal_ip_edit.php b/usr/local/www/services_captiveportal_ip_edit.php index 633900d..e6eab55 100755 --- a/usr/local/www/services_captiveportal_ip_edit.php +++ b/usr/local/www/services_captiveportal_ip_edit.php @@ -174,13 +174,13 @@ include("head.inc"); IP address - = 1; $i--): ?>
- IP address + IP address and subnet mask. Use /32 for a single IP. Description -- cgit v1.1 From 8e2986f8486237a964aa0890d335596a4da30c41 Mon Sep 17 00:00:00 2001 From: Ermal Date: Wed, 28 Jul 2010 12:31:16 +0000 Subject: Fixes #761. Correctly bring down/up all vips based on the button click in the webGUI. --- usr/local/www/carp_status.php | 41 ++++++++++++++++++++++++++++++++++------- 1 file changed, 34 insertions(+), 7 deletions(-) (limited to 'usr/local/www') diff --git a/usr/local/www/carp_status.php b/usr/local/www/carp_status.php index 44dee95..15502b9 100755 --- a/usr/local/www/carp_status.php +++ b/usr/local/www/carp_status.php @@ -55,18 +55,45 @@ if($_POST['disablecarp'] <> "") { if($status == true) { $carp_ints = get_all_carp_interfaces(); mwexec("/sbin/sysctl net.inet.carp.allow=0"); - $carp_counter = find_number_of_created_carp_interfaces(); - if (is_array($carp_ints)) { - foreach($carp_ints as $int) { - mwexec("/sbin/ifconfig $int down"); - mwexec("/sbin/ifconfig $int destroy"); - } - } + if(is_array($config['virtualip']['vip'])) { + $viparr = &$config['virtualip']['vip']; + foreach ($viparr as $vip) { + if (in_array($vip['carpif'], $carps)) { + switch ($vip['mode']) { + case "carp": + interface_vip_bring_down($vip); + sleep(1); + break; + case "carpdev-dhcp": + interface_vip_bring_down($vip); + sleep(1); + break; + } + } + } + } $savemsg = "{$carp_counter} IPs have been disabled."; } else { $savemsg = "CARP has been enabled."; mwexec("/sbin/sysctl net.inet.carp.allow=1"); interfaces_carp_setup(); + if(is_array($config['virtualip']['vip'])) { + $viparr = &$config['virtualip']['vip']; + foreach ($viparr as $vip) { + if (in_array($vip['carpif'], $carps)) { + switch ($vip['mode']) { + case "carp": + interface_carp_configure($vip); + sleep(1); + break; + case "carpdev-dhcp": + interface_carpdev_configure($vip); + sleep(1); + break; + } + } + } + } } } -- cgit v1.1 From a133bb38b2bee410bcefa8b22f8df758bca4c26f Mon Sep 17 00:00:00 2001 From: Ermal Date: Wed, 28 Jul 2010 12:35:02 +0000 Subject: Fixes #761. Remove some wrong copy/pasto code. --- usr/local/www/carp_status.php | 42 +++++++++++++++++++----------------------- 1 file changed, 19 insertions(+), 23 deletions(-) (limited to 'usr/local/www') diff --git a/usr/local/www/carp_status.php b/usr/local/www/carp_status.php index 15502b9..8693625 100755 --- a/usr/local/www/carp_status.php +++ b/usr/local/www/carp_status.php @@ -58,18 +58,16 @@ if($_POST['disablecarp'] <> "") { if(is_array($config['virtualip']['vip'])) { $viparr = &$config['virtualip']['vip']; foreach ($viparr as $vip) { - if (in_array($vip['carpif'], $carps)) { - switch ($vip['mode']) { - case "carp": - interface_vip_bring_down($vip); - sleep(1); - break; - case "carpdev-dhcp": - interface_vip_bring_down($vip); - sleep(1); - break; - } - } + switch ($vip['mode']) { + case "carp": + interface_vip_bring_down($vip); + sleep(1); + break; + case "carpdev-dhcp": + interface_vip_bring_down($vip); + sleep(1); + break; + } } } $savemsg = "{$carp_counter} IPs have been disabled."; @@ -80,17 +78,15 @@ if($_POST['disablecarp'] <> "") { if(is_array($config['virtualip']['vip'])) { $viparr = &$config['virtualip']['vip']; foreach ($viparr as $vip) { - if (in_array($vip['carpif'], $carps)) { - switch ($vip['mode']) { - case "carp": - interface_carp_configure($vip); - sleep(1); - break; - case "carpdev-dhcp": - interface_carpdev_configure($vip); - sleep(1); - break; - } + switch ($vip['mode']) { + case "carp": + interface_carp_configure($vip); + sleep(1); + break; + case "carpdev-dhcp": + interface_carpdev_configure($vip); + sleep(1); + break; } } } -- cgit v1.1 From b0c231e4f391f57ca7c20e2bd823bb585f131a2f Mon Sep 17 00:00:00 2001 From: jim-p Date: Wed, 28 Jul 2010 13:41:11 -0400 Subject: Don't maintain a membership for the 'all' group when it includes everyone. Just return it for everyone if the 'all' group is requested. For the count of the 'all' group, just return a count of all the users on the system. Fixes #613 --- usr/local/www/system_groupmanager.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'usr/local/www') diff --git a/usr/local/www/system_groupmanager.php b/usr/local/www/system_groupmanager.php index 8b5c3c3..37c5ec3 100644 --- a/usr/local/www/system_groupmanager.php +++ b/usr/local/www/system_groupmanager.php @@ -412,6 +412,9 @@ function presubmit() { $grpimg = "/themes/{$g['theme']}/images/icons/icon_system-group-grey.png"; else $grpimg = "/themes/{$g['theme']}/images/icons/icon_system-group.png"; + $groupcount = count($group['member']); + if ($group["name"] == "all") + $groupcount = count($config['system']['user']); ?> @@ -431,7 +434,7 @@ function presubmit() {   - + -- cgit v1.1 From e4603932bc3fd4b716e2034e79fcd003a52efce2 Mon Sep 17 00:00:00 2001 From: Erik Fonnesbeck Date: Wed, 28 Jul 2010 14:35:22 -0600 Subject: Change wireless configuration heading to be more specific. --- usr/local/www/interfaces.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'usr/local/www') diff --git a/usr/local/www/interfaces.php b/usr/local/www/interfaces.php index 7d3a548..ca8a000 100755 --- a/usr/local/www/interfaces.php +++ b/usr/local/www/interfaces.php @@ -1615,7 +1615,7 @@ $types = array("none" => "None", "static" => "Static", "dhcp" => "DHCP", "ppp" = - Wireless configuration + Network-specific wireless configuration Mode -- cgit v1.1 From f62c44d8ed46f830d6c581e3f3adf1e4f732f4fb Mon Sep 17 00:00:00 2001 From: Erik Fonnesbeck Date: Wed, 28 Jul 2010 14:55:44 -0600 Subject: Add a checkbox to make syncing shared wireless settings to a central area optional. --- usr/local/www/interfaces.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'usr/local/www') diff --git a/usr/local/www/interfaces.php b/usr/local/www/interfaces.php index ca8a000..8822262 100755 --- a/usr/local/www/interfaces.php +++ b/usr/local/www/interfaces.php @@ -228,6 +228,7 @@ if (isset($wancfg['wireless'])) { $wl_regdomains_attr = &$wl_regdomain_xml_attr['regulatory-domains']['rd']; $wl_countries = &$wl_regdomain_xml['country-codes']['country']; $wl_countries_attr = &$wl_regdomain_xml_attr['country-codes']['country']; + $pconfig['persistcommonwireless'] = isset($config['wireless']['interfaces'][$wlanbaseif]); $pconfig['standard'] = $wancfg['wireless']['standard']; $pconfig['mode'] = $wancfg['wireless']['mode']; $pconfig['protmode'] = $wancfg['wireless']['protmode']; @@ -666,7 +667,7 @@ if ($_POST) { } // end if($_POST) function handle_wireless_post() { - global $_POST, $config, $g, $wancfg, $if, $wl_countries_attr; + global $_POST, $config, $g, $wancfg, $if, $wl_countries_attr, $wlanbaseif; if (!is_array($wancfg['wireless'])) $wancfg['wireless'] = array(); $wancfg['wireless']['standard'] = $_POST['standard']; @@ -702,6 +703,11 @@ function handle_wireless_post() { $wancfg['wireless']['auth_server_addr'] = $_POST['auth_server_addr']; $wancfg['wireless']['auth_server_port'] = $_POST['auth_server_port']; $wancfg['wireless']['auth_server_shared_secret'] = $_POST['auth_server_shared_secret']; + if ($_POST['persistcommonwireless'] == "yes") { + if (!is_array($config['wireless']['interfaces'][$wlanbaseif])) + $config['wireless']['interfaces'][$wlanbaseif] = array(); + } else if (isset($config['wireless']['interfaces'][$wlanbaseif])) + unset($config['wireless']['interfaces'][$wlanbaseif]); if ($_POST['hidessid_enable'] == "yes") $wancfg['wireless']['hidessid']['enable'] = true; else if (isset($wancfg['wireless']['hidessid']['enable'])) @@ -1477,6 +1483,13 @@ $types = array("none" => "None", "static" => "Static", "dhcp" => "DHCP", "ppp" = Common wireless configuration - Settings apply to all wireless networks on . + Persist common settings + + > +
Enabling this preserves the common wireless configuration through interface deletions and reassignments. + + + Standard -
+
@@ -148,7 +148,7 @@ include("fbegin.inc"); -
+
-- cgit v1.1 From 98dee353e01e202e7a6bf54082040bc347ad62df Mon Sep 17 00:00:00 2001 From: pierrepomes Date: Wed, 28 Jul 2010 22:10:07 -0400 Subject: Fix ps command in packet capture screen. Ticket #766 --- usr/local/www/diag_packet_capture.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'usr/local/www') diff --git a/usr/local/www/diag_packet_capture.php b/usr/local/www/diag_packet_capture.php index d7c779c..de314a9 100644 --- a/usr/local/www/diag_packet_capture.php +++ b/usr/local/www/diag_packet_capture.php @@ -72,7 +72,7 @@ if ($_POST) { } elseif ($_POST['stopbtn']!= "") { $action = gettext("Stop"); - $processes_running = trim(shell_exec('/bin/ps axw -O pid= | /usr/bin/grep tcpdump | /usr/bin/grep $fn | /usr/bin/grep -v pflog')); + $processes_running = trim(shell_exec('/bin/ps axw -O pid= | /usr/bin/grep tcpdump | /usr/bin/grep '.$fn.' | /usr/bin/grep -v pflog')); //explode processes into an array, (delimiter is new line) $processes_running_array = explode("\n", $processes_running); -- cgit v1.1 From e702e6c959ff733679609564217f66f17415fe34 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Wed, 28 Jul 2010 22:24:28 -0400 Subject: Adding utility to show and maintain overflow tables --- usr/local/www/xmlrpc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'usr/local/www') diff --git a/usr/local/www/xmlrpc.php b/usr/local/www/xmlrpc.php index 6e1e242..591001c 100755 --- a/usr/local/www/xmlrpc.php +++ b/usr/local/www/xmlrpc.php @@ -202,7 +202,7 @@ function merge_config_section_xmlrpc($raw_params) { global $config, $xmlrpc_g; $params = xmlrpc_params_to_php($raw_params); if(!xmlrpc_auth($params)) return $xmlrpc_g['return']['authfail']; - $config = array_merge_recursive_unique($config, $params[0]); + $config = array_merge($config, $params[0]); $mergedkeys = implode(",", array_keys($params[0])); write_config("Merged in config ({$mergedkeys} sections) from XMLRPC client."); return $xmlrpc_g['return']['true']; -- cgit v1.1 From ca7b7f7eb0b63c33a3a43335f68a11271a857c78 Mon Sep 17 00:00:00 2001 From: Ermal Date: Thu, 29 Jul 2010 20:52:19 +0000 Subject: Fixes #768. Do not show twice the table that is selected. --- usr/local/www/diag_overload_tables.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'usr/local/www') diff --git a/usr/local/www/diag_overload_tables.php b/usr/local/www/diag_overload_tables.php index 4bb470d..03205a1 100644 --- a/usr/local/www/diag_overload_tables.php +++ b/usr/local/www/diag_overload_tables.php @@ -98,9 +98,8 @@ include("fbegin.inc"); :

-- cgit v1.1 From 34525fefe1936d1bc12ffd1afd0a2428e5e80f7b Mon Sep 17 00:00:00 2001 From: Ermal Date: Thu, 29 Jul 2010 21:02:05 +0000 Subject: Show all tables present in the tables ruleset on the diag overload tables. --- usr/local/www/diag_overload_tables.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'usr/local/www') diff --git a/usr/local/www/diag_overload_tables.php b/usr/local/www/diag_overload_tables.php index 03205a1..e4bba75 100644 --- a/usr/local/www/diag_overload_tables.php +++ b/usr/local/www/diag_overload_tables.php @@ -48,12 +48,9 @@ require_once("guiconfig.inc"); // Set default table $tablename = "sshlockout"; -if($_REQUEST['type'] == "sshlockout") - $tablename = "sshlockout"; +if($_REQUEST['type']) + $tablename = $_REQUEST['type']; -if($_REQUEST['type'] == "virusprot") - $tablename = "virusprot"; - if($_REQUEST['delete']) { if(is_ipaddr($_REQUEST['delete'])) { exec("/sbin/pfctl -t " . escapeshellarg($_REQUEST['type']) . " -T delete " . escapeshellarg($_REQUEST['delete']), $delete); @@ -73,6 +70,7 @@ if($_REQUEST['deleteall']) { } exec("/sbin/pfctl -t $tablename -T show", $entries); +exec("/sbin/pfctl -sT", $tables); include("head.inc"); include("fbegin.inc"); @@ -98,8 +96,13 @@ include("fbegin.inc"); :

-- cgit v1.1 From a812abb3b7dac9c0e065f1cbd5a2eda86f73dcbc Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Fri, 30 Jul 2010 20:57:48 -0400 Subject: Teach the DNS Lookup util to grok multiple host entries --- usr/local/www/diag_dns.php | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'usr/local/www') diff --git a/usr/local/www/diag_dns.php b/usr/local/www/diag_dns.php index d1392d3..94cd630 100644 --- a/usr/local/www/diag_dns.php +++ b/usr/local/www/diag_dns.php @@ -82,6 +82,8 @@ if ($_POST) { } elseif (is_hostname($host)) { $type = "hostname"; $resolved = gethostbyname($host); + $dig=`dig www.cnn.com A | grep "www.cnn.com" | grep -v ";" | awk '{ print $5 }'`; + $resolved = split("\n", $dig); $hostname = $host; if ($host != $resolved) $ipaddr = $resolved; @@ -108,10 +110,26 @@ include("head.inc"); ?> - + + + +
+ + - = + = +"; + } + } else { + echo $resolved; + } +?> + +
-- cgit v1.1 From 3e85ac2b437d5e7c9403a36f3d1f259656558fe9 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Fri, 30 Jul 2010 21:03:14 -0400 Subject: Set ipaddr to first array entry --- usr/local/www/diag_dns.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'usr/local/www') diff --git a/usr/local/www/diag_dns.php b/usr/local/www/diag_dns.php index 94cd630..485ffe9 100644 --- a/usr/local/www/diag_dns.php +++ b/usr/local/www/diag_dns.php @@ -86,7 +86,7 @@ if ($_POST) { $resolved = split("\n", $dig); $hostname = $host; if ($host != $resolved) - $ipaddr = $resolved; + $ipaddr = $resolved[0]; } if ($host == $resolved) { -- cgit v1.1 From c43f732a345c611034bea1c9cdb578b955fdb64d Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Fri, 30 Jul 2010 21:05:57 -0400 Subject: Ooops, uncomment test case --- usr/local/www/diag_dns.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'usr/local/www') diff --git a/usr/local/www/diag_dns.php b/usr/local/www/diag_dns.php index 485ffe9..ad62da2 100644 --- a/usr/local/www/diag_dns.php +++ b/usr/local/www/diag_dns.php @@ -82,8 +82,10 @@ if ($_POST) { } elseif (is_hostname($host)) { $type = "hostname"; $resolved = gethostbyname($host); - $dig=`dig www.cnn.com A | grep "www.cnn.com" | grep -v ";" | awk '{ print $5 }'`; - $resolved = split("\n", $dig); + if($resolved) { + $dig=`dig "$host" A | grep "$host" | grep -v ";" | awk '{ print $5 }'`; + $resolved = split("\n", $dig); + } $hostname = $host; if ($host != $resolved) $ipaddr = $resolved[0]; -- cgit v1.1 From a4a793c184f8169d9451b053ead9704794cbeb3c Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Fri, 30 Jul 2010 21:42:08 -0400 Subject: Handle cases when source or destination is not enabled and you end up with an offset error --- usr/local/www/firewall_aliases.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'usr/local/www') diff --git a/usr/local/www/firewall_aliases.php b/usr/local/www/firewall_aliases.php index bc210a1..ea7400a 100755 --- a/usr/local/www/firewall_aliases.php +++ b/usr/local/www/firewall_aliases.php @@ -87,6 +87,7 @@ if ($_GET['act'] == "del") { if($is_alias_referenced == false) { if(is_array($config['filter']['rule'])) { foreach($config['filter']['rule'] as $rule) { + if($rule['source']) { if($rule['source']['address'] && $rule['source']['address'] == $alias_name) { $is_alias_referenced = true; $referenced_by = $rule['descr']; @@ -102,6 +103,8 @@ if ($_GET['act'] == "del") { $referenced_by = $rule['descr']; break; } + } + if($rule['destination']) if($rule['destination']['port'] && $rule['destination']['port'] == $alias_name) { $is_alias_referenced = true; $referenced_by = $rule['descr']; -- cgit v1.1 From e55d4b3cb2d38809f67a983345b65d9dffd59904 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Fri, 30 Jul 2010 21:42:34 -0400 Subject: Add option to create an alias from a dns lookup. If the alias exists it will prompt to overwtrite --- usr/local/www/diag_dns.php | 56 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) (limited to 'usr/local/www') diff --git a/usr/local/www/diag_dns.php b/usr/local/www/diag_dns.php index ad62da2..fbdeea5 100644 --- a/usr/local/www/diag_dns.php +++ b/usr/local/www/diag_dns.php @@ -38,6 +38,52 @@ require("guiconfig.inc"); if ($_GET['host']) $_POST = $_GET; +if($_GET['createalias'] == "true") { + $host = trim($_POST['host']); + if($_GET['override']) + $override = true; + $a_aliases = &$config['aliases']['alias']; + $type = "hostname"; + $resolved = gethostbyname($host); + if($resolved) { + $host = trim($_POST['host']); + $dig=`dig "$host" A | grep "$host" | grep -v ";" | awk '{ print $5 }'`; + $resolved = split("\n", $dig); + $isfirst = true; + foreach($resolved as $re) { + if(!$isfirst) + $addresses .= " "; + $addresses .= $re; + $isfirst = false; + } + $newalias = array(); + $aliasname = str_replace(array(".","-"), "_", $host); + $alias_exists = false; + $counter=0; + foreach($a_aliases as $a) { + if($a['name'] == $aliasname) { + $alias_exists = true; + $id=$counter; + } + $counter++; + } + if($override) + $alias_exists = false; + if($alias_exists == false) { + $newalias['name'] = $aliasname; + $newalias['type'] = "host"; + $newalias['address'] = $addresses; + $newalias['descr'] = "Created from Diagnostics-> DNS Lookup"; + if($override) + $a_aliases[$id] = $newalias; + else + $a_aliases[] = $newalias; + write_config(); + $createdalias = true; + } + } +} + if ($_POST) { unset($input_errors); @@ -128,8 +174,18 @@ include("head.inc"); ?> } else { echo $resolved; } + if($alias_exists) { + echo "An alias already exists for the hostname {$newalias['name']}. To overwrite, click
here."; + } else { + if(!$createdalias) { + echo "Create alias out of these entries."; + } else { + echo "Alias created with name {$newalias['name']}"; + } + } ?> + -- cgit v1.1 From 565390d3b5ed5955a3b6e51df8ae05b39e16e585 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Fri, 30 Jul 2010 21:43:53 -0400 Subject: Indent checks --- usr/local/www/firewall_aliases.php | 40 +++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'usr/local/www') diff --git a/usr/local/www/firewall_aliases.php b/usr/local/www/firewall_aliases.php index ea7400a..d6a9e37 100755 --- a/usr/local/www/firewall_aliases.php +++ b/usr/local/www/firewall_aliases.php @@ -88,28 +88,28 @@ if ($_GET['act'] == "del") { if(is_array($config['filter']['rule'])) { foreach($config['filter']['rule'] as $rule) { if($rule['source']) { - if($rule['source']['address'] && $rule['source']['address'] == $alias_name) { - $is_alias_referenced = true; - $referenced_by = $rule['descr']; - break; - } - if($rule['source']['port'] && $rule['source']['port'] == $alias_name) { - $is_alias_referenced = true; - $referenced_by = $rule['descr']; - break; - } - if($rule['destination']['address'] && $rule['destination']['address'] == $alias_name) { - $is_alias_referenced = true; - $referenced_by = $rule['descr']; - break; - } + if($rule['source']['address'] && $rule['source']['address'] == $alias_name) { + $is_alias_referenced = true; + $referenced_by = $rule['descr']; + break; + } + if($rule['source']['port'] && $rule['source']['port'] == $alias_name) { + $is_alias_referenced = true; + $referenced_by = $rule['descr']; + break; + } + if($rule['destination']['address'] && $rule['destination']['address'] == $alias_name) { + $is_alias_referenced = true; + $referenced_by = $rule['descr']; + break; + } } if($rule['destination']) - if($rule['destination']['port'] && $rule['destination']['port'] == $alias_name) { - $is_alias_referenced = true; - $referenced_by = $rule['descr']; - break; - } + if($rule['destination']['port'] && $rule['destination']['port'] == $alias_name) { + $is_alias_referenced = true; + $referenced_by = $rule['descr']; + break; + } } } } -- cgit v1.1 From e1f6a0d9087a9d6cd0ef4d836f75430915bc964a Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Fri, 30 Jul 2010 21:51:04 -0400 Subject: Default to network and use /32 to make it easier to expand these into blocking entire netblock rules, etc --- usr/local/www/diag_dns.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'usr/local/www') diff --git a/usr/local/www/diag_dns.php b/usr/local/www/diag_dns.php index fbdeea5..9810f3e 100644 --- a/usr/local/www/diag_dns.php +++ b/usr/local/www/diag_dns.php @@ -70,8 +70,8 @@ if($_GET['createalias'] == "true") { if($override) $alias_exists = false; if($alias_exists == false) { - $newalias['name'] = $aliasname; - $newalias['type'] = "host"; + $newalias['name'] = $aliasname . "/32"; + $newalias['type'] = "network"; $newalias['address'] = $addresses; $newalias['descr'] = "Created from Diagnostics-> DNS Lookup"; if($override) -- cgit v1.1 From 3a6dc29410abc3b1899d6806a5dfe54cb72b11d4 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Fri, 30 Jul 2010 22:01:09 -0400 Subject: Do not prompt to create an alias for items that cannot be resolved --- usr/local/www/diag_dns.php | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'usr/local/www') diff --git a/usr/local/www/diag_dns.php b/usr/local/www/diag_dns.php index 9810f3e..d001e1b 100644 --- a/usr/local/www/diag_dns.php +++ b/usr/local/www/diag_dns.php @@ -167,20 +167,26 @@ include("head.inc"); ?> = "; + if($hostitem <> "") { + echo $hostitem . "
"; + $found++; + } } } else { echo $resolved; } - if($alias_exists) { - echo "An alias already exists for the hostname {$newalias['name']}. To overwrite, click here."; - } else { - if(!$createdalias) { - echo "Create alias out of these entries."; - } else { - echo "Alias created with name {$newalias['name']}"; + if($found > 0) { + if($alias_exists) { + echo "
An alias already exists for the hostname {$newalias['name']}. To overwrite, click here."; + } else { + if(!$createdalias) { + echo "
Create alias out of these entries."; + } else { + echo "
Alias created with name {$newalias['name']}"; + } } } ?> -- cgit v1.1 From 705c72eada89799fb1ae76daf7ad7f05742fe30b Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Fri, 30 Jul 2010 22:06:30 -0400 Subject: Oops, add /32 to address --- usr/local/www/diag_dns.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'usr/local/www') diff --git a/usr/local/www/diag_dns.php b/usr/local/www/diag_dns.php index d001e1b..715cb0b 100644 --- a/usr/local/www/diag_dns.php +++ b/usr/local/www/diag_dns.php @@ -53,7 +53,7 @@ if($_GET['createalias'] == "true") { foreach($resolved as $re) { if(!$isfirst) $addresses .= " "; - $addresses .= $re; + $addresses .= $re . "/32"; $isfirst = false; } $newalias = array(); @@ -70,7 +70,7 @@ if($_GET['createalias'] == "true") { if($override) $alias_exists = false; if($alias_exists == false) { - $newalias['name'] = $aliasname . "/32"; + $newalias['name'] = $aliasname; $newalias['type'] = "network"; $newalias['address'] = $addresses; $newalias['descr'] = "Created from Diagnostics-> DNS Lookup"; -- cgit v1.1 From 7a87cb97e5d1270ca7cb214e1e958da229ba70c4 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Fri, 30 Jul 2010 22:08:42 -0400 Subject: Do not create blank entries --- usr/local/www/diag_dns.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'usr/local/www') diff --git a/usr/local/www/diag_dns.php b/usr/local/www/diag_dns.php index 715cb0b..4f70d56 100644 --- a/usr/local/www/diag_dns.php +++ b/usr/local/www/diag_dns.php @@ -51,10 +51,12 @@ if($_GET['createalias'] == "true") { $resolved = split("\n", $dig); $isfirst = true; foreach($resolved as $re) { - if(!$isfirst) - $addresses .= " "; - $addresses .= $re . "/32"; - $isfirst = false; + if($re <> "") { + if(!$isfirst) + $addresses .= " "; + $addresses .= $re . "/32"; + $isfirst = false; + } } $newalias = array(); $aliasname = str_replace(array(".","-"), "_", $host); -- cgit v1.1 From 0bab61b14fe0612e8d4f531662ecfdb7e4a669b7 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Fri, 30 Jul 2010 22:13:27 -0400 Subject: Print out host correctly on the overwrite notice --- usr/local/www/diag_dns.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'usr/local/www') diff --git a/usr/local/www/diag_dns.php b/usr/local/www/diag_dns.php index 4f70d56..f16518f 100644 --- a/usr/local/www/diag_dns.php +++ b/usr/local/www/diag_dns.php @@ -182,7 +182,7 @@ include("head.inc"); ?> } if($found > 0) { if($alias_exists) { - echo "
An alias already exists for the hostname {$newalias['name']}. To overwrite, click here."; + echo "
An alias already exists for the hostname {$host}. To overwrite, click here."; } else { if(!$createdalias) { echo "
Create alias out of these entries."; -- cgit v1.1 From 68d98ce3d728592ec13a08f981c2b78043ba8311 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Fri, 30 Jul 2010 22:34:05 -0400 Subject: Lower font size on create / overwrite line --- usr/local/www/diag_dns.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'usr/local/www') diff --git a/usr/local/www/diag_dns.php b/usr/local/www/diag_dns.php index f16518f..c286d44 100644 --- a/usr/local/www/diag_dns.php +++ b/usr/local/www/diag_dns.php @@ -182,12 +182,12 @@ include("head.inc"); ?> } if($found > 0) { if($alias_exists) { - echo "
An alias already exists for the hostname {$host}. To overwrite, click here."; + echo "
An alias already exists for the hostname {$host}. To overwrite, click here."; } else { if(!$createdalias) { - echo "
Create alias out of these entries."; + echo "
Create alias out of these entries."; } else { - echo "
Alias created with name {$newalias['name']}"; + echo "
Alias created with name {$newalias['name']}"; } } } -- cgit v1.1 From 0d5c9be16093c451c8ccce07a62742065e6dad6a Mon Sep 17 00:00:00 2001 From: Chris Buechler Date: Sun, 1 Aug 2010 02:20:04 -0400 Subject: NAT is useful with single interface systems too, both rdr and outbound --- usr/local/www/fbegin.inc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'usr/local/www') diff --git a/usr/local/www/fbegin.inc b/usr/local/www/fbegin.inc index 488a313..9bcc8b5 100755 --- a/usr/local/www/fbegin.inc +++ b/usr/local/www/fbegin.inc @@ -105,8 +105,7 @@ $interfaces_menu = msort(array_merge($interfaces_menu, return_ext_menu("Interfac // Firewall $firewall_menu = array(); $firewall_menu[] = array("Aliases", "/firewall_aliases.php"); -if(count($config['interfaces']) > 1) - $firewall_menu[] = array("NAT", "/firewall_nat.php"); +$firewall_menu[] = array("NAT", "/firewall_nat.php"); $firewall_menu[] = array("Rules", "/firewall_rules.php"); $firewall_menu[] = array("Schedules", "/firewall_schedule.php"); $firewall_menu[] = array("Traffic Shaper", "/firewall_shaper.php"); -- cgit v1.1 From 1810b7719ec0d5d00275547cad78368b06fdb879 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sun, 1 Aug 2010 14:21:27 -0400 Subject: Add more text, general cleanups. Works pretty decently but still needs custom install option and rescue config. --- usr/local/www/installer.php | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'usr/local/www') diff --git a/usr/local/www/installer.php b/usr/local/www/installer.php index f988d02..fc2fb54 100644 --- a/usr/local/www/installer.php +++ b/usr/local/www/installer.php @@ -91,6 +91,9 @@ EOF; } function start_installation() { + $ps_running = exec("ps awwwux | grep -v grep | grep 'sh /tmp/installer.sh'"); + if($ps_running) + return; $fd = fopen("/tmp/installer.sh", "w"); if(!$fd) { die("Could not open /tmp/installer.sh for writing"); @@ -118,7 +121,12 @@ function update_installer_status() { } function update_installer_status_win($status) { + $ps_running = exec("ps awwwux | grep -v grep | grep 'sh /tmp/installer.sh'"); echo ""; @@ -224,9 +232,11 @@ function quickeasyinstall_gui() {

- Starting Installer... Please wait...

+

+ Starting Installer... Please wait...

+

{{ Insert progressbar here }}

-

@@ -240,6 +250,7 @@ function quickeasyinstall_gui() { EOF; end_html(); + begin_quick_easy_install(); } function installer_main() { @@ -249,16 +260,19 @@ function installer_main() { echo "WARNING: Could not find any suitable disks for installation."; echo << - + This utility will install pfSense to a hard disk, flash drive, etc. +
@@ -382,26 +401,33 @@ EOF; function installer_main() { global $g; + if(file_exists("/tmp/.pc-sysinstall/pc-sysinstall.log")) + unlink("/tmp/.pc-sysinstall/pc-sysinstall.log"); body_html(); $disk = installer_find_first_disk(); if(!$disk) echo "WARNING: Could not find any suitable disks for installation."; page_table_start(); echo <<
- This utility will install pfSense to a hard disk, flash drive, etc. +
+ Welcome to the pfSense PCSysInstaller!

+ This utility will install pfSense to a hard disk, flash drive, etc.

+
+ Please select an installer option to begin: -- cgit v1.1 From 8af6efa60120fcc3740313db9e0774990ade7c28 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sun, 1 Aug 2010 15:26:55 -0400 Subject: Make installer html look more like an installer, add progress bar. Output javascript. --- usr/local/www/installer.php | 238 +++++++++++++++++++++++++++++++++----------- 1 file changed, 180 insertions(+), 58 deletions(-) (limited to 'usr/local/www') diff --git a/usr/local/www/installer.php b/usr/local/www/installer.php index fc2fb54..ea7a09b 100644 --- a/usr/local/www/installer.php +++ b/usr/local/www/installer.php @@ -27,6 +27,7 @@ POSSIBILITY OF SUCH DAMAGE. */ +require("globals.inc"); require("guiconfig.inc"); if($g['platform'] == "pfSense" or $g['platform'] == "nanobsd") { @@ -91,6 +92,7 @@ EOF; } function start_installation() { + global $g; $ps_running = exec("ps awwwux | grep -v grep | grep 'sh /tmp/installer.sh'"); if($ps_running) return; @@ -106,33 +108,87 @@ function start_installation() { } function installer_find_first_disk() { + global $g; $disk = `/PCBSD/pc-sysinstall/pc-sysinstall disk-list | head -n1 | cut -d':' -f1`; return $disk; } function update_installer_status() { + global $g; if(!file_exists("/tmp/.pc-sysinstall/pc-sysinstall.log")) return; - echo `tail -n20 /tmp/.pc-sysinstall/pc-sysinstall.log`; + // Ensure status files exist + if(!file_exists("/tmp/installer_installer_running")) + touch("/tmp/installer_installer_running"); + if(!file_exists("/tmp/installer_last_progress")) + touch("/tmp/installer_last_progress"); + $status = `tail -n20 /tmp/.pc-sysinstall/pc-sysinstall.log`; + echo "this.document.forms[0].installeroutput.value='$status';\n"; + $installer_running = trim(file_get_contents("/tmp/installer_installer_running")); + if($installer_running <> "running") { + $ps_running = exec("ps awwwux | grep -v grep | grep 'sh /tmp/installer.sh'"); + if($ps_running) + echo "\$('installerrunning').innerHTML=' Installer running...';\n"; + file_put_contents("/tmp/installer_installer_running", "running"); + } + // Find out installer progress + if(strstr($status, "/boot /mnt/boot")) + $progress = "1"; + if(strstr($status, "/COPYRIGHT /mnt/COPYRIGHT")) + $progress = "2"; + if(strstr($status, "/bin /mnt/bin")) + $progress = "5"; + if(strstr($status, "/conf /mnt/conf")) + $progress = "10"; + if(strstr($status, "/conf.default /mnt/conf.default")) + $progress = "15"; + if(strstr($status, "/dev /mnt/dev")) + $progress = "20"; + if(strstr($status, "/etc /mnt/etc")) + $progress = "25"; + if(strstr($status, "/home /mnt/home")) + $progress = "30"; + if(strstr($status, "/kernels /mnt/kernels")) + $progress = "35"; + if(strstr($status, "/libexec /mnt/libexec")) + $progress = "40"; + if(strstr($status, "/lib /mnt/lib")) + $progress = "45"; + if(strstr($status, "/root /mnt/root")) + $progress = "50"; + if(strstr($status, "/sbin /mnt/sbin")) + $progress = "55"; + if(strstr($status, "/sys /mnt/sys")) + $progress = "60"; + if(strstr($status, "/usr /mnt/usr")) + $progress = "70"; + if(strstr($status, "/usr /mnt/usr")) + $progress = "80"; + if(strstr($status, "/var /mnt/var")) + $progress = "90"; + if(strstr($status, "Installation finished")) + $progress = "100"; + $last_progress = trim(file_get_contents("/tmp/installer_last_progress")); + if($last_progress <> $progress) + echo "\ndocument.progressbar.style.width='{$progress}%';\n"; + file_put_contents("/tmp/installer_last_progress", trim($progress)); if(file_exists("/tmp/install_complete")) { - echo "Installation completed."; + echo "\$('installerrunning').innerHTML='Installation completed. Please reboot to continue';\n"; unlink_if_exists("/tmp/installer.sh"); + file_put_contents("/tmp/installer_installer_running", "finished"); } } function update_installer_status_win($status) { - $ps_running = exec("ps awwwux | grep -v grep | grep 'sh /tmp/installer.sh'"); + global $g; echo ""; } function begin_quick_easy_install() { + global $g; unlink_if_exists("/tmp/install_complete"); $disk = installer_find_first_disk(); if(!$disk) { @@ -147,6 +203,7 @@ function begin_quick_easy_install() { } function body_html() { + global $g; $pfSversion = str_replace("\n", "", file_get_contents("/etc/version")); if(strstr($pfSversion, "1.2")) $one_two = true; @@ -171,12 +228,11 @@ function body_html() { }); } function installcallback(transport) { - this.document.forms[0].installeroutput.value=transport.responseText; + eval(transport.responseText); setTimeout('getinstallerprogress()', 1000); } EOF; - include("fbegin.inc"); if($one_two) echo "

{$pgtitle}

"; @@ -185,13 +241,14 @@ EOF; } function end_html() { + global $g; echo ""; - include("fend.inc"); echo ""; echo ""; } function template() { + global $g; body_html(); echo << @@ -220,70 +277,135 @@ EOF; } function quickeasyinstall_gui() { + global $g; body_html(); + page_table_start(); echo << -
- - - + +
+
-
- - - - -
-
-
-
- Starting Installer... Please wait...

-

- {{ Insert progressbar here }}

- -

-
-
-
+
+
+ + + + +
+
+ + + + +
+
+
+ Starting Installer... Please wait...

+

+
+ + + + + + +
+ + + + + +
+ +
+
+
+
+ +
+
+
+
+
+
-
+ + EOF; + page_table_end(); end_html(); begin_quick_easy_install(); } +function page_table_start() { + global $g; + echo << + + + + + + + +
+ + + pfSense installer + + +
+ +EOF; + +} + +function page_table_end() { + global $g; + echo << +
+ + +EOF; + +} + function installer_main() { + global $g; body_html(); $disk = installer_find_first_disk(); if(!$disk) echo "WARNING: Could not find any suitable disks for installation."; + page_table_start(); echo << - This utility will install pfSense to a hard disk, flash drive, etc. - - - - -
-
-
- Please select an installer option to begin: - - - - -
- - -
-
-
- +
+ This utility will install pfSense to a hard disk, flash drive, etc. + + + + +
+
+
+ Please select an installer option to begin: + + + + +
+ + +
+
+
+
EOF; + page_table_end(); end_html(); } -- cgit v1.1 From 3c9d543d6807df4051e62bd4f4203abad56a92ca Mon Sep 17 00:00:00 2001 From: Chris Buechler Date: Sun, 1 Aug 2010 16:09:10 -0400 Subject: Don't use WAN/LAN if an interface descr exists ticket #783 --- usr/local/www/firewall_nat.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'usr/local/www') diff --git a/usr/local/www/firewall_nat.php b/usr/local/www/firewall_nat.php index 84fc0e8..4e30c56 100755 --- a/usr/local/www/firewall_nat.php +++ b/usr/local/www/firewall_nat.php @@ -261,9 +261,9 @@ echo ""; } @@ -212,25 +213,25 @@ function body_html() { echo << - EOF; @@ -279,9 +280,9 @@ EOF; function quickeasyinstall_gui() { global $g; body_html(); + echo ""; page_table_start(); echo <<
@@ -294,24 +295,31 @@ function quickeasyinstall_gui() {
-
- Starting Installer... Please wait...

+

+ + + + + +
+ + +  Starting Installer... Please wait... +

- +
- -
+ - - - - +
- -
+
+ +
+
-- cgit v1.1 From 8a4cf948b7d6f49a3956a9539dd79a20655bf30a Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sun, 1 Aug 2010 16:59:16 -0400 Subject: More installer improvements. Its looking hot! --- usr/local/www/installer.php | 36 +++++++++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 5 deletions(-) (limited to 'usr/local/www') diff --git a/usr/local/www/installer.php b/usr/local/www/installer.php index aaacee6..4879c08 100644 --- a/usr/local/www/installer.php +++ b/usr/local/www/installer.php @@ -120,11 +120,22 @@ function update_installer_status() { // Ensure status files exist if(!file_exists("/tmp/installer_installer_running")) touch("/tmp/installer_installer_running"); - $status = `tail -n20 /tmp/.pc-sysinstall/pc-sysinstall.log`; + $status = `tail -n30 /tmp/.pc-sysinstall/pc-sysinstall.log`; $status = str_replace("\n", "\\n", $status); $status = str_replace("\n", "\\r", $status); echo "this.document.forms[0].installeroutput.value='$status';\n"; // Find out installer progress + $progress = "5"; + if(strstr($status, "Running: dd")) + $progress = "6"; + if(strstr($status, "Running: gpart create -s GPT")) + $progress = "7"; + if(strstr($status, "Running: gpart bootcode")) + $progress = "7"; + if(strstr($status, "Running: newfs -U")) + $progress = "8"; + if(strstr($status, "Running: sync")) + $progress = "9"; if(strstr($status, "/boot /mnt/boot")) $progress = "10"; if(strstr($status, "/COPYRIGHT /mnt/COPYRIGHT")) @@ -159,6 +170,14 @@ function update_installer_status() { $progress = "90"; if(strstr($status, "/var /mnt/var")) $progress = "95"; + if(strstr($status, "cap_mkdb /etc/login.conf")) + $progress = "96"; + if(strstr($status, "Setting hostname")) + $progress = "97"; + if(strstr($status, "umount -f /mnt")) + $progress = "98"; + if(strstr($status, "umount -f /mnt")) + $progress = "99"; if(strstr($status, "Installation finished")) $progress = "100"; $running_old = trim(file_get_contents("/tmp/installer_installer_running")); @@ -324,7 +343,7 @@ function quickeasyinstall_gui() {

-
-- cgit v1.1 From 4ec765b7d461b021e27f145f6e43604ba0b72959 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sun, 1 Aug 2010 18:14:11 -0400 Subject: Missing \n --- usr/local/www/installer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'usr/local/www') diff --git a/usr/local/www/installer.php b/usr/local/www/installer.php index 135e0f2..c70ac44 100644 --- a/usr/local/www/installer.php +++ b/usr/local/www/installer.php @@ -103,7 +103,7 @@ function start_installation() { die("Could not open /tmp/installer.sh for writing"); exit; } - fwrite($fd, "rm /tmp/.pc-sysinstall/pc-sysinstall.log 2>/dev/null"); + fwrite($fd, "rm /tmp/.pc-sysinstall/pc-sysinstall.log 2>/dev/null\n"); fwrite($fd, "/PCBSD/pc-sysinstall/pc-sysinstall -c /PCBSD/pc-sysinstall/examples/pfSense-install.cfg \n"); fwrite($fd, "chmod a+rx /usr/local/bin/after_installation_routines.sh\n"); fwrite($fd, "cd / && /usr/local/bin/after_installation_routines.sh\n"); -- cgit v1.1 From b5cff7075192083de8c324ce3c18b49356de6953 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sun, 1 Aug 2010 18:16:37 -0400 Subject: Check to see if we are already installed --- usr/local/www/installer.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'usr/local/www') diff --git a/usr/local/www/installer.php b/usr/local/www/installer.php index c70ac44..85e94f2 100644 --- a/usr/local/www/installer.php +++ b/usr/local/www/installer.php @@ -216,6 +216,8 @@ function update_installer_status_win($status) { function begin_quick_easy_install() { global $g; + if(file_exists("/tmp/install_complete")) + return; unlink_if_exists("/tmp/install_complete"); $disk = installer_find_first_disk(); if(!$disk) { -- cgit v1.1 From 0a680367d5f60173b1916cb4bcbf8213eee6fdf3 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sun, 1 Aug 2010 18:34:27 -0400 Subject: Adding ZFS --- usr/local/www/installer.php | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'usr/local/www') diff --git a/usr/local/www/installer.php b/usr/local/www/installer.php index 85e94f2..648843a 100644 --- a/usr/local/www/installer.php +++ b/usr/local/www/installer.php @@ -30,6 +30,12 @@ require("globals.inc"); require("guiconfig.inc"); +// Handle other type of file systems +if($_REQUEST['fstype']) + $fstype = strtoupper($_REQUEST['fstype']); +else + $fstype = "UFS+S"; + if($g['platform'] == "pfSense" or $g['platform'] == "nanobsd") { Header("Location: /index.php"); exit; @@ -43,13 +49,12 @@ switch ($_REQUEST['state']) { case "update_installer_status": update_installer_status(); exit; - case "quickeasyinstall": - begin_quick_easy_install(); default: installer_main(); } function write_out_pc_sysinstaller_config($disk) { + global $fstype; $fd = fopen("/PCBSD/pc-sysinstall/examples/pfSense-install.cfg", "w"); if(!$fd) { return true; @@ -72,7 +77,7 @@ commitDiskPart # All sizes are expressed in MB # Avail FS Types, UFS, UFS+S, UFS+J, ZFS, SWAP # Size 0 means use the rest of the slice size -disk0-part=UFS+S 0 / +disk0-part={$fstype} 0 / # Do it now! commitDiskLabel @@ -336,6 +341,7 @@ function quickeasyinstall_gui() {
+

+
Please select an installer option to begin: -- cgit v1.1 From dcf479cf221f47d2b2cd6a24da96a2d4cf5e23f1 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sun, 1 Aug 2010 17:26:01 -0400 Subject: Do not kick off a install if we have already completed --- usr/local/www/installer.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'usr/local/www') diff --git a/usr/local/www/installer.php b/usr/local/www/installer.php index 4879c08..c16368b 100644 --- a/usr/local/www/installer.php +++ b/usr/local/www/installer.php @@ -93,6 +93,8 @@ EOF; function start_installation() { global $g; + if(file_exists("/tmp/install_complete")) + return; $ps_running = exec("ps awwwux | grep -v grep | grep 'sh /tmp/installer.sh'"); if($ps_running) return; -- cgit v1.1 From 9c6421ee62ad5b950d91d0c095fcb5efc7cd4b22 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sun, 1 Aug 2010 17:44:19 -0400 Subject: Do not umount --- usr/local/www/installer.php | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) (limited to 'usr/local/www') diff --git a/usr/local/www/installer.php b/usr/local/www/installer.php index c16368b..27e3fa8 100644 --- a/usr/local/www/installer.php +++ b/usr/local/www/installer.php @@ -84,7 +84,7 @@ packageType=cpdup # Optional Components cpdupPaths=boot,COPYRIGHT,bin,conf,conf.default,dev,etc,home,kernels,libexec,lib,root,sbin,sys,usr,var -runExtCommand=chmod a+rx /usr/local/bin/after_installation_routines.sh && cd / && /usr/local/bin/after_installation_routines.sh +# runExtCommand=chmod a+rx /usr/local/bin/after_installation_routines.sh && cd / && /usr/local/bin/after_installation_routines.sh EOF; fwrite($fd, $config); fclose($fd); @@ -103,7 +103,11 @@ function start_installation() { die("Could not open /tmp/installer.sh for writing"); exit; } - fwrite($fd, "/PCBSD/pc-sysinstall/pc-sysinstall -c /PCBSD/pc-sysinstall/examples/pfSense-install.cfg && touch /tmp/install_complete"); + fwrite($fd, "/PCBSD/pc-sysinstall/pc-sysinstall -c /PCBSD/pc-sysinstall/examples/pfSense-install.cfg \n"); + fwrite($fd, "chmod a+rx /usr/local/bin/after_installation_routines.sh\n"); + fwrite($fd, "cd / && /usr/local/bin/after_installation_routines.sh\n"); + fwrite($fd, "touch /tmp/install_complete\n"); + fclose($fd); exec("chmod a+rx /tmp/installer.sh"); mwexec_bg("sh /tmp/installer.sh"); @@ -141,25 +145,25 @@ function update_installer_status() { if(strstr($status, "/boot /mnt/boot")) $progress = "10"; if(strstr($status, "/COPYRIGHT /mnt/COPYRIGHT")) - $progress = "20"; + $progress = "11"; if(strstr($status, "/bin /mnt/bin")) - $progress = "25"; + $progress = "12"; if(strstr($status, "/conf /mnt/conf")) - $progress = "30"; + $progress = "15"; if(strstr($status, "/conf.default /mnt/conf.default")) - $progress = "35"; + $progress = "20"; if(strstr($status, "/dev /mnt/dev")) - $progress = "40"; + $progress = "25"; if(strstr($status, "/etc /mnt/etc")) - $progress = "45"; + $progress = "30"; if(strstr($status, "/home /mnt/home")) - $progress = "50"; + $progress = "35"; if(strstr($status, "/kernels /mnt/kernels")) - $progress = "55"; + $progress = "40"; if(strstr($status, "/libexec /mnt/libexec")) - $progress = "60"; + $progress = "50"; if(strstr($status, "/lib /mnt/lib")) - $progress = "65"; + $progress = "60"; if(strstr($status, "/root /mnt/root")) $progress = "70"; if(strstr($status, "/sbin /mnt/sbin")) @@ -195,8 +199,8 @@ function update_installer_status() { } if($progress) echo "\$('progressbar').style.width='{$progress}%';\n"; - if($progress == "100") { - echo "\$('installerrunning').innerHTML='Installation completed. Please reboot to continue';\n"; + if($progress == "100" && file_exists("/tmp/install_complete")) { + echo "\$('installerrunning').innerHTML='Installation completed. Please reboot to continue';\n"; unlink_if_exists("/tmp/installer.sh"); file_put_contents("/tmp/installer_installer_running", "finished"); } -- cgit v1.1 From f5fb20345798b3d19e728b049d7ef8750a32e5ce Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sun, 1 Aug 2010 17:45:11 -0400 Subject: Handle umount outside of installer in php --- usr/local/www/installer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'usr/local/www') diff --git a/usr/local/www/installer.php b/usr/local/www/installer.php index 27e3fa8..6736bb1 100644 --- a/usr/local/www/installer.php +++ b/usr/local/www/installer.php @@ -106,8 +106,8 @@ function start_installation() { fwrite($fd, "/PCBSD/pc-sysinstall/pc-sysinstall -c /PCBSD/pc-sysinstall/examples/pfSense-install.cfg \n"); fwrite($fd, "chmod a+rx /usr/local/bin/after_installation_routines.sh\n"); fwrite($fd, "cd / && /usr/local/bin/after_installation_routines.sh\n"); + fwrite($fd, "umount /mnt\n"); fwrite($fd, "touch /tmp/install_complete\n"); - fclose($fd); exec("chmod a+rx /tmp/installer.sh"); mwexec_bg("sh /tmp/installer.sh"); -- cgit v1.1 From c76d54a57529ec9b96f2a26304696782500648fe Mon Sep 17 00:00:00 2001 From: Erik Fonnesbeck Date: Sun, 1 Aug 2010 15:25:08 -0600 Subject: Fix display of optX addresses in rule lists. --- usr/local/www/guiconfig.inc | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'usr/local/www') diff --git a/usr/local/www/guiconfig.inc b/usr/local/www/guiconfig.inc index 1125312..4863967 100755 --- a/usr/local/www/guiconfig.inc +++ b/usr/local/www/guiconfig.inc @@ -211,6 +211,7 @@ $specialnets = array("wanip" => "WAN address", "lanip" => "LAN address", "lan" = $spiflist = get_configured_interface_with_descr(true, true); foreach ($spiflist as $ifgui => $ifdesc) { $specialnets[$ifgui] = $ifdesc . " net"; + $specialnets[$ifgui . 'ip'] = $ifdesc . " address"; } $medias = array("auto" => "autoselect", "100full" => "100BASE-TX full-duplex", @@ -422,11 +423,7 @@ function pprint_address($adr) { if (isset($adr['any'])) { $padr = "*"; } else if ($adr['network']) { - if (preg_match("/opt[0-999]ip/", $adr['network'])) { - $padr = "Interface IP address"; - } else { - $padr = $specialnets[$adr['network']]; - } + $padr = $specialnets[$adr['network']]; } else { $padr = $adr['address']; } -- cgit v1.1 From 1a99877d5747c3efd0a3977d8ced611e7120673e Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sun, 1 Aug 2010 17:57:00 -0400 Subject: Ensure /tmp exists --- usr/local/www/installer.php | 1 + 1 file changed, 1 insertion(+) (limited to 'usr/local/www') diff --git a/usr/local/www/installer.php b/usr/local/www/installer.php index 6736bb1..5737679 100644 --- a/usr/local/www/installer.php +++ b/usr/local/www/installer.php @@ -106,6 +106,7 @@ function start_installation() { fwrite($fd, "/PCBSD/pc-sysinstall/pc-sysinstall -c /PCBSD/pc-sysinstall/examples/pfSense-install.cfg \n"); fwrite($fd, "chmod a+rx /usr/local/bin/after_installation_routines.sh\n"); fwrite($fd, "cd / && /usr/local/bin/after_installation_routines.sh\n"); + fwrite($fd, "mkdir /mnt/tmp\n"); fwrite($fd, "umount /mnt\n"); fwrite($fd, "touch /tmp/install_complete\n"); fclose($fd); -- cgit v1.1 From 429650edb7790154035d668ec12ccc3009055236 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sun, 1 Aug 2010 18:03:30 -0400 Subject: Show all log contents and automatically scroll to end of textarea --- usr/local/www/installer.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'usr/local/www') diff --git a/usr/local/www/installer.php b/usr/local/www/installer.php index 5737679..5682dc0 100644 --- a/usr/local/www/installer.php +++ b/usr/local/www/installer.php @@ -127,10 +127,11 @@ function update_installer_status() { // Ensure status files exist if(!file_exists("/tmp/installer_installer_running")) touch("/tmp/installer_installer_running"); - $status = `tail -n30 /tmp/.pc-sysinstall/pc-sysinstall.log`; + $status = `cat /tmp/.pc-sysinstall/pc-sysinstall.log`; $status = str_replace("\n", "\\n", $status); $status = str_replace("\n", "\\r", $status); echo "this.document.forms[0].installeroutput.value='$status';\n"; + echo "this.document.forms[0].installeroutput.scrollTop = this.document.forms[0].installeroutput.scrollHeight;\n"; // Find out installer progress $progress = "5"; if(strstr($status, "Running: dd")) -- cgit v1.1 From 691f847549f79313a5b6ab0a435206c0f01e3057 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sun, 1 Aug 2010 18:10:38 -0400 Subject: Only check for file if install is complete --- usr/local/www/installer.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'usr/local/www') diff --git a/usr/local/www/installer.php b/usr/local/www/installer.php index 5682dc0..135e0f2 100644 --- a/usr/local/www/installer.php +++ b/usr/local/www/installer.php @@ -102,7 +102,8 @@ function start_installation() { if(!$fd) { die("Could not open /tmp/installer.sh for writing"); exit; - } + } + fwrite($fd, "rm /tmp/.pc-sysinstall/pc-sysinstall.log 2>/dev/null"); fwrite($fd, "/PCBSD/pc-sysinstall/pc-sysinstall -c /PCBSD/pc-sysinstall/examples/pfSense-install.cfg \n"); fwrite($fd, "chmod a+rx /usr/local/bin/after_installation_routines.sh\n"); fwrite($fd, "cd / && /usr/local/bin/after_installation_routines.sh\n"); @@ -122,8 +123,6 @@ function installer_find_first_disk() { function update_installer_status() { global $g; - if(!file_exists("/tmp/.pc-sysinstall/pc-sysinstall.log")) - return; // Ensure status files exist if(!file_exists("/tmp/installer_installer_running")) touch("/tmp/installer_installer_running"); @@ -201,7 +200,7 @@ function update_installer_status() { } if($progress) echo "\$('progressbar').style.width='{$progress}%';\n"; - if($progress == "100" && file_exists("/tmp/install_complete")) { + if(file_exists("/tmp/install_complete")) { echo "\$('installerrunning').innerHTML='Installation completed. Please reboot to continue';\n"; unlink_if_exists("/tmp/installer.sh"); file_put_contents("/tmp/installer_installer_running", "finished"); @@ -351,7 +350,7 @@ function quickeasyinstall_gui() {
-

-

+
-- cgit v1.1 From 38405d27b2aa688ccaae9f52b8d8d68e4817903a Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sun, 1 Aug 2010 19:46:38 -0400 Subject: Handle errors --- usr/local/www/installer.php | 50 +++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 46 insertions(+), 4 deletions(-) (limited to 'usr/local/www') diff --git a/usr/local/www/installer.php b/usr/local/www/installer.php index 648843a..3ad4b6b 100644 --- a/usr/local/www/installer.php +++ b/usr/local/www/installer.php @@ -127,7 +127,7 @@ function installer_find_first_disk() { } function update_installer_status() { - global $g; + global $g, $fstype; // Ensure status files exist if(!file_exists("/tmp/installer_installer_running")) touch("/tmp/installer_installer_running"); @@ -192,11 +192,18 @@ function update_installer_status() { $progress = "99"; if(strstr($status, "Installation finished")) $progress = "100"; + // Check for error and bail if we see one. + if(stristr($status, "error")) { + $error = true; + echo "\$('installerrunning').innerHTML='An error occurred. Aborting installation.'; "; + echo "\$('progressbar').style.width='100%';\n"; + return; + } $running_old = trim(file_get_contents("/tmp/installer_installer_running")); if($installer_running <> "running") { $ps_running = exec("ps awwwux | grep -v grep | grep 'sh /tmp/installer.sh'"); if($ps_running) { - $running = "\$('installerrunning').innerHTML='
@@ -436,7 +442,11 @@ function installer_main() {
- Quick/Easy installation + Rescue config.xml
+ Install pfSense using the UFS + or + ZFS + filesystem.

 Installer running ({$progress}% completed)...
'; "; + $running = "\$('installerrunning').innerHTML='
 Installer running ({$progress}% completed) - {$fstype}...
'; "; if($running_old <> $running) { echo $running; file_put_contents("/tmp/installer_installer_running", "$running"); @@ -236,6 +243,38 @@ function begin_quick_easy_install() { start_installation(); } +function head_html() { + global $g; + echo << + + + +EOF; + +} + function body_html() { global $g; $pfSversion = str_replace("\n", "", file_get_contents("/etc/version")); @@ -283,6 +322,7 @@ function end_html() { function template() { global $g; + head_html(); body_html(); echo << @@ -312,6 +352,7 @@ EOF; function quickeasyinstall_gui() { global $g; + head_html(); body_html(); echo ""; page_table_start(); @@ -418,6 +459,7 @@ function installer_main() { global $g; if(file_exists("/tmp/.pc-sysinstall/pc-sysinstall.log")) unlink("/tmp/.pc-sysinstall/pc-sysinstall.log"); + head_html(); body_html(); $disk = installer_find_first_disk(); if(!$disk) @@ -437,12 +479,12 @@ function installer_main() {
Please select an installer option to begin: - +
- Rescue config.xml
+ Rescue config.xml

Install pfSense using the UFS or ZFS -- cgit v1.1 From ec3f44c1ea8a765e38d331c877df4f916c202a5f Mon Sep 17 00:00:00 2001 From: Erik Fonnesbeck Date: Sun, 1 Aug 2010 17:43:53 -0600 Subject: WAN and LAN don't need to be specially added to $specialnets, since the code after can add them anyway. --- usr/local/www/guiconfig.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'usr/local/www') diff --git a/usr/local/www/guiconfig.inc b/usr/local/www/guiconfig.inc index 4863967..605705e 100755 --- a/usr/local/www/guiconfig.inc +++ b/usr/local/www/guiconfig.inc @@ -206,9 +206,9 @@ $wkports = array( /* TCP flags */ $tcpflags = array("fin", "syn", "rst", "psh", "ack", "urg"); -$specialnets = array("wanip" => "WAN address", "lanip" => "LAN address", "lan" => "LAN net", "pptp" => "PPTP clients", "pppoe" => "PPPoE clients", "l2tp" => "L2TP clients"); +$specialnets = array("pptp" => "PPTP clients", "pppoe" => "PPPoE clients", "l2tp" => "L2TP clients"); -$spiflist = get_configured_interface_with_descr(true, true); +$spiflist = get_configured_interface_with_descr(false, true); foreach ($spiflist as $ifgui => $ifdesc) { $specialnets[$ifgui] = $ifdesc . " net"; $specialnets[$ifgui . 'ip'] = $ifdesc . " address"; -- cgit v1.1 From 50d44909b5d7fefc70feca1414ec4ae81f743892 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sun, 1 Aug 2010 20:01:17 -0400 Subject: Use product_name --- usr/local/www/installer.php | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'usr/local/www') diff --git a/usr/local/www/installer.php b/usr/local/www/installer.php index 3ad4b6b..070eb4f 100644 --- a/usr/local/www/installer.php +++ b/usr/local/www/installer.php @@ -197,6 +197,7 @@ function update_installer_status() { $error = true; echo "\$('installerrunning').innerHTML='An error occurred. Aborting installation.'; "; echo "\$('progressbar').style.width='100%';\n"; + unlink("/tmp/install_complete"); return; } $running_old = trim(file_get_contents("/tmp/installer_installer_running")); @@ -280,7 +281,7 @@ function body_html() { $pfSversion = str_replace("\n", "", file_get_contents("/etc/version")); if(strstr($pfSversion, "1.2")) $one_two = true; - $pgtitle = "pfSense: Installer"; + $pgtitle = "{$g['product_name']}: Installer"; include("head.inc"); echo << @@ -369,7 +370,7 @@ function quickeasyinstall_gui() {

-
+
@@ -425,13 +426,13 @@ function page_table_start() { global $g; echo << - - +
+
@@ -469,8 +470,8 @@ function installer_main() {
- Welcome to the pfSense PCSysInstaller!

- This utility will install pfSense to a hard disk, flash drive, etc. + Welcome to the {$g['product_name']} PCSysInstaller!

+ This utility will install {$g['product_name']} to a hard disk, flash drive, etc.

- pfSense installer + {$g['product_name']} installer
@@ -479,13 +480,13 @@ function installer_main() {
Please select an installer option to begin: - +
@@ -457,11 +457,14 @@ EOF; } function installer_main() { - global $g; + global $g, $fstype; if(file_exists("/tmp/.pc-sysinstall/pc-sysinstall.log")) unlink("/tmp/.pc-sysinstall/pc-sysinstall.log"); head_html(); body_html(); + // Only enable ZFS if this exists. The install will fail otherwise. + if(file_exists("/boot/gptzfsboot")) + $zfs_enabled = "or ZFS "; $disk = installer_find_first_disk(); if(!$disk) echo "WARNING: Could not find any suitable disks for installation."; @@ -487,8 +490,7 @@ function installer_main() {
Rescue config.xml

Install {$g['product_name']} using the UFS - or - ZFS + {$zfs_enabled} filesystem.

-- cgit v1.1 From c9418f04fd8ddcabffb7b30c68078c6d014eddb3 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sun, 1 Aug 2010 20:15:41 -0400 Subject: Use exclam.gif --- usr/local/www/installer.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'usr/local/www') diff --git a/usr/local/www/installer.php b/usr/local/www/installer.php index a6e2cd8..dc897ce 100644 --- a/usr/local/www/installer.php +++ b/usr/local/www/installer.php @@ -195,7 +195,7 @@ function update_installer_status() { // Check for error and bail if we see one. if(stristr($status, "error")) { $error = true; - echo "\$('installerrunning').innerHTML='An error occurred. Aborting installation.'; "; + echo "\$('installerrunning').innerHTML=' An error occurred. Aborting installation.'; "; echo "\$('progressbar').style.width='100%';\n"; unlink("/tmp/install_complete"); return; @@ -214,7 +214,7 @@ function update_installer_status() { if($progress) echo "\$('progressbar').style.width='{$progress}%';\n"; if(file_exists("/tmp/install_complete")) { - echo "\$('installerrunning').innerHTML='Installation completed. Please reboot to continue';\n"; + echo "\$('installerrunning').innerHTML=' Installation completed. Please reboot to continue';\n"; unlink_if_exists("/tmp/installer.sh"); file_put_contents("/tmp/installer_installer_running", "finished"); } @@ -424,7 +424,7 @@ EOF; function page_table_start() { global $g, $fstype; - echo <<
Rescue config.xml

- Install pfSense using the UFS + Install {$g['product_name']} using the UFS or ZFS filesystem. -- cgit v1.1 From a33cb07c129fe450eb0ae7252b11407ae598f81b Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sun, 1 Aug 2010 20:10:01 -0400 Subject: Only enable ZFS mode if /boot/gptzfsboot exists --- usr/local/www/installer.php | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) (limited to 'usr/local/www') diff --git a/usr/local/www/installer.php b/usr/local/www/installer.php index 070eb4f..a6e2cd8 100644 --- a/usr/local/www/installer.php +++ b/usr/local/www/installer.php @@ -97,7 +97,7 @@ EOF; } function start_installation() { - global $g; + global $g, $fstype; if(file_exists("/tmp/install_complete")) return; $ps_running = exec("ps awwwux | grep -v grep | grep 'sh /tmp/installer.sh'"); @@ -121,7 +121,7 @@ function start_installation() { } function installer_find_first_disk() { - global $g; + global $g, $fstype; $disk = `/PCBSD/pc-sysinstall/pc-sysinstall disk-list | head -n1 | cut -d':' -f1`; return $disk; } @@ -204,7 +204,7 @@ function update_installer_status() { if($installer_running <> "running") { $ps_running = exec("ps awwwux | grep -v grep | grep 'sh /tmp/installer.sh'"); if($ps_running) { - $running = "\$('installerrunning').innerHTML='
 Installer running ({$progress}% completed) - {$fstype}...
'; "; + $running = "\$('installerrunning').innerHTML='
 Installer running ({$progress}% completed)...
'; "; if($running_old <> $running) { echo $running; file_put_contents("/tmp/installer_installer_running", "$running"); @@ -221,14 +221,14 @@ function update_installer_status() { } function update_installer_status_win($status) { - global $g; + global $g, $fstype; echo ""; } function begin_quick_easy_install() { - global $g; + global $g, $fstype; if(file_exists("/tmp/install_complete")) return; unlink_if_exists("/tmp/install_complete"); @@ -245,7 +245,7 @@ function begin_quick_easy_install() { } function head_html() { - global $g; + global $g, $fstype; echo << @@ -277,7 +277,7 @@ EOF; } function body_html() { - global $g; + global $g, $fstype; $pfSversion = str_replace("\n", "", file_get_contents("/etc/version")); if(strstr($pfSversion, "1.2")) $one_two = true; @@ -315,14 +315,14 @@ EOF; } function end_html() { - global $g; + global $g, $fstype; echo ""; echo ""; echo ""; } function template() { - global $g; + global $g, $fstype; head_html(); body_html(); echo <<"; @@ -423,7 +423,7 @@ EOF; } function page_table_start() { - global $g; + global $g, $fstype; echo <<
@@ -445,7 +445,7 @@ EOF; } function page_table_end() { - global $g; + global $g, $fstype; echo <<

-- cgit v1.1 From 524b7a41afc16d0fad2ecb1659e665c781b95bb7 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sun, 1 Aug 2010 23:11:23 -0400 Subject: No need to set a class on these items --- usr/local/www/installer.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'usr/local/www') diff --git a/usr/local/www/installer.php b/usr/local/www/installer.php index dc897ce..147575a 100644 --- a/usr/local/www/installer.php +++ b/usr/local/www/installer.php @@ -483,9 +483,9 @@ function installer_main() {
Please select an installer option to begin: -
+
-
+
Rescue config.xml

-- cgit v1.1 From 824f539d123630d9ac2840bb3e277428fc47267f Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sun, 1 Aug 2010 23:22:22 -0400 Subject: Do not set tabcont class --- usr/local/www/installer.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'usr/local/www') diff --git a/usr/local/www/installer.php b/usr/local/www/installer.php index 147575a..771fb40 100644 --- a/usr/local/www/installer.php +++ b/usr/local/www/installer.php @@ -366,9 +366,9 @@ function quickeasyinstall_gui() {

- +
-
+
-- cgit v1.1 From b12cc5994979c9d6a5b4e5f70ba6faf883917187 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sun, 1 Aug 2010 23:35:53 -0400 Subject: Unbreal exclam.gif --- usr/local/www/installer.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'usr/local/www') diff --git a/usr/local/www/installer.php b/usr/local/www/installer.php index 771fb40..f5e37e0 100644 --- a/usr/local/www/installer.php +++ b/usr/local/www/installer.php @@ -195,7 +195,7 @@ function update_installer_status() { // Check for error and bail if we see one. if(stristr($status, "error")) { $error = true; - echo "\$('installerrunning').innerHTML=' An error occurred. Aborting installation.'; "; + echo "\$('installerrunning').innerHTML=' An error occurred. Aborting installation.'; "; echo "\$('progressbar').style.width='100%';\n"; unlink("/tmp/install_complete"); return; @@ -214,7 +214,7 @@ function update_installer_status() { if($progress) echo "\$('progressbar').style.width='{$progress}%';\n"; if(file_exists("/tmp/install_complete")) { - echo "\$('installerrunning').innerHTML=' Installation completed. Please reboot to continue';\n"; + echo "\$('installerrunning').innerHTML=' Installation completed. Please reboot to continue';\n"; unlink_if_exists("/tmp/installer.sh"); file_put_contents("/tmp/installer_installer_running", "finished"); } -- cgit v1.1 From 8b35aa779f17c034cb9a43fcbad8a2186f6966c9 Mon Sep 17 00:00:00 2001 From: Erik Fonnesbeck Date: Sun, 1 Aug 2010 21:42:35 -0600 Subject: Fix interface name display for various cases on NAT rule listings. --- usr/local/www/firewall_nat.php | 8 +++----- usr/local/www/firewall_nat_1to1.php | 6 +++--- usr/local/www/firewall_nat_out.php | 10 +++------- 3 files changed, 9 insertions(+), 15 deletions(-) (limited to 'usr/local/www') diff --git a/usr/local/www/firewall_nat.php b/usr/local/www/firewall_nat.php index 4e30c56..02a2595 100755 --- a/usr/local/www/firewall_nat.php +++ b/usr/local/www/firewall_nat.php @@ -261,12 +261,10 @@ echo " -- cgit v1.1 From 09f11c7196f0627bd54b174cfd7cf701797ad256 Mon Sep 17 00:00:00 2001 From: jim-p Date: Mon, 2 Aug 2010 15:00:31 -0400 Subject: Ensure static ARP is configured each time the DHCP service is configured. Previously, it was not enabled after bootup, but was if saved from the GUI. Fixes #782 --- usr/local/www/services_dhcp.php | 3 --- 1 file changed, 3 deletions(-) (limited to 'usr/local/www') diff --git a/usr/local/www/services_dhcp.php b/usr/local/www/services_dhcp.php index 79fd1d8..6747d3c 100755 --- a/usr/local/www/services_dhcp.php +++ b/usr/local/www/services_dhcp.php @@ -330,9 +330,6 @@ if ($_POST) { write_config(); - /* static arp configuration */ - interfaces_staticarp_configure($if); - $retval = 0; $retvaldhcp = 0; $retvaldns = 0; -- cgit v1.1 From a771c04477182b5bf01fba6e8d15d9ca9c2e1db3 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Mon, 2 Aug 2010 16:14:46 -0400 Subject: Backout this commit, it was never intended to be committed --- usr/local/www/xmlrpc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'usr/local/www') diff --git a/usr/local/www/xmlrpc.php b/usr/local/www/xmlrpc.php index 591001c..6e1e242 100755 --- a/usr/local/www/xmlrpc.php +++ b/usr/local/www/xmlrpc.php @@ -202,7 +202,7 @@ function merge_config_section_xmlrpc($raw_params) { global $config, $xmlrpc_g; $params = xmlrpc_params_to_php($raw_params); if(!xmlrpc_auth($params)) return $xmlrpc_g['return']['authfail']; - $config = array_merge($config, $params[0]); + $config = array_merge_recursive_unique($config, $params[0]); $mergedkeys = implode(",", array_keys($params[0])); write_config("Merged in config ({$mergedkeys} sections) from XMLRPC client."); return $xmlrpc_g['return']['true']; -- cgit v1.1 From 62c4d0fb3ecaa43d51345c46240edf2f0a95552e Mon Sep 17 00:00:00 2001 From: jim-p Date: Mon, 2 Aug 2010 16:54:04 -0400 Subject: Resync DNS forwarder post-sync. Fixes #117 --- usr/local/www/xmlrpc.php | 1 + 1 file changed, 1 insertion(+) (limited to 'usr/local/www') diff --git a/usr/local/www/xmlrpc.php b/usr/local/www/xmlrpc.php index 6e1e242..bb0559c 100755 --- a/usr/local/www/xmlrpc.php +++ b/usr/local/www/xmlrpc.php @@ -229,6 +229,7 @@ function filter_configure_xmlrpc($raw_params) { require_once("openvpn.inc"); openvpn_resync_all(); services_dhcpd_configure(); + services_dnsmasq_configure(); return $xmlrpc_g['return']['true']; } -- cgit v1.1 From 0ce726624dc1fbc4998ca85d79b27d810d88d5fb Mon Sep 17 00:00:00 2001 From: jim-p Date: Mon, 2 Aug 2010 17:17:46 -0400 Subject: Optionally sync users and groups via xmlrpc. Fixes #650 --- usr/local/www/xmlrpc.php | 1 + 1 file changed, 1 insertion(+) (limited to 'usr/local/www') diff --git a/usr/local/www/xmlrpc.php b/usr/local/www/xmlrpc.php index bb0559c..5daa29a 100755 --- a/usr/local/www/xmlrpc.php +++ b/usr/local/www/xmlrpc.php @@ -230,6 +230,7 @@ function filter_configure_xmlrpc($raw_params) { openvpn_resync_all(); services_dhcpd_configure(); services_dnsmasq_configure(); + local_sync_accounts(); return $xmlrpc_g['return']['true']; } -- cgit v1.1 From 0c9f92bf36fec31af2add57bc5bb05f328bd1652 Mon Sep 17 00:00:00 2001 From: Erik Fonnesbeck Date: Mon, 2 Aug 2010 16:32:42 -0600 Subject: Change these to lower-case to match the lower-case names from the previous revert. --- usr/local/www/firewall_aliases_edit.php | 2 +- usr/local/www/firewall_aliases_import.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'usr/local/www') diff --git a/usr/local/www/firewall_aliases_edit.php b/usr/local/www/firewall_aliases_edit.php index a210373..0f66c25 100755 --- a/usr/local/www/firewall_aliases_edit.php +++ b/usr/local/www/firewall_aliases_edit.php @@ -47,7 +47,7 @@ $pgtitle = array("Firewall","Aliases","Edit"); // Keywords not allowed in names -$reserved_keywords = array("pass", "out", "queue", "max", "min", "PPTP", "PPPoE", "L2TP", "OpenVPN", "IPsec"); +$reserved_keywords = array("pass", "out", "queue", "max", "min", "pptp", "pppoe", "L2TP", "OpenVPN", "IPsec"); require("guiconfig.inc"); require_once("functions.inc"); diff --git a/usr/local/www/firewall_aliases_import.php b/usr/local/www/firewall_aliases_import.php index 3bb9247..402cc3d 100755 --- a/usr/local/www/firewall_aliases_import.php +++ b/usr/local/www/firewall_aliases_import.php @@ -39,7 +39,7 @@ $pgtitle = array("Firewall","Aliases","Bulk import"); -$reserved_keywords = array("pass", "out", "queue", "max", "min", "PPTP", "PPPoE", "L2TP", "OpenVPN", "IPsec"); +$reserved_keywords = array("pass", "out", "queue", "max", "min", "pptp", "pppoe", "L2TP", "OpenVPN", "IPsec"); require("guiconfig.inc"); require_once("util.inc"); -- cgit v1.1 From 01292dc2e49bb49ac37d48d06d0a8a113f1f3be6 Mon Sep 17 00:00:00 2001 From: jim-p Date: Tue, 3 Aug 2010 09:15:59 -0400 Subject: Fix this variable name and error message (It's Static ARP not Static map) --- usr/local/www/services_dhcp_edit.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'usr/local/www') diff --git a/usr/local/www/services_dhcp_edit.php b/usr/local/www/services_dhcp_edit.php index 02a7315..dd98fa4 100755 --- a/usr/local/www/services_dhcp_edit.php +++ b/usr/local/www/services_dhcp_edit.php @@ -72,7 +72,7 @@ if (!is_array($config['dhcpd'][$if]['staticmap'])) { $config['dhcpd'][$if]['staticmap'] = array(); } -$static_map_enabled=isset($config['dhcpd'][$if]['staticarp']); +$static_arp_enabled=isset($config['dhcpd'][$if]['staticarp']); $a_maps = &$config['dhcpd'][$if]['staticmap']; $ifcfgip = get_interface_ip($if); @@ -123,8 +123,8 @@ if ($_POST) { if (($_POST['mac'] && !is_macaddr($_POST['mac']))) { $input_errors[] = "A valid MAC address must be specified."; } - if($static_map_enabled && !$_POST['ipaddr']) { - $input_errors[] = "Static map is enabled. You must specify an IP address."; + if($static_arp_enabled && !$_POST['ipaddr']) { + $input_errors[] = "Static ARP is enabled. You must specify an IP address."; } /* check for overlaps */ -- cgit v1.1 From 073a2697dd86a8dece8dafa28b71084a547ba31e Mon Sep 17 00:00:00 2001 From: jim-p Date: Tue, 3 Aug 2010 09:37:50 -0400 Subject: Prevent enabling static ARP if there are static map entries that lack IP addresses. --- usr/local/www/services_dhcp.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'usr/local/www') diff --git a/usr/local/www/services_dhcp.php b/usr/local/www/services_dhcp.php index 6747d3c..9f4d9d6 100755 --- a/usr/local/www/services_dhcp.php +++ b/usr/local/www/services_dhcp.php @@ -252,6 +252,13 @@ if ($_POST) { } } + $noip = false; + foreach ($a_maps as $map) + if (empty($map['ipaddr'])) + $noip = true; + if ($_POST['staticarp'] && $noip) + $input_errors[] = "Cannot enable static ARP when you have static map entries without IP addresses. Ensure all static maps have IP addresses and try again."; + if (!$input_errors) { /* make sure the range lies within the current subnet */ $subnet_start = ip2ulong(long2ip32(ip2long($ifcfgip) & gen_subnet_mask_long($ifcfgsn))); -- cgit v1.1