diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2011-02-09 15:33:15 -0500 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2011-02-09 15:33:15 -0500 |
commit | 652ed95d3d4cfea97610cf4994d86b4f67d8fb4a (patch) | |
tree | ad8b7956f3e106ad892abda50ff1b8966aae96d1 | |
parent | 8b0041e092274a63002f716515faaa082dfc0693 (diff) | |
parent | c90ba62d265223430663da04e5683ddcf0583fba (diff) | |
download | pfsense-652ed95d3d4cfea97610cf4994d86b4f67d8fb4a.zip pfsense-652ed95d3d4cfea97610cf4994d86b4f67d8fb4a.tar.gz |
Merge remote branch 'upstream/master'
-rw-r--r-- | etc/inc/captiveportal.inc | 10 | ||||
-rw-r--r-- | etc/inc/config.console.inc | 2 | ||||
-rw-r--r-- | etc/inc/globals.inc | 2 | ||||
-rwxr-xr-x | sbin/dhclient-script | 3 | ||||
-rwxr-xr-x | usr/local/sbin/ovpn-linkup | 2 | ||||
-rwxr-xr-x | usr/local/www/crash_reporter.php | 28 | ||||
-rwxr-xr-x | usr/local/www/firewall_aliases_edit.php | 2 | ||||
-rwxr-xr-x | usr/local/www/index.php | 22 | ||||
-rwxr-xr-x | usr/local/www/services_captiveportal.php | 3 | ||||
-rw-r--r-- | usr/local/www/widgets/widgets/system_information.widget.php | 2 |
10 files changed, 46 insertions, 30 deletions
diff --git a/etc/inc/captiveportal.inc b/etc/inc/captiveportal.inc index de1c09e..5518dee 100644 --- a/etc/inc/captiveportal.inc +++ b/etc/inc/captiveportal.inc @@ -226,7 +226,7 @@ function captiveportal_configure() { touch("{$g['vardb_path']}/captiveportal.db"); /* kill any running minicron */ - killbypid("{$g['varrun_path']}/minicron.pid"); + killbypid("{$g['varrun_path']}/cp_prunedb.pid"); /* init ipfw rules */ captiveportal_init_rules(true); @@ -417,8 +417,12 @@ EOD; /* start up the webserving daemon */ captiveportal_init_webgui(); + /* Kill any existing prunecaptiveportal processes */ + if(file_exists("{$g['varrun_path']}/cp_prunedb.pid")) + killbypid("{$g['varrun_path']}/cp_prunedb.pid"); + /* start pruning process (interval defaults to 60 seconds) */ - mwexec("/usr/local/bin/minicron $croninterval {$g['varrun_path']}/minicron.pid " . + mwexec("/usr/local/bin/minicron $croninterval {$g['varrun_path']}/cp_prunedb.pid " . "/etc/rc.prunecaptiveportal"); /* generate radius server database */ @@ -429,7 +433,7 @@ EOD; } else { killbypid("{$g['varrun_path']}/lighty-CaptivePortal.pid"); - killbypid("{$g['varrun_path']}/minicron.pid"); + killbypid("{$g['varrun_path']}/cp_prunedb.pid"); captiveportal_radius_stop_all(); diff --git a/etc/inc/config.console.inc b/etc/inc/config.console.inc index 9005b79..d1eb18a 100644 --- a/etc/inc/config.console.inc +++ b/etc/inc/config.console.inc @@ -303,9 +303,9 @@ EOD; echo "\nThe interfaces will be assigned as follows: \n\n"; + echo "WAN -> " . $wanif . "\n"; if ($lanif != "") echo "LAN -> " . $lanif . "\n"; - echo "WAN -> " . $wanif . "\n"; for ($i = 0; $i < count($optif); $i++) { echo "OPT" . ($i+1) . " -> " . $optif[$i] . "\n"; } diff --git a/etc/inc/globals.inc b/etc/inc/globals.inc index b207004..937d193 100644 --- a/etc/inc/globals.inc +++ b/etc/inc/globals.inc @@ -88,6 +88,8 @@ $g = array( "disablethemeselection" => false, "disablehelpmenu" => false, "disablehelpicon" => false, + "disablecrashreporter" => false, + "crashreporterurl" => "http://crashreporter.pfsense.org/crash_reporter.php", "debug" => false, "latest_config" => "7.7", "nopkg_platforms" => array("cdrom"), diff --git a/sbin/dhclient-script b/sbin/dhclient-script index ee98fa0..aaa8144 100755 --- a/sbin/dhclient-script +++ b/sbin/dhclient-script @@ -184,8 +184,9 @@ add_new_routes() { fi ADDED_ROUTE=no + EXISTSGW=`/bin/ls -l /tmp/*_defaultgw | /usr/bin/wc -l` # Only allow the default route to be overridden if it's on our own interface - if [ -f "/tmp/${interface}_defaultgw" ]; then + if [ -f "/tmp/${interface}_defaultgw" -o $EXISTSGW -eq 0 ]; then $ROUTE delete default for router in $new_routers; do if [ "$new_ip_address" = "$router" ]; then diff --git a/usr/local/sbin/ovpn-linkup b/usr/local/sbin/ovpn-linkup index f962ac2..60489c2 100755 --- a/usr/local/sbin/ovpn-linkup +++ b/usr/local/sbin/ovpn-linkup @@ -1,7 +1,5 @@ #!/bin/sh -# write nameservers to file needs dns fidnings?! - # let the configuration system know that the ip has changed. #/usr/local/sbin/pfSctl -c "interface newip $interface" /bin/echo $4 > /tmp/$1_router diff --git a/usr/local/www/crash_reporter.php b/usr/local/www/crash_reporter.php index c75fe72..8b03936 100755 --- a/usr/local/www/crash_reporter.php +++ b/usr/local/www/crash_reporter.php @@ -42,19 +42,24 @@ require("guiconfig.inc"); require("functions.inc"); require("captiveportal.inc"); +define("FILE_SIZE", 450000); + function upload_crash_report($files) { + global $g; $post = array(); $counter = 0; foreach($files as $file) { - $post["file{$counter}"] = "@{$file}"; - $counter++; + if(filesize($cf) < FILE_SIZE) { + $post["file{$counter}"] = "@{$file}"; + $counter++; + } } $ch = curl_init(); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_VERBOSE, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible;)"); - curl_setopt($ch, CURLOPT_URL, "http://crashreporter.pfsense.org/crash_reporter.php"); + curl_setopt($ch, CURLOPT_URL, $g['crashreporterurl']); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $post); $response = curl_exec($ch); @@ -71,8 +76,8 @@ function output_crash_reporter_html($crash_reports) { echo gettext("Contents of crash reports") . ":<br/>"; echo "<textarea readonly rows='40' cols='65' name='crashreports'>{$crash_reports}</textarea>"; echo "<p/>"; - echo "<input name=\"Submit\" type=\"submit\" class=\"formbtn\" value=\"" . gettext("Yes") . "\">"; - echo "<input name=\"Submit\" type=\"submit\" class=\"formbtn\" value=\"" . gettext("No") . "\">"; + echo "<input name=\"Submit\" type=\"submit\" class=\"formbtn\" value=\"" . gettext("Yes") . "\">" . gettext(" - Submit this to the developers for inspection"); + echo "<p/><input name=\"Submit\" type=\"submit\" class=\"formbtn\" value=\"" . gettext("No") . "\">" . gettext(" - Just delete the crash report and take me back to the Dashboard"); echo "<p/>"; echo "</form>"; } @@ -102,13 +107,12 @@ $crash_report_header .= "\nCrash report details:\n"; $files_to_upload = glob("/var/crash/*"); echo "<p/>"; echo gettext("Uploading..."); - echo "<p/>"; if(is_array($files_to_upload)) { $resp = upload_crash_report($files_to_upload); - print_r($resp); exec("rm /var/crash/*"); - echo gettext("Crash files have been submitted for inspection."); - echo "<p/><a href='/'>" . gettext("Continue") . "</a>" . gettext(" and delete crash report files."); + echo "<p/>"; + print_r($resp); + echo "<p/><a href='/'>" . gettext("Continue") . "</a>" . gettext(" and delete crash report files from local disk."); } else { echo "Could not find any crash files."; } @@ -121,8 +125,10 @@ $crash_report_header .= "\nCrash report details:\n"; $crash_reports .= $crash_report_header; if(is_array($crash_files)) { foreach($crash_files as $cf) { - $crash_reports .= "\nFilename: {$cf}\n"; - $crash_reports .= file_get_contents($cf); + if(filesize($cf) < FILE_SIZE) { + $crash_reports .= "\nFilename: {$cf}\n"; + $crash_reports .= file_get_contents($cf); + } } } else { echo "Could not locate any crash data."; diff --git a/usr/local/www/firewall_aliases_edit.php b/usr/local/www/firewall_aliases_edit.php index 736b362..77933df 100755 --- a/usr/local/www/firewall_aliases_edit.php +++ b/usr/local/www/firewall_aliases_edit.php @@ -295,6 +295,8 @@ if ($_POST) { // Firewall rules update_alias_names_upon_change('filter', 'rule', 'source', 'address', $_POST['name'], $origname); update_alias_names_upon_change('filter', 'rule', 'destination', 'address', $_POST['name'], $origname); + update_alias_names_upon_change('filter', 'rule', 'source', 'port', $_POST['name'], $origname); + update_alias_names_upon_change('filter', 'rule', 'destination', 'port', $_POST['name'], $origname); // NAT Rules update_alias_names_upon_change('nat', 'rule', 'source', 'address', $_POST['name'], $origname); update_alias_names_upon_change('nat', 'rule', 'source', 'port', $_POST['name'], $origname); diff --git a/usr/local/www/index.php b/usr/local/www/index.php index 43520ba..92376e5 100755 --- a/usr/local/www/index.php +++ b/usr/local/www/index.php @@ -56,17 +56,19 @@ require_once('functions.inc'); require_once('guiconfig.inc'); require_once('notices.inc'); -// Check to see if we have a crash report -$crash = glob("/var/crash/*"); -$x = 0; -$skip_files = array(".", "..", "minfree", ""); -if(is_array($crash)) { - foreach($crash as $c) { - if (!in_array(basename($c), $skip_files)) - $x++; +if($g['disablecrashreporter'] != true) { + // Check to see if we have a crash report + $crash = glob("/var/crash/*"); + $x = 0; + $skip_files = array(".", "..", "minfree", ""); + if(is_array($crash)) { + foreach($crash as $c) { + if (!in_array(basename($c), $skip_files)) + $x++; + } + if($x > 0) + $savemsg = "{$g['product_name']} has detected a crash report. Click <a href='crash_reporter.php'>here</a> for more information."; } - if($x > 0) - $savemsg = "{$g['product_name']} has detected a crash report. Click <a href='crash_reporter.php'>here</a> for more information."; } ##build list of widgets diff --git a/usr/local/www/services_captiveportal.php b/usr/local/www/services_captiveportal.php index 8d12c7c..faaeb37 100755 --- a/usr/local/www/services_captiveportal.php +++ b/usr/local/www/services_captiveportal.php @@ -82,6 +82,7 @@ $pconfig['radmac_secret'] = $config['captiveportal']['radmac_secret']; $pconfig['reauthenticate'] = isset($config['captiveportal']['reauthenticate']); $pconfig['reauthenticateacct'] = $config['captiveportal']['reauthenticateacct']; $pconfig['httpslogin_enable'] = isset($config['captiveportal']['httpslogin']); +$pconfig['httpsname'] = $config['captiveportal']['httpsname']; $pconfig['preauthurl'] = strtolower($config['captiveportal']['preauthurl']); $pconfig['cert'] = base64_decode($config['captiveportal']['certificate']); $pconfig['cacert'] = base64_decode($config['captiveportal']['cacertificate']); @@ -583,7 +584,7 @@ value="<?=htmlspecialchars($pconfig['radiuskey2']);?>"></td> </tr> <tr> - <td class="vncell" valign="top"><?=gettext("Radius ip attribute"); ?></td> + <td class="vncell" valign="top"><?=gettext("RADIUS NAS IP attribute"); ?></td> <td> <select name="radiussrcip_attribute" id="radiussrcip_attribute"> <?php $iflist = get_configured_interface_with_descr(); diff --git a/usr/local/www/widgets/widgets/system_information.widget.php b/usr/local/www/widgets/widgets/system_information.widget.php index 1b9683a..dfc85c1 100644 --- a/usr/local/www/widgets/widgets/system_information.widget.php +++ b/usr/local/www/widgets/widgets/system_information.widget.php @@ -38,7 +38,7 @@ require_once("guiconfig.inc"); require_once('notices.inc'); if($_REQUEST['getupdatestatus']) { - if(isset($curcfg['alturl']['enable'])) + if(isset($config['system']['firmware']['alturl']['enable'])) $updater_url = "{$config['system']['firmware']['alturl']['firmwareurl']}"; else $updater_url = $g['update_url']; |