Project

General

Profile

Download (3.83 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 Rubicon Communications, LLC (Netgate)
7
 * All rights reserved.
8
 *
9
 * originally part of m0n0wall (http://m0n0.ch/wall)
10
 * Copyright (c) 2003-2004 Manuel Kasper <mk@neon1.net>.
11
 * All rights reserved.
12
 *
13
 * Redistribution and use in source and binary forms, with or without
14
 * modification, are permitted provided that the following conditions are met:
15
 *
16
 * 1. Redistributions of source code must retain the above copyright notice,
17
 *    this list of conditions and the following disclaimer.
18
 *
19
 * 2. Redistributions in binary form must reproduce the above copyright
20
 *    notice, this list of conditions and the following disclaimer in
21
 *    the documentation and/or other materials provided with the
22
 *    distribution.
23
 *
24
 * 3. All advertising materials mentioning features or use of this software
25
 *    must display the following acknowledgment:
26
 *    "This product includes software developed by the pfSense Project
27
 *    for use in the pfSense® software distribution. (http://www.pfsense.org/).
28
 *
29
 * 4. The names "pfSense" and "pfSense Project" must not be used to
30
 *    endorse or promote products derived from this software without
31
 *    prior written permission. For written permission, please contact
32
 *    coreteam@pfsense.org.
33
 *
34
 * 5. Products derived from this software may not be called "pfSense"
35
 *    nor may "pfSense" appear in their names without prior written
36
 *    permission of the Electric Sheep Fencing, LLC.
37
 *
38
 * 6. Redistributions of any form whatsoever must retain the following
39
 *    acknowledgment:
40
 *
41
 * "This product includes software developed by the pfSense Project
42
 * for use in the pfSense software distribution (http://www.pfsense.org/).
43
 *
44
 * THIS SOFTWARE IS PROVIDED BY THE pfSense PROJECT ``AS IS'' AND ANY
45
 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
46
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
47
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE pfSense PROJECT OR
48
 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
49
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
50
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
51
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
52
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
53
 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
54
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
55
 * OF THE POSSIBILITY OF SUCH DAMAGE.
56
 */
57

    
58
require_once("globals.inc");
59

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

    
67
/* include globals from notices.inc /utility/XML parser files */
68
require_once('config.lib.inc');
69
require_once("notices.inc");
70
require_once("util.inc");
71
require_once("IPv6.inc");
72
if (file_exists("/cf/conf/use_xmlreader")) {
73
	require_once("xmlreader.inc");
74
} else {
75
	require_once("xmlparse.inc");
76
}
77
require_once("crypt.inc");
78

    
79
/* read platform */
80
if (file_exists("{$g['etc_path']}/platform")) {
81
	$g['platform'] = chop(file_get_contents("{$g['etc_path']}/platform"));
82
} else {
83
	$g['platform'] = "unknown";
84
}
85

    
86
/* if /debugging exists, lets set $debugging
87
   so we can output more information */
88
if (file_exists("/debugging")) {
89
	$debugging = true;
90
	$g['debug'] = true;
91
}
92

    
93
$config = parse_config();
94

    
95
/* set timezone */
96
if (isset($config['system']['timezone']) &&
97
    !empty($config['system']['timezone'])) {
98
	$timezone = $config['system']['timezone'];
99
} elseif (isset($g['default_timezone']) && !empty($g['default_timezone'])) {
100
	$timezone = $g['default_timezone'];
101
} else {
102
	$timezone = "Etc/UTC";
103
}
104
date_default_timezone_set("$timezone");
105

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

    
113
?>
(12-12/67)