Project

General

Profile

Download (3.71 KB) Statistics
| Branch: | Tag: | Revision:
1
<?php
2
/*
3
	config.gui.inc
4

    
5
	part of pfSense (https://www.pfsense.org)
6
	Copyright (c) 2004-2016 Electric Sheep Fencing, LLC. All rights reserved.
7

    
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
	   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
*/
56

    
57
require_once("globals.inc");
58

    
59
/* do not load this file twice. */
60
if ($config_parsed == true) {
61
	return;
62
} else {
63
	$config_parsed = true;
64
}
65

    
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
require_once("IPv6.inc");
71
if (file_exists("/cf/conf/use_xmlreader")) {
72
	require_once("xmlreader.inc");
73
} else {
74
	require_once("xmlparse.inc");
75
}
76
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
if (file_exists("/debugging")) {
88
	$debugging = true;
89
	$g['debug'] = true;
90
}
91

    
92
$config = parse_config();
93

    
94
/* set timezone */
95
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
	$timezone = "Etc/UTC";
102
}
103
date_default_timezone_set("$timezone");
104

    
105
if ($config_parsed == true) {
106
	/* process packager manager custom rules */
107
	if (is_dir("/usr/local/pkg/parse_config")) {
108
		run_plugins("/usr/local/pkg/parse_config/");
109
	}
110
}
111

    
112
?>
(10-10/65)