1
|
<?php
|
2
|
/****h* pfSense/config
|
3
|
* NAME
|
4
|
* config.gui.inc - Functions to manipulate config.xml
|
5
|
* DESCRIPTION
|
6
|
* This include contains various config.xml specific functions.
|
7
|
* HISTORY
|
8
|
* $Id$
|
9
|
******
|
10
|
|
11
|
config.gui.inc
|
12
|
Copyright (C) 2004-2010 Scott Ullrich
|
13
|
All rights reserved.
|
14
|
|
15
|
originally part of m0n0wall (http://m0n0.ch/wall)
|
16
|
Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
|
17
|
All rights reserved.
|
18
|
|
19
|
Redistribution and use in source and binary forms, with or without
|
20
|
modification, are permitted provided that the following conditions are met:
|
21
|
|
22
|
1. Redistributions of source code must retain the above copyright notice,
|
23
|
this list of conditions and the following disclaimer.
|
24
|
|
25
|
2. Redistributions in binary form must reproduce the above copyright
|
26
|
notice, this list of conditions and the following disclaimer in the
|
27
|
documentation and/or other materials provided with the distribution.
|
28
|
|
29
|
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
30
|
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
31
|
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
32
|
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
|
33
|
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
34
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
35
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
36
|
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
37
|
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
38
|
POSSIBILITY OF SUCH DAMAGE.
|
39
|
|
40
|
|
41
|
pfSense_BUILDER_BINARIES: /sbin/mount /sbin/umount /sbin/halt /sbin/fsck
|
42
|
pfSense_MODULE: config
|
43
|
*/
|
44
|
|
45
|
require_once("globals.inc");
|
46
|
|
47
|
/* do not load this file twice. */
|
48
|
if($config_parsed == true)
|
49
|
return;
|
50
|
else
|
51
|
$config_parsed = true;
|
52
|
|
53
|
/* include globals from notices.inc /utility/XML parser files */
|
54
|
require_once('config.lib.inc');
|
55
|
require_once("notices.inc");
|
56
|
require_once("util.inc");
|
57
|
require_once("IPv6.inc");
|
58
|
if(file_exists("/cf/conf/use_xmlreader"))
|
59
|
require_once("xmlreader.inc");
|
60
|
else
|
61
|
require_once("xmlparse.inc");
|
62
|
require_once("crypt.inc");
|
63
|
|
64
|
/* read platform */
|
65
|
if (file_exists("{$g['etc_path']}/platform")) {
|
66
|
$g['platform'] = chop(file_get_contents("{$g['etc_path']}/platform"));
|
67
|
} else {
|
68
|
$g['platform'] = "unknown";
|
69
|
}
|
70
|
|
71
|
/* if /debugging exists, lets set $debugging
|
72
|
so we can output more information */
|
73
|
if(file_exists("/debugging")) {
|
74
|
$debugging = true;
|
75
|
$g['debug'] = true;
|
76
|
}
|
77
|
|
78
|
$config = parse_config();
|
79
|
|
80
|
if($config_parsed == true) {
|
81
|
/* process packager manager custom rules */
|
82
|
if(is_dir("/usr/local/pkg/parse_config")) {
|
83
|
run_plugins("/usr/local/pkg/parse_config/");
|
84
|
}
|
85
|
}
|
86
|
|
87
|
?>
|