-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathconfig.inc.php
231 lines (205 loc) · 5.77 KB
/
config.inc.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
<?php
// Start session for login and redirects
session_start();
//*******************
if (!is_dir("logs"))
{
mkdir("logs", 0755);
}
if (!is_dir("rss"))
{
mkdir("rss", 0755);
}
if (!is_dir("map"))
{
mkdir("map", 0755);
}
/*
$counter++;
if ($counter > 1)
{
throw new Exception('config file included more than once!!!');
}
*/
//******************************************/
// DOMAIN SPECIFIC SETTINGS
//******************************************/
#define("TEST_LIVE", TRUE); //test the live site
// Look above document root then in current directory for priv.php
if ($privfile = realpath($_SERVER["DOCUMENT_ROOT"] . "/../priv.php"))
{
include $privfile;
}
elseif ($privfile = realpath($_SERVER["DOCUMENT_ROOT"] . "/priv.php"))
{
include $privfile;
}
// else use the default priv directory
else
{
define("PRIV", "priv");
}
require_once PRIV."/config.domain.php";
require_once PRIV."/dbdata.php";
require_once PRIV."/social.php";
require_once 'lib/phpass-0.3/PasswordHash.php';
require_once "sys.php";
require_once 'process_input.php';
require_once 'graphs.php';
require_once 'vga_functions.php';
include_once 'lib/php_lib.php';
//require_once 'lib/htmlpurifier-4.0.0-live/HTMLPurifier.standalone.php';
require_once "lib/feedcreator-1.7.2-ppt/include/feedcreator.class.php";
//require_once "vga_bubble_functions.php";
// Set error logs if log directory is defined (in config.domain.php)
if (defined('LOG_DIRECTORY'))
{
ini_set('log_errors', 'On');
ini_set('error_log', LOG_DIRECTORY.'vga_runtime_errors.log');
define("ERROR_FILE", LOG_DIRECTORY."vga_error.log");
define("LOG_FILE", LOG_DIRECTORY."vga.log");
define("BAD_INPUT_LOG", LOG_DIRECTORY."bad_input.log");
}
define("SVG_DIR", "svg-1.4.4");
define("MAX_LEN_EMAIL", 60);
define("MAX_LEN_USERNAME", 50);
define("MAX_LEN_PASSWORD", 60);
define("MIN_LEN_PASSWORD", 6);
define("MAX_LEN_ROOM", 20);
define("MIN_LEN_ROOM", 2);
define("MAX_LEN_PROPOSAL_ABSTRACT", 1000);
define("MAX_LEN_PROPOSAL_BLURB", 1000);
define("LANG_FILES_DIRECTORY", 'generatedlangfiles');
define("NOT_VOTED", 0);
define("AGREE", 1);
define("DISAGREE", 2);
define("NOT_UNDERSTAND", 3);
define('USE_CAPTCHA', false);
define("SNAPSHOTS_PATH", "snapshots/");
if (!is_dir(SNAPSHOTS_PATH))
{
if (!mkdir(SNAPSHOTS_PATH, 0755, true))
{
log_error("Failed to create snapshots directory path");
}
}
// Admin display settings
$display_interactive_graphs = True;
$display_key_players = True;
$display_confused_voting_option = True;
$anonymize_graph = True;
$default_voting_options = array (
'display_interactive_graphs' => 1,
'display_key_players' => 1,
'display_confused_voting_option' => 1,
'use_voting_comments' => 'No',
'anonymize_graph' => 1,
'personalize_graph' => 1,
'proposal_node_layout' => 'Layers',
'user_node_layout' => 'Layers',
'pareto_proposal_node_layout' => 'Layers',
'pareto_user_node_layout' => 'Layers',
'display_all_previous_comments' => 0
);
$voting_settings = array_merge($default_voting_options, fetch_voting_settings());
//set_log("Counter = $counter");
// ******************************************
// Connects to the Database
mysql_connect($dbaddress, $dbusername, $dbpassword) or die(mysql_error());
mysql_set_charset('utf8');
mysql_select_db($dbname) or die(mysql_error());
//******************************************
//
// FACEBOOK CONNECT
//******************************************
require_once 'config.facebook.php';
require_once 'lib/facebook_v3/src/facebook.php';
// V3
$fb = new Facebook(array(
'appId' => $facebook_key,
'secret' => $facebook_secret,
'cookie' => true
));
/*
If $FACEBOOK_ID != NULL then current user is Facebook Authroized
*/
$FACEBOOK_ID = null;
$FACEBOOK_USER_PROFILE = null;
if (USE_FACEBOOK_CONNECT)
{
// Get User ID
$FACEBOOK_ID = $fb->getUser();
// Get user profile - if session valid
if ($FACEBOOK_ID)
{
try
{
$FACEBOOK_USER_PROFILE = $fb->api('/'.$FACEBOOK_ID);
}
catch (FacebookApiException $e)
{
//set_log("FB Profile locale not set");
set_log("Error fetching user profile: ".$e);
$FACEBOOK_ID = null;
}
}
else
{
//set_log('$FACEBOOK_ID not set');
}
}
//******************************************/
define("COOKIE_USER", "ID_my_site");
define("COOKIE_PASSWORD", "Key_my_site");
define("VGA_PL", "vgapl");
//
define("SHOW_QICON_ROOMS", TRUE);
//
// Query string parameters
define("QUERY_KEY_TODO", "todo");
define("QUERY_KEY_USER", "u");
define("QUERY_KEY_QUESTION", "q");
define("QUERY_KEY_ROOM", "room");
define("QUERY_KEY_PROPOSAL", "p");
define("QUERY_KEY_GENERATION", "g");
define("QUERY_KEY_QUESTION_BUBBLE", "qb");
define("COOKIE_KEY_QUESTION_BUBBLE", "qb");
define("RANDOM_ROOM_CODE_LENGTH", 16);
//
define("USER_LOGIN_ID", 'vilfredo_user_id');
define("USER_LOGIN_MODE", 'vilfredo_login_mode');
//
if (!defined('PWD_RESET_LIFETIME'))
{
define('PWD_RESET_LIFETIME', 3600*24*2);
}
if (!defined('CHECK_EMAIL_LIFETIME'))
{
define('CHECK_EMAIL_LIFETIME', 3600*24*2);
}
if (!defined('COOKIE_LIFETIME'))
{
define('COOKIE_LIFETIME', 3600*24*2);
}
//
// Get rid off this
#define("USE_PRIVACY_FILTER", TRUE);
//******************************************/
// TEMP WIN/PHP FIX
// Use a dummy function to return true if no checkdnsrr()
// -- This function not available on Windows platforms
// before PHP version 5.3.0. For live windows platforms without
// checkdnsrr() another function could be substituted.
//
// Eg. From PHP Manual: http://php.net/manual/en/function.checkdnsrr.php
// For compatibility with Windows before this was implemented,
// then try the » PEAR class » Net_DNS.
//
//******************************************/
/*
function checkdnsrr($host, $type)
{
return true;
}
*/
?>