Project

General

Profile

Download (3.71 KB) Statistics
| Branch: | Tag: | Revision:
1 65e2c06c Erik
<?php
2 09221bc3 Renato Botelho
/*
3 032c40c7 Scott Ullrich
	config.gui.inc
4 09221bc3 Renato Botelho
5
	part of pfSense (https://www.pfsense.org)
6
	Copyright (c) 2004-2016 Electric Sheep Fencing, LLC. All rights reserved.
7 65e2c06c Erik
8
	originally part of m0n0wall (http://m0n0.ch/wall)
9
	Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
10
	All rights reserved.
11
12
	Redistribution and use in source and binary forms, with or without
13
	modification, are permitted provided that the following conditions are met:
14
15
	1. Redistributions of source code must retain the above copyright notice,
16
	   this list of conditions and the following disclaimer.
17
18
	2. Redistributions in binary form must reproduce the above copyright
19 09221bc3 Renato Botelho
	   notice, this list of conditions and the following disclaimer in
20
	   the documentation and/or other materials provided with the
21
	   distribution.
22
23
	3. All advertising materials mentioning features or use of this software
24
	   must display the following acknowledgment:
25
	   "This product includes software developed by the pfSense Project
26
	   for use in the pfSense® software distribution. (http://www.pfsense.org/).
27
28
	4. The names "pfSense" and "pfSense Project" must not be used to
29
	   endorse or promote products derived from this software without
30
	   prior written permission. For written permission, please contact
31
	   coreteam@pfsense.org.
32
33
	5. Products derived from this software may not be called "pfSense"
34
	   nor may "pfSense" appear in their names without prior written
35
	   permission of the Electric Sheep Fencing, LLC.
36
37
	6. Redistributions of any form whatsoever must retain the following
38
	   acknowledgment:
39
40
	"This product includes software developed by the pfSense Project
41
	for use in the pfSense software distribution (http://www.pfsense.org/).
42
43
	THIS SOFTWARE IS PROVIDED BY THE pfSense PROJECT ``AS IS'' AND ANY
44
	EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
45
	IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
46
	PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE pfSense PROJECT OR
47
	ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
48
	SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
49
	NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
50
	LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
51
	HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
52
	STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
53
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
54
	OF THE POSSIBILITY OF SUCH DAMAGE.
55 65e2c06c Erik
*/
56
57 06f61915 Ermal Lu?i
require_once("globals.inc");
58
59 65e2c06c Erik
/* do not load this file twice. */
60 1e0b1727 Phil Davis
if ($config_parsed == true) {
61 65e2c06c Erik
	return;
62 1e0b1727 Phil Davis
} else {
63 1883455a Ermal
	$config_parsed = true;
64 1e0b1727 Phil Davis
}
65 65e2c06c Erik
66
/* include globals from notices.inc /utility/XML parser files */
67
require_once('config.lib.inc');
68
require_once("notices.inc");
69
require_once("util.inc");
70 9b1ff028 Seth Mos
require_once("IPv6.inc");
71 1e0b1727 Phil Davis
if (file_exists("/cf/conf/use_xmlreader")) {
72 093bcebc Scott Ullrich
	require_once("xmlreader.inc");
73 1e0b1727 Phil Davis
} else {
74 093bcebc Scott Ullrich
	require_once("xmlparse.inc");
75 1e0b1727 Phil Davis
}
76 65e2c06c Erik
require_once("crypt.inc");
77
78
/* read platform */
79
if (file_exists("{$g['etc_path']}/platform")) {
80
	$g['platform'] = chop(file_get_contents("{$g['etc_path']}/platform"));
81
} else {
82
	$g['platform'] = "unknown";
83
}
84
85
/* if /debugging exists, lets set $debugging
86
   so we can output more information */
87 1e0b1727 Phil Davis
if (file_exists("/debugging")) {
88 65e2c06c Erik
	$debugging = true;
89
	$g['debug'] = true;
90
}
91
92
$config = parse_config();
93
94 1ad2dc5b Ermal LUÇI
/* set timezone */
95 ecaca752 Renato Botelho
if (isset($config['system']['timezone']) &&
96
    !empty($config['system']['timezone'])) {
97
	$timezone = $config['system']['timezone'];
98
} elseif (isset($g['default_timezone']) && !empty($g['default_timezone'])) {
99
	$timezone = $g['default_timezone'];
100
} else {
101 1e0b1727 Phil Davis
	$timezone = "Etc/UTC";
102
}
103 1ad2dc5b Ermal LUÇI
date_default_timezone_set("$timezone");
104
105 1e0b1727 Phil Davis
if ($config_parsed == true) {
106 65e2c06c Erik
	/* process packager manager custom rules */
107 1e0b1727 Phil Davis
	if (is_dir("/usr/local/pkg/parse_config")) {
108 65e2c06c Erik
		run_plugins("/usr/local/pkg/parse_config/");
109
	}
110
}
111
112 9b1ff028 Seth Mos
?>