diff --git a/Makefile b/Makefile index b2a8dd90d..66f99b6fb 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,7 @@ install: @cp ${.CURDIR}/pkg/+PRE_DEINSTALL ${DESTDIR} @cp ${.CURDIR}/pkg/+POST_INSTALL ${DESTDIR} @cp ${.CURDIR}/pkg/+MANIFEST ${DESTDIR} - # move all sources to their destination and... + # move all sources to their destination @mkdir -p ${DESTDIR}/usr/local @cp -r ${.CURDIR}/src/* ${DESTDIR}/usr/local # bootstrap pkg(8) files that are not in sources @@ -20,7 +20,7 @@ install: @echo /usr/local/etc/pkg/repos/OPNsense.conf @cp ${.CURDIR}/pkg/pkg.conf ${DESTDIR}/usr/local/etc @echo /usr/local/etc/pkg.conf - # ... pretty-print a list of files present + # and finally pretty-print a list of files present @(cd ${.CURDIR}/src; find * -type f) | \ xargs -n1 printf "/usr/local/%s\n" @@ -58,4 +58,4 @@ health: clean: git reset --hard HEAD && git clean -xdqf . -.PHONY: mount umount install lint sweep style setup clean +.PHONY: mount umount install lint sweep style setup health clean diff --git a/src/etc/inc/captiveportal.inc b/src/etc/inc/captiveportal.inc index c1d5fe26c..9847bad26 100644 --- a/src/etc/inc/captiveportal.inc +++ b/src/etc/inc/captiveportal.inc @@ -1075,22 +1075,23 @@ function radius($username,$password,$clientip,$clientmac,$type, $radiusctx = nul } -function captiveportal_write_elements() { +function captiveportal_write_elements() +{ global $g, $config, $cpzone; $cpcfg = $config['captiveportal'][$cpzone]; - if (!is_dir($g['captiveportal_element_path'])) - @mkdir($g['captiveportal_element_path']); + @mkdir('/var/db/cpelements'); if (is_array($cpcfg['element'])) { foreach ($cpcfg['element'] as $data) { - if (!@file_put_contents("{$g['captiveportal_element_path']}/{$data['name']}", base64_decode($data['content']))) { + if (!@file_put_contents("/var/db/cpelements/{$data['name']}", base64_decode($data['content']))) { printf(gettext("Error: cannot open '%s' in captiveportal_write_elements()%s"), $data['name'], "\n"); return 1; } - if (!file_exists("{$g['captiveportal_path']}/{$data['name']}")) - @symlink("{$g['captiveportal_element_path']}/{$data['name']}", "{$g['captiveportal_path']}/{$data['name']}"); + if (!file_exists("/usr/local/captiveportal/{$data['name']}")) { + @symlink("/var/db/cpelements/{$data['name']}", "/usr/local/captiveportal/{$data['name']}"); + } } } diff --git a/src/etc/inc/globals.inc b/src/etc/inc/globals.inc index 283701292..9d873d0b8 100644 --- a/src/etc/inc/globals.inc +++ b/src/etc/inc/globals.inc @@ -48,18 +48,10 @@ $g = array( "product_copyright_owner" => "Deciso B.V.", "product_copyright_years" => "2014 - 2015", "product_copyright_url" => "https://www.deciso.com/", - "crashreporterurl" => "https://crash.opnsense.org/", "latest_config" => "11.1", "minimum_ram_warning" => "101", "minimum_ram_warning_text" => "128 MB", - "wan_interface_name" => "wan", - "xmlrpcbaseurl" => "https://not.supported.opnsense.org", - "captiveportal_path" => "/usr/local/captiveportal", - "captiveportal_element_path" => "/var/db/cpelements", - "captiveportal_element_sizelimit" => 1048576, - "xmlrpcpath" => "/xmlrpc.php", "wireless_regex" => "/^(ndis|wi|ath|an|ral|ural|iwi|wlan|rum|run|bwn|zyd|mwl|bwi|ipw|iwn|malo|uath|upgt|urtw|wpi)/", - "help_base_url" => "/help.php" ); /* IP TOS flags */ diff --git a/src/etc/inc/pfsense-utils.inc b/src/etc/inc/pfsense-utils.inc index 1b00eaea1..88041aba9 100644 --- a/src/etc/inc/pfsense-utils.inc +++ b/src/etc/inc/pfsense-utils.inc @@ -598,8 +598,7 @@ function rmdir_recursive($path,$follow_links=false) { function check_firmware_version($tocheck = "all", $return_php = true) { global $g, $config; - $xmlrpc_base_url = get_active_xml_rpc_base_url(); - $xmlrpcfqdn = preg_replace("(https?://)", "", $xmlrpc_base_url); + $xmlrpcfqdn = preg_replace('(https?://)', '', '/xmlrpc.php'); $ip = gethostbyname($xmlrpcfqdn); if($ip == $xmlrpcfqdn) return false; @@ -2675,16 +2674,3 @@ function get_pppoes_child_interfaces($ifpattern) { return $if_arr; } - -/* Function to find and return the active XML RPC base URL to avoid code duplication */ -function get_active_xml_rpc_base_url() { - global $config, $g; - /* If the user has activated the option to enable an alternate xmlrpcbaseurl, and it's not empty, then use it */ - if (isset($config['system']['altpkgrepo']['enable']) && !empty($config['system']['altpkgrepo']['xmlrpcbaseurl'])) { - return $config['system']['altpkgrepo']['xmlrpcbaseurl']; - } else { - return $g['xmlrpcbaseurl']; - } -} - -?> diff --git a/src/www/crash_reporter.php b/src/www/crash_reporter.php index ee0852baa..30a242778 100644 --- a/src/www/crash_reporter.php +++ b/src/www/crash_reporter.php @@ -33,23 +33,28 @@ require_once("captiveportal.inc"); define("FILE_SIZE", 450000); -function upload_crash_report($files) { +function upload_crash_report($files) +{ global $g; + $post = array(); $counter = 0; + foreach($files as $file) { $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, $g['crashreporterurl']); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, $post); - $response = curl_exec($ch); + + $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, 'https://crash.opnsense.org/'); + curl_setopt($ch, CURLOPT_POST, true); + curl_setopt($ch, CURLOPT_POSTFIELDS, $post); + $response = curl_exec($ch); + return $response; } diff --git a/src/www/fbegin.inc b/src/www/fbegin.inc index ea81d0f3c..6b2bdbd9d 100755 --- a/src/www/fbegin.inc +++ b/src/www/fbegin.inc @@ -62,7 +62,7 @@ if (($pagename == "pkg.php") || ($pagename == "pkg_edit.php") || ($pagename == " } /* Build the full help URL. */ -$helpurl .= "{$g['help_base_url']}?page={$pagename}"; +$helpurl .= "/help.php?page={$pagename}"; function return_ext_menu($section) { global $config; diff --git a/src/www/services_captiveportal_filemanager.php b/src/www/services_captiveportal_filemanager.php index 04c87c530..512d1e040 100644 --- a/src/www/services_captiveportal_filemanager.php +++ b/src/www/services_captiveportal_filemanager.php @@ -1,4 +1,5 @@ $g['captiveportal_element_sizelimit']) { + if (($total_size + $size) > $captiveportal_element_sizelimit) { $input_errors[] = gettext("The total size of all files uploaded may not exceed ") . - format_bytes($g['captiveportal_element_sizelimit']) . "."; + format_bytes($captiveportal_element_sizelimit) . "."; } if (!$input_errors) { @@ -110,8 +113,8 @@ if ($_POST) { } } } else if (($_GET['act'] == "del") && !empty($cpzone) && $a_element[$_GET['id']]) { - @unlink("{$g['captiveportal_element_path']}/" . $a_element[$_GET['id']]['name']); - @unlink("{$g['captiveportal_path']}/" . $a_element[$_GET['id']]['name']); + @unlink("/var/db/cpelements/" . $a_element[$_GET['id']]['name']); + @unlink("/usr/local/captiveportal/" . $a_element[$_GET['id']]['name']); unset($a_element[$_GET['id']]); write_config(); header("Location: services_captiveportal_filemanager.php?zone={$cpzone}"); @@ -228,7 +231,7 @@ $main_buttons = array(

<a href="/captiveportal-aup.php?zone=$PORTAL_ZONE$&redirurl=$PORTAL_REDIRURL$"></a>

- + diff --git a/src/www/wizards/setup_wizard.xml b/src/www/wizards/setup_wizard.xml index 1c84ccd88..0deb4c7cb 100644 --- a/src/www/wizards/setup_wizard.xml +++ b/src/www/wizards/setup_wizard.xml @@ -605,7 +605,7 @@ } unset($config['wizardtemp']); write_config(); - ]]> + ]]>