Commit e6ed2ac2 authored by Ad Schellevis's avatar Ad Schellevis Committed by Franco Fichtner

(legacy) restructure requires/includes, move globals.inc

parent 36437459
...@@ -36,9 +36,6 @@ ...@@ -36,9 +36,6 @@
* file courtesy of Michael Retterklieber. * file courtesy of Michael Retterklieber.
*/ */
// previous in config.gui.inc
require_once("globals.inc");
/* include globals from notices.inc /utility/XML parser files */ /* include globals from notices.inc /utility/XML parser files */
require_once('config.lib.inc'); require_once('config.lib.inc');
require_once("util.inc"); require_once("util.inc");
......
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
require_once("auth.inc"); require_once("auth.inc");
require_once("filter.inc"); require_once("filter.inc");
require_once("functions.inc"); require_once("functions.inc");
require_once("globals.inc");
// provided via legacy_bindings.inc // provided via legacy_bindings.inc
global $priv_list; global $priv_list;
......
...@@ -44,7 +44,6 @@ require_once("util.inc"); ...@@ -44,7 +44,6 @@ require_once("util.inc");
require_once("IPv6.inc"); require_once("IPv6.inc");
require_once("xmlparse.inc"); require_once("xmlparse.inc");
require_once("crypt.inc"); require_once("crypt.inc");
require_once("globals.inc");
$config = parse_config(); $config = parse_config();
......
...@@ -30,9 +30,12 @@ ...@@ -30,9 +30,12 @@
*/ */
require_once("interfaces.lib.inc"); require_once("interfaces.lib.inc");
require_once("globals.inc");
require_once("util.inc"); require_once("util.inc");
require_once("gwlb.inc"); require_once("gwlb.inc");
require_once('services.inc');
require_once('openvpn.inc');
require_once("services.inc");
/* /*
* converts a string like "a,b,c,d" * converts a string like "a,b,c,d"
...@@ -1346,8 +1349,6 @@ function interface_bring_down($interface = "wan", $destroy = false, $ifacecfg = ...@@ -1346,8 +1349,6 @@ function interface_bring_down($interface = "wan", $destroy = false, $ifacecfg =
} }
if (!empty($track6) && is_array($track6)) { if (!empty($track6) && is_array($track6)) {
if (!function_exists('services_dhcp_configure'))
require_once('services.inc');
/* Bring down radvd and dhcp6 on these interfaces */ /* Bring down radvd and dhcp6 on these interfaces */
services_dhcpd_configure('inet6', $track6); services_dhcpd_configure('inet6', $track6);
} }
...@@ -2839,8 +2840,6 @@ function interface_virtual_create($interface) { ...@@ -2839,8 +2840,6 @@ function interface_virtual_create($interface) {
if (is_array($config['openvpn']) && is_array($config['openvpn']['openvpn-server'])) { if (is_array($config['openvpn']) && is_array($config['openvpn']['openvpn-server'])) {
foreach ($config['openvpn']['openvpn-server'] as $server) { foreach ($config['openvpn']['openvpn-server'] as $server) {
if ($interface == "ovpns{$server['vpnid']}") { if ($interface == "ovpns{$server['vpnid']}") {
if (!function_exists('openvpn_resync'))
require_once('openvpn.inc');
log_error("OpenVPN: Resync server {$server['description']}"); log_error("OpenVPN: Resync server {$server['description']}");
openvpn_resync('server', $server); openvpn_resync('server', $server);
} }
...@@ -2851,8 +2850,6 @@ function interface_virtual_create($interface) { ...@@ -2851,8 +2850,6 @@ function interface_virtual_create($interface) {
if (is_array($config['openvpn']) && is_array($config['openvpn']['openvpn-client'])) { if (is_array($config['openvpn']) && is_array($config['openvpn']['openvpn-client'])) {
foreach ($config['openvpn']['openvpn-client'] as $client) { foreach ($config['openvpn']['openvpn-client'] as $client) {
if ($interface == "ovpnc{$client['vpnid']}") { if ($interface == "ovpnc{$client['vpnid']}") {
if (!function_exists('openvpn_resync'))
require_once('openvpn.inc');
log_error("OpenVPN: Resync server {$client['description']}"); log_error("OpenVPN: Resync server {$client['description']}");
openvpn_resync('client', $client); openvpn_resync('client', $client);
} }
...@@ -3219,9 +3216,6 @@ function interface_track6_configure($interface = 'lan', $wancfg, $linkupevent = ...@@ -3219,9 +3216,6 @@ function interface_track6_configure($interface = 'lan', $wancfg, $linkupevent =
} }
if (!file_exists("/var/run/booting") && $linkupevent == false) { if (!file_exists("/var/run/booting") && $linkupevent == false) {
if (!function_exists('services_dhcpd_configure'))
require_once("services.inc");
services_dhcpd_configure("inet6"); services_dhcpd_configure("inet6");
} }
......
...@@ -34,7 +34,6 @@ ...@@ -34,7 +34,6 @@
* in our config.xml file and check the credentials. * in our config.xml file and check the credentials.
*/ */
require_once("globals.inc");
require_once("config.inc"); require_once("config.inc");
require_once("radius.inc"); require_once("radius.inc");
require_once("auth.inc"); require_once("auth.inc");
......
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
* *
*/ */
require_once("globals.inc");
require_once("led.inc"); require_once("led.inc");
require_once("util.inc"); require_once("util.inc");
require_once("notices.growl.class"); require_once("notices.growl.class");
...@@ -90,8 +89,6 @@ function file_notice($id, $notice, $category = "General", $url = "", $priority = ...@@ -90,8 +89,6 @@ function file_notice($id, $notice, $category = "General", $url = "", $priority =
******/ ******/
function get_notices($category = 'all') function get_notices($category = 'all')
{ {
global $g;
if (file_exists('/tmp/notices')) { if (file_exists('/tmp/notices')) {
$queue = unserialize(file_get_contents('/tmp/notices')); $queue = unserialize(file_get_contents('/tmp/notices'));
if(!$queue) return false; if(!$queue) return false;
...@@ -218,7 +215,7 @@ function are_notices_pending($category = 'all') ...@@ -218,7 +215,7 @@ function are_notices_pending($category = 'all')
* returns true if message was sent * returns true if message was sent
******/ ******/
function notify_via_smtp($message, $force = false) { function notify_via_smtp($message, $force = false) {
global $config, $g; global $config;
if(file_exists("/var/run/booting")) if(file_exists("/var/run/booting"))
return; return;
...@@ -242,7 +239,7 @@ function notify_via_smtp($message, $force = false) { ...@@ -242,7 +239,7 @@ function notify_via_smtp($message, $force = false) {
} }
function send_smtp_message($message, $subject = "(no subject)") { function send_smtp_message($message, $subject = "(no subject)") {
global $config, $g; global $config;
if(!$config['notifications']['smtp']['ipaddress']) if(!$config['notifications']['smtp']['ipaddress'])
return; return;
......
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
POSSIBILITY OF SUCH DAMAGE. POSSIBILITY OF SUCH DAMAGE.
*/ */
require_once("globals.inc");
require_once("openvpn.inc"); require_once("openvpn.inc");
require_once("filter.inc"); require_once("filter.inc");
require_once("util.inc"); require_once("util.inc");
......
...@@ -34,7 +34,6 @@ ...@@ -34,7 +34,6 @@
* in our config.xml file and check the credentials. * in our config.xml file and check the credentials.
*/ */
require_once("globals.inc");
require_once("config.inc"); require_once("config.inc");
require_once("radius.inc"); require_once("radius.inc");
require_once("auth.inc"); require_once("auth.inc");
......
...@@ -35,7 +35,6 @@ ...@@ -35,7 +35,6 @@
* intermediates. * intermediates.
*/ */
require_once("globals.inc");
require_once("config.inc"); require_once("config.inc");
require_once("interfaces.inc"); require_once("interfaces.inc");
......
...@@ -103,8 +103,6 @@ echo " done.\n"; ...@@ -103,8 +103,6 @@ echo " done.\n";
echo "Initializing..."; echo "Initializing...";
echo "."; echo ".";
require_once("globals.inc");
echo ".";
require_once("led.inc"); require_once("led.inc");
led_normalize(); led_normalize();
echo "."; echo ".";
......
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
*/ */
require_once("globals.inc");
require_once("config.inc"); require_once("config.inc");
require_once("functions.inc"); require_once("functions.inc");
require_once("filter.inc"); require_once("filter.inc");
......
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
POSSIBILITY OF SUCH DAMAGE. POSSIBILITY OF SUCH DAMAGE.
*/ */
require_once("globals.inc");
require_once("config.inc"); require_once("config.inc");
require_once("functions.inc"); require_once("functions.inc");
require_once("filter.inc"); require_once("filter.inc");
......
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
*/ */
/* parse the configuration and include all functions used below */ /* parse the configuration and include all functions used below */
require_once("globals.inc");
require_once("config.inc"); require_once("config.inc");
require_once("interfaces.inc"); require_once("interfaces.inc");
require_once("util.inc"); require_once("util.inc");
......
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
*/ */
/* parse the configuration and include all functions used below */ /* parse the configuration and include all functions used below */
require_once("globals.inc");
require_once("config.inc"); require_once("config.inc");
require_once("filter.inc"); require_once("filter.inc");
require_once("interfaces.inc"); require_once("interfaces.inc");
......
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
*/ */
/* parse the configuration and include all functions used below */ /* parse the configuration and include all functions used below */
require_once("globals.inc");
require_once("config.inc"); require_once("config.inc");
require_once("functions.inc"); require_once("functions.inc");
require_once("filter.inc"); require_once("filter.inc");
......
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
*/ */
/* parse the configuration and include all functions used below */ /* parse the configuration and include all functions used below */
require_once("globals.inc");
require_once("config.inc"); require_once("config.inc");
require_once("functions.inc"); require_once("functions.inc");
require_once("filter.inc"); require_once("filter.inc");
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
small tests to ensure the php environment is sane. small tests to ensure the php environment is sane.
*/ */
require_once('globals.inc');
require_once('util.inc'); require_once('util.inc');
require_once('xmlparse.inc'); require_once('xmlparse.inc');
require_once('config.lib.inc'); require_once('config.lib.inc');
......
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
POSSIBILITY OF SUCH DAMAGE. POSSIBILITY OF SUCH DAMAGE.
*/ */
require_once("globals.inc");
require_once("config.inc"); require_once("config.inc");
require_once("functions.inc"); require_once("functions.inc");
......
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
POSSIBILITY OF SUCH DAMAGE. POSSIBILITY OF SUCH DAMAGE.
*/ */
require_once('globals.inc');
require_once('config.inc'); require_once('config.inc');
require_once('functions.inc'); require_once('functions.inc');
......
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
*/ */
require_once("config.inc"); require_once("config.inc");
require_once("globals.inc");
require_once("gmirror.inc"); require_once("gmirror.inc");
global $g; global $g;
......
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
*/ */
require_once("guiconfig.inc"); require_once("guiconfig.inc");
require_once("globals.inc");
function interfaces_carp_set_maintenancemode($carp_maintenancemode){ function interfaces_carp_set_maintenancemode($carp_maintenancemode){
global $config; global $config;
......
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
POSSIBILITY OF SUCH DAMAGE. POSSIBILITY OF SUCH DAMAGE.
*/ */
require_once("globals.inc");
require_once("functions.inc"); require_once("functions.inc");
require_once("shortcuts.inc"); require_once("shortcuts.inc");
require_once("services.inc"); require_once("services.inc");
......
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
POSSIBILITY OF SUCH DAMAGE. POSSIBILITY OF SUCH DAMAGE.
*/ */
require_once("globals.inc");
require_once("guiconfig.inc"); require_once("guiconfig.inc");
header("Last-Modified: " . gmdate( "D, j M Y H:i:s" ) . " GMT" ); header("Last-Modified: " . gmdate( "D, j M Y H:i:s" ) . " GMT" );
......
...@@ -27,6 +27,8 @@ ...@@ -27,6 +27,8 @@
POSSIBILITY OF SUCH DAMAGE. POSSIBILITY OF SUCH DAMAGE.
*/ */
require_once("guiconfig.inc");
function staticmapcmp($a, $b) { function staticmapcmp($a, $b) {
return ipcmp($a['ipaddr'], $b['ipaddr']); return ipcmp($a['ipaddr'], $b['ipaddr']);
} }
...@@ -37,9 +39,6 @@ function staticmaps_sort($ifgui) { ...@@ -37,9 +39,6 @@ function staticmaps_sort($ifgui) {
usort($config['dhcpd'][$ifgui]['staticmap'], "staticmapcmp"); usort($config['dhcpd'][$ifgui]['staticmap'], "staticmapcmp");
} }
require_once('globals.inc');
require_once("guiconfig.inc");
$referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/services_dhcp.php'); $referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/services_dhcp.php');
$if = $_GET['if']; $if = $_GET['if'];
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE. POSSIBILITY OF SUCH DAMAGE.
*/ */
require_once("guiconfig.inc");
function staticmapcmp($a, $b) { function staticmapcmp($a, $b) {
return ipcmp($a['ipaddrv6'], $b['ipaddrv6']); return ipcmp($a['ipaddrv6'], $b['ipaddrv6']);
...@@ -38,8 +39,6 @@ function staticmaps_sort($ifgui) { ...@@ -38,8 +39,6 @@ function staticmaps_sort($ifgui) {
usort($config['dhcpdv6'][$ifgui]['staticmap'], "staticmapcmp"); usort($config['dhcpdv6'][$ifgui]['staticmap'], "staticmapcmp");
} }
require_once('globals.inc');
require_once("guiconfig.inc");
$referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/services_dhcpv6.php'); $referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/services_dhcpv6.php');
......
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
POSSIBILITY OF SUCH DAMAGE. POSSIBILITY OF SUCH DAMAGE.
*/ */
require_once("globals.inc");
require_once("guiconfig.inc"); require_once("guiconfig.inc");
require_once("functions.inc"); require_once("functions.inc");
......
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
POSSIBILITY OF SUCH DAMAGE. POSSIBILITY OF SUCH DAMAGE.
*/ */
require_once("globals.inc");
require_once("guiconfig.inc"); require_once("guiconfig.inc");
require_once("filter.inc"); require_once("filter.inc");
require_once("rrd.inc"); require_once("rrd.inc");
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
*/ */
require_once("guiconfig.inc"); require_once("guiconfig.inc");
require_once("gwlb.inc");
$referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/system_gateways.php'); $referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/system_gateways.php');
......
...@@ -30,7 +30,6 @@ ...@@ -30,7 +30,6 @@
DISABLE_PHP_LINT_CHECKING DISABLE_PHP_LINT_CHECKING
*/ */
require_once("globals.inc");
require_once("guiconfig.inc"); require_once("guiconfig.inc");
require("openvpn-client-export.inc"); require("openvpn-client-export.inc");
......
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
POSSIBILITY OF SUCH DAMAGE. POSSIBILITY OF SUCH DAMAGE.
*/ */
require_once("globals.inc");
require_once("guiconfig.inc"); require_once("guiconfig.inc");
require_once("openvpn-client-export.inc"); require_once("openvpn-client-export.inc");
......
...@@ -30,7 +30,6 @@ ...@@ -30,7 +30,6 @@
$nocsrf = true; $nocsrf = true;
require_once("globals.inc");
require_once("guiconfig.inc"); require_once("guiconfig.inc");
require_once("pfsense-utils.inc"); require_once("pfsense-utils.inc");
require_once("functions.inc"); require_once("functions.inc");
......
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
POSSIBILITY OF SUCH DAMAGE. POSSIBILITY OF SUCH DAMAGE.
*/ */
require_once("globals.inc");
require_once("guiconfig.inc"); require_once("guiconfig.inc");
require_once("functions.inc"); require_once("functions.inc");
require_once("filter.inc"); require_once("filter.inc");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment