Merge remote branch 'upstream/master'

This commit is contained in:
Scott Ullrich 2011-02-09 15:33:15 -05:00
commit 652ed95d3d
10 changed files with 46 additions and 30 deletions

View File

@ -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();

View File

@ -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";
}

View File

@ -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"),

View File

@ -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

View File

@ -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

View File

@ -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.";

View File

@ -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);

View File

@ -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

View File

@ -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();

View File

@ -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'];