From 7773bb31cdf451770b2544df32a9fb8a118a0e97 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Fri, 24 Apr 2015 11:03:26 +0200 Subject: [PATCH] src: varetc_path gone; now we're getting somewhere... --- src/etc/inc/captiveportal.inc | 26 ++++++++-------- src/etc/inc/globals.inc | 1 - src/etc/inc/openvpn.auth-user.php | 4 +-- src/etc/inc/openvpn.inc | 52 +++++++++++++++---------------- src/etc/inc/service-utils.inc | 5 ++- src/etc/inc/services.inc | 18 +++++------ src/etc/inc/system.inc | 28 ++++++++--------- src/etc/inc/voucher.inc | 12 +++---- src/etc/inc/vslb.inc | 17 +++++----- 9 files changed, 79 insertions(+), 84 deletions(-) diff --git a/src/etc/inc/captiveportal.inc b/src/etc/inc/captiveportal.inc index 0f4e939a8..196242ede 100644 --- a/src/etc/inc/captiveportal.inc +++ b/src/etc/inc/captiveportal.inc @@ -212,7 +212,7 @@ function portal_allow($clientip,$clientmac,$username,$password = null, $attribut else $message = 0; - include("{$g['varetc_path']}/captiveportal-{$cpzone}-logout.html"); + include("/var/etc/captiveportal-{$cpzone}-logout.html"); } else { // TODO: remove? should be handled by login page @@ -422,7 +422,7 @@ function captiveportal_configure_zone($cpcfg) { $htmltext = get_default_captive_portal_html(); } - $fd = @fopen("{$g['varetc_path']}/captiveportal_{$cpzone}.html", "w"); + $fd = @fopen("/var/etc/captiveportal_{$cpzone}.html", "w"); if ($fd) { // Special case handling. Convert so that we can pass this page // through the PHP interpreter later without clobbering the vars. @@ -450,7 +450,7 @@ function captiveportal_configure_zone($cpcfg) { $errtext = get_default_captive_portal_html(); } - $fd = @fopen("{$g['varetc_path']}/captiveportal-{$cpzone}-error.html", "w"); + $fd = @fopen("/var/etc/captiveportal-{$cpzone}-error.html", "w"); if ($fd) { // Special case handling. Convert so that we can pass this page // through the PHP interpreter later without clobbering the vars. @@ -510,7 +510,7 @@ document.location.href=""; EOD; } - $fd = @fopen("{$g['varetc_path']}/captiveportal-{$cpzone}-logout.html", "w"); + $fd = @fopen("/var/etc/captiveportal-{$cpzone}-logout.html", "w"); if ($fd) { fwrite($fd, $logouttext); fclose($fd); @@ -553,9 +553,9 @@ EOD; killbypid("/var/run/lighty-{$cpzone}-CaptivePortal.pid"); killbypid("/var/run/lighty-{$cpzone}-CaptivePortal-SSL.pid"); killbypid("/var/run/cp_prunedb_{$cpzone}.pid"); - @unlink("{$g['varetc_path']}/captiveportal_{$cpzone}.html"); - @unlink("{$g['varetc_path']}/captiveportal-{$cpzone}-error.html"); - @unlink("{$g['varetc_path']}/captiveportal-{$cpzone}-logout.html"); + @unlink("/var/etc/captiveportal_{$cpzone}.html"); + @unlink("/var/etc/captiveportal-{$cpzone}-error.html"); + @unlink("/var/etc/captiveportal-{$cpzone}-logout.html"); captiveportal_radius_stop_all(); @@ -637,7 +637,7 @@ function captiveportal_init_webgui_zone($cpcfg) } system_generate_lighty_config( - "{$g['varetc_path']}/lighty-{$cpzone}-CaptivePortal-SSL.conf", + "/var/etc/lighty-{$cpzone}-CaptivePortal-SSL.conf", $crt, $key, $ca, @@ -658,7 +658,7 @@ function captiveportal_init_webgui_zone($cpcfg) } system_generate_lighty_config( - "{$g['varetc_path']}/lighty-{$cpzone}-CaptivePortal.conf", + "/var/etc/lighty-{$cpzone}-CaptivePortal.conf", "", "", "", @@ -672,12 +672,12 @@ function captiveportal_init_webgui_zone($cpcfg) @unlink("{$g['varrun']}/lighty-{$cpzone}-CaptivePortal.pid"); /* attempt to start lighttpd */ - $res = mwexec("/usr/local/sbin/lighttpd -f {$g['varetc_path']}/lighty-{$cpzone}-CaptivePortal.conf"); + $res = mwexec("/usr/local/sbin/lighttpd -f /var/etc/lighty-{$cpzone}-CaptivePortal.conf"); /* fire up https instance */ if (isset($cpcfg['httpslogin'])) { @unlink("{$g['varrun']}/lighty-{$cpzone}-CaptivePortal-SSL.pid"); - $res = mwexec("/usr/local/sbin/lighttpd -f {$g['varetc_path']}/lighty-{$cpzone}-CaptivePortal-SSL.conf"); + $res = mwexec("/usr/local/sbin/lighttpd -f /var/etc/lighty-{$cpzone}-CaptivePortal-SSL.conf"); } } @@ -1318,9 +1318,9 @@ function portal_reply_page($redirurl, $type = null, $message = null, $clientmac header("Location: {$redirurl}"); return; } else if ($type == "login") - $htmltext = get_include_contents("{$g['varetc_path']}/captiveportal_{$cpzone}.html"); + $htmltext = get_include_contents("/var/etc/captiveportal_{$cpzone}.html"); else - $htmltext = get_include_contents("{$g['varetc_path']}/captiveportal-{$cpzone}-error.html"); + $htmltext = get_include_contents("/var/etc/captiveportal-{$cpzone}-error.html"); $cpcfg = $config['captiveportal'][$cpzone]; diff --git a/src/etc/inc/globals.inc b/src/etc/inc/globals.inc index 2defc9171..95f0d9cd4 100644 --- a/src/etc/inc/globals.inc +++ b/src/etc/inc/globals.inc @@ -37,7 +37,6 @@ $g = array( "factory_shipped_password" => "opnsense", "dhcpd_chroot_path" => "/var/dhcpd", "unbound_chroot_path" => "/var/unbound", - "varetc_path" => "/var/etc", "admin_group" => "admins", "product_name" => "OPNsense", "product_website" => "https://opnsense.org", diff --git a/src/etc/inc/openvpn.auth-user.php b/src/etc/inc/openvpn.auth-user.php index 3d70cdb62..17da3aa58 100644 --- a/src/etc/inc/openvpn.auth-user.php +++ b/src/etc/inc/openvpn.auth-user.php @@ -98,8 +98,8 @@ if (!$username || !$password) { /* Replaced by a sed with propper variables used below(ldap parameters). */ //