3 * Copyright 2003 Mark O'Sullivan
4 * This file is part of Vanilla.
5 * Vanilla is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
6 * Vanilla is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
7 * You should have received a copy of the GNU General Public License along with Vanilla; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
8 * The latest source code for Vanilla is available at www.lussumo.com
9 * Contact Mark O'Sullivan at mark [at] lussumo [dot] com
11 * Description: Global application constants
19 * ATTENTION: !DO NOT CHANGE ANYTHING IN THIS FILE!
27 * If you wish to override any configuration setting, do it in the
28 * conf/settings.php file. This file will be overwritten when you apply upgrades
29 * to Vanilla. The conf/settings.php file will NOT be overwritten.
34 $Configuration = array();
37 $Configuration['DATABASE_SERVER'] = 'MySQL';
38 $Configuration['DATABASE_TABLE_PREFIX'] = 'LUM_';
39 $Configuration['DATABASE_HOST'] = 'localhost';
40 $Configuration['DATABASE_NAME'] = 'your_vanilla_database_name';
41 $Configuration['DATABASE_USER'] = 'your_vanilla_database_user_name';
42 $Configuration['DATABASE_PASSWORD'] = 'your_vanilla_database_password';
43 $Configuration['FARM_DATABASE_HOST'] = '';
44 $Configuration['FARM_DATABASE_NAME'] = 'your_farm_database_name';
45 $Configuration['FARM_DATABASE_USER'] = 'your_farm_database_user_name';
46 $Configuration['FARM_DATABASE_PASSWORD'] = 'your_farm_database_password';
47 $Configuration['DATABASE_CHARACTER_ENCODING'] = '';
48 $Configuration['DATABASE_VERSION'] = '1';
51 $Configuration['APPLICATION_PATH'] = '/path/to/vanilla/';
52 $Configuration['DATABASE_PATH'] = '/path/to/your/database/file.php';
53 $Configuration['LIBRARY_PATH'] = '/path/to/your/library/';
54 $Configuration['EXTENSIONS_PATH'] = '/path/to/your/extensions/';
55 $Configuration['LANGUAGES_PATH'] = '/path/to/your/languages/';
56 $Configuration['THEME_PATH'] = '/path/to/vanilla/themes/vanilla/';
57 $Configuration['BASE_URL'] = 'http://your.base.url/to/vanilla/';
58 $Configuration['DEFAULT_STYLE'] = '/vanilla/themes/vanilla/styles/default/';
59 $Configuration['WEB_ROOT'] = '/vanilla/';
60 $Configuration['SIGNIN_URL'] = 'people.php';
61 $Configuration['REGISTRATION_URL'] = 'people.php?PostBackAction=ApplyForm';
62 $Configuration['SIGNOUT_URL'] = 'people.php?PostBackAction=SignOutNow';
65 $Configuration['AUTHENTICATION_MODULE'] = 'People/People.Class.Authenticator.php';
66 $Configuration['AUTHENTICATION_CLASS'] = 'Authenticator';
67 $Configuration['SESSION_NAME'] = '';
68 $Configuration['COOKIE_USER_KEY'] = 'lussumocookieone';
69 $Configuration['COOKIE_VERIFICATION_KEY'] = 'lussumocookietwo';
70 $Configuration['ENCRYPT_COOKIE_USER_KEY'] = '0';
71 $Configuration['SESSION_USER_IDENTIFIER'] = 'LussumoUserID';
72 $Configuration['COOKIE_DOMAIN'] = '.domain.com';
73 $Configuration['COOKIE_PATH'] = '/';
74 $Configuration['HTTP_ONLY_COOKIE'] = '0';
75 $Configuration['SUPPORT_EMAIL'] = 'support@domain.com';
76 $Configuration['SUPPORT_NAME'] = 'Support';
77 $Configuration['LOG_ALL_IPS'] = '0';
78 $Configuration['FORWARD_VALIDATED_USER_URL'] = './';
79 $Configuration['ALLOW_IMMEDIATE_ACCESS'] = '0';
80 $Configuration['DEFAULT_ROLE'] = '0';
81 $Configuration['APPROVAL_ROLE'] = '3';
82 $Configuration['SAFE_REDIRECT'] = 'people.php?PageAction=SignOutNow';
83 $Configuration['PEOPLE_USE_EXTENSIONS'] = '1';
84 $Configuration['DEFAULT_EMAIL_VISIBLE'] = '0';
85 $Configuration['PASSWORD_HASH_ITERATION'] = '8';
86 $Configuration['PASSWORD_HASH_PORTABLE'] = '1';
89 $Configuration['SMTP_HOST'] = '';
90 $Configuration['SMTP_USER'] = '';
91 $Configuration['SMTP_PASSWORD'] = '';
92 $Configuration['DEFAULT_EMAIL_MIME_TYPE'] = 'text/plain';
93 $Configuration['LANGUAGE'] = "English";
94 $Configuration['URL_BUILDING_METHOD'] = 'Standard'; // Standard or mod_rewrite
95 $Configuration['CHARSET'] = 'utf-8';
96 $Configuration['PAGE_EVENTS'] = array('Page_Init', 'Page_Render', 'Page_Unload');
97 $Configuration['PAGELIST_NUMERIC_TEXT'] = '0';
98 $Configuration['LIBRARY_NAMESPACE_ARRAY'] = array('Framework', 'People', 'Vanilla');
99 $Configuration['LIBRARY_INCLUDE_PATH'] = '%LIBRARY%';
100 $Configuration['DEFAULT_FORMAT_TYPE'] = 'Text';
101 $Configuration['FORMAT_TYPES'] = array('Text');
102 $Configuration['APPLICATION_TITLE'] = 'Vanilla';
103 $Configuration['BANNER_TITLE'] = 'Vanilla';
104 $Configuration['UPDATE_REMINDER'] = 'Monthly';
105 $Configuration['LAST_UPDATE'] = '';
106 $Configuration['HTTP_METHOD'] = 'http'; // Could alternately be https
109 $Configuration['ENABLE_WHISPERS'] = '1';
110 $Configuration['DISCUSSIONS_PER_PAGE'] = '30';
111 $Configuration['COMMENTS_PER_PAGE'] = '50';
112 $Configuration['SEARCH_RESULTS_PER_PAGE'] = '30';
113 $Configuration['ALLOW_NAME_CHANGE'] = '1';
114 $Configuration['ALLOW_EMAIL_CHANGE'] = '1';
115 $Configuration['ALLOW_PASSWORD_CHANGE'] = '1';
116 $Configuration['USE_REAL_NAMES'] = '1';
117 $Configuration['PUBLIC_BROWSING'] = '1';
118 $Configuration['USE_CATEGORIES'] = '1';
119 $Configuration['MAX_COMMENT_LENGTH'] = '5000';
120 $Configuration['MAX_TOPIC_WORD_LENGTH'] = '45';
121 $Configuration['DISCUSSION_POST_THRESHOLD'] = '3';
122 $Configuration['DISCUSSION_TIME_THRESHOLD'] = '60';
123 $Configuration['DISCUSSION_THRESHOLD_PUNISHMENT'] = '120';
124 $Configuration['COMMENT_POST_THRESHOLD'] = '5';
125 $Configuration['COMMENT_TIME_THRESHOLD'] = '60';
126 $Configuration['COMMENT_THRESHOLD_PUNISHMENT'] = '120';
127 $Configuration['UPDATE_URL'] = 'http://lussumo.com/updatecheck/default.php';
129 // Vanilla Control Positions
130 $Configuration['CONTROL_POSITION_HEAD'] = '100';
131 $Configuration['CONTROL_POSITION_MENU'] = '200';
132 $Configuration['CONTROL_POSITION_BANNER'] = '200';
133 $Configuration['CONTROL_POSITION_PANEL'] = '300';
134 $Configuration['CONTROL_POSITION_NOTICES'] = '400';
135 $Configuration['CONTROL_POSITION_BODY_ITEM'] = '500';
136 $Configuration['CONTROL_POSITION_FOOT'] = '600';
137 $Configuration['CONTROL_POSITION_PAGE_END'] = '700';
139 // Vanilla Tab Positions
140 $Configuration['TAB_POSITION_DISCUSSIONS'] = '10';
141 $Configuration['TAB_POSITION_CATEGORIES'] = '20';
142 $Configuration['TAB_POSITION_SEARCH'] = '30';
143 $Configuration['TAB_POSITION_SETTINGS'] = '40';
144 $Configuration['TAB_POSITION_ACCOUNT'] = '50';
146 // Url Rewriting Definitions
147 $Configuration['REWRITE_categories.php'] = 'categories/';
148 $Configuration['REWRITE_index.php'] = 'discussions/';
149 $Configuration['REWRITE_comments.php'] = 'discussion/';
150 $Configuration['REWRITE_search.php'] = 'search/';
151 $Configuration['REWRITE_account.php'] = 'account/';
152 $Configuration['REWRITE_settings.php'] = 'settings/';
153 $Configuration['REWRITE_post.php'] = 'post/';
154 $Configuration['REWRITE_people.php'] = 'people/';
155 $Configuration['REWRITE_extension.php'] = 'extension/';
157 // Default values for role permissions
158 // Standard Permissions
159 $Configuration['PERMISSION_SIGN_IN'] = '0';
160 $Configuration['PERMISSION_ADD_COMMENTS'] = '0';
161 $Configuration['PERMISSION_START_DISCUSSION'] = '0';
162 $Configuration['PERMISSION_HTML_ALLOWED'] = '0';
163 // Discussion Moderator Permissions
164 $Configuration['PERMISSION_SINK_DISCUSSIONS'] = '0';
165 $Configuration['PERMISSION_STICK_DISCUSSIONS'] = '0';
166 $Configuration['PERMISSION_HIDE_DISCUSSIONS'] = '0';
167 $Configuration['PERMISSION_CLOSE_DISCUSSIONS'] = '0';
168 $Configuration['PERMISSION_EDIT_DISCUSSIONS'] = '0';
169 $Configuration['PERMISSION_VIEW_HIDDEN_DISCUSSIONS'] = '0';
170 $Configuration['PERMISSION_MOVE_ANY_DISCUSSIONS'] = '0';
171 $Configuration['PERMISSION_EDIT_COMMENTS'] = '0';
172 $Configuration['PERMISSION_HIDE_COMMENTS'] = '0';
173 $Configuration['PERMISSION_VIEW_HIDDEN_COMMENTS'] = '0';
174 $Configuration['PERMISSION_ADD_COMMENTS_TO_CLOSED_DISCUSSION'] = '0';
175 $Configuration['PERMISSION_ADD_CATEGORIES'] = '0';
176 $Configuration['PERMISSION_EDIT_CATEGORIES'] = '0';
177 $Configuration['PERMISSION_REMOVE_CATEGORIES'] = '0';
178 $Configuration['PERMISSION_SORT_CATEGORIES'] = '0';
179 $Configuration['PERMISSION_VIEW_ALL_WHISPERS'] = '0';
180 // User Moderator Permissions
181 $Configuration['PERMISSION_APPROVE_APPLICANTS'] = '0';
182 $Configuration['PERMISSION_RECEIVE_APPLICATION_NOTIFICATION'] = '0';
183 $Configuration['PERMISSION_CHANGE_USER_ROLE'] = '0';
184 $Configuration['PERMISSION_EDIT_USERS'] = '0';
185 $Configuration['PERMISSION_IP_ADDRESSES_VISIBLE'] = '0';
186 $Configuration['PERMISSION_MANAGE_REGISTRATION'] = '0';
187 $Configuration['PERMISSION_SORT_ROLES'] = '0';
188 $Configuration['PERMISSION_ADD_ROLES'] = '0';
189 $Configuration['PERMISSION_EDIT_ROLES'] = '0';
190 $Configuration['PERMISSION_REMOVE_ROLES'] = '0';
191 // Administrative Permissions
192 $Configuration['PERMISSION_CHECK_FOR_UPDATES'] = '0';
193 $Configuration['PERMISSION_CHANGE_APPLICATION_SETTINGS'] = '0';
194 $Configuration['PERMISSION_MANAGE_EXTENSIONS'] = '0';
195 $Configuration['PERMISSION_MANAGE_LANGUAGE'] = '0';
196 $Configuration['PERMISSION_MANAGE_THEMES'] = '0';
197 $Configuration['PERMISSION_MANAGE_STYLES'] = '0';
198 $Configuration['PERMISSION_ALLOW_DEBUG_INFO'] = '0';
200 // Default values for User Preferences
201 $Configuration['PREFERENCE_HtmlOn'] = '1';
202 $Configuration['PREFERENCE_ShowAppendices'] = '1';
203 $Configuration['PREFERENCE_ShowSavedSearches'] = '1';
204 $Configuration['PREFERENCE_ShowTextToggle'] = '1';
205 $Configuration['PREFERENCE_JumpToLastReadComment'] = '1';
206 $Configuration['PREFERENCE_ShowLargeCommentBox'] = '0';
207 $Configuration['PREFERENCE_ShowFormatSelector'] = '1';
208 $Configuration['PREFERENCE_ShowDeletedDiscussions'] = '0';
209 $Configuration['PREFERENCE_ShowDeletedComments'] = '0';
212 // Has Vanilla been installed (this will be set to true in conf/settings.php when setup completes)
213 $Configuration['SETUP_COMPLETE'] = '0';
214 $Configuration['ADDON_NOTICE'] = '1';
216 // Application versions
217 include(dirname(__FILE__
) . '/version.php');
219 // Application Mode Constants
220 define('MODE_DEBUG', 'DEBUG');
221 define('MODE_RELEASE', 'RELEASE');
223 // Format type definitions
224 define('FORMAT_STRING_FOR_DISPLAY', 'DISPLAY');
225 define('FORMAT_STRING_FOR_DATABASE', 'DATABASE');
228 define('MAGIC_QUOTES_ON', get_magic_quotes_gpc());
230 // Self Url (should be hard-coded by each page - this is here just in case it was forgotten)
231 $Configuration['SELF_URL'] = @$_SERVER['PHP_SELF'];
233 // Include custom settings
234 include(dirname(__FILE__
) . '/../conf/settings.php');
235 if ($Configuration['SETUP_COMPLETE'] == '0') {
236 header('Location: ./setup/index.php');
239 // Define a constant to prevent a register_globals attack on the configuration paths
240 define('IN_VANILLA', '1');
243 if ($Configuration['DATABASE_VERSION'] < 2) {
244 include_once($Configuration['APPLICATION_PATH'].'appg/database.php');
245 include_once($Configuration['DATABASE_PATH']);
246 include_once($Configuration['LIBRARY_PATH'].'Framework/Framework.Functions.php');
247 include_once($Configuration['LIBRARY_PATH'].'Framework/Framework.Class.Database.php');
248 include_once($Configuration['LIBRARY_PATH'].'Framework/Framework.Class.'.$Configuration['DATABASE_SERVER'].'.php');
249 include_once($Configuration['LIBRARY_PATH'].'Framework/Framework.Class.SqlBuilder.php');
250 include_once($Configuration['LIBRARY_PATH'].'Framework/Framework.Class.MessageCollector.php');
251 include_once($Configuration['LIBRARY_PATH'].'Framework/Framework.Class.ErrorManager.php');
252 include_once($Configuration['LIBRARY_PATH'].'Framework/Framework.Class.ObjectFactory.php');
253 include_once($Configuration['LIBRARY_PATH'].'Framework/Framework.Class.StringManipulator.php');
254 include_once($Configuration['LIBRARY_PATH'].'Framework/Framework.Class.Context.php');
255 include_once($Configuration['LIBRARY_PATH'].'Framework/Framework.Class.Delegation.php');
256 include_once($Configuration['LIBRARY_PATH'].'Vanilla/Vanilla.Functions.php');
257 include_once($Configuration['LIBRARY_PATH'].$Configuration['AUTHENTICATION_MODULE']);
258 include_once($Configuration['LIBRARY_PATH'].'People/People.Class.Session.php');
259 include_once($Configuration['LIBRARY_PATH'].'People/People.Class.PasswordHash.php');
260 include_once($Configuration['LIBRARY_PATH'].'People/People.Class.User.php');
262 $Context = new Context($Configuration);
263 $Context->DatabaseTables
= &$DatabaseTables;
264 $Context->DatabaseColumns
= &$DatabaseColumns;
266 $Query = 'ALTER TABLE '
267 . GetTableName('User', $DatabaseTables, $Configuration["DATABASE_TABLE_PREFIX"])
268 . ' CHANGE ' . $DatabaseColumns['User']['Password'].' '
269 . $DatabaseColumns['User']['Password'] . ' VARBINARY( 34 ) NULL DEFAULT NULL';
270 if ($Context->Database
->Execute($Query,'','','',0)) {
271 AddConfigurationSetting($Context, 'DATABASE_VERSION', '2');
273 unset($Context, $Query);