]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - g
More variables
[SourceForge/phpwiki.git] / g
1 <?php
2
3 /*
4  * Copyright (C) 2008-2009 Alcatel-Lucent
5  *
6  * This file is part of PhpWiki.
7  *
8  * PhpWiki is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * PhpWiki is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with PhpWiki; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21 */
22
23 /*
24  * Standard Alcatel-Lucent disclaimer for contributing to open source
25  *
26  * "The Configuration File ("Contribution") has not been tested and/or
27  * validated for release as or in products, combinations with products or
28  * other commercial use. Any use of the Contribution is entirely made at
29  * the user's own responsibility and the user can not rely on any features,
30  * functionalities or performances Alcatel-Lucent has attributed to the
31  * Contribution.
32  *
33  * THE CONTRIBUTION BY ALCATEL-LUCENT IS PROVIDED AS IS, WITHOUT WARRANTY
34  * OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
35  * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, COMPLIANCE,
36  * NON-INTERFERENCE AND/OR INTERWORKING WITH THE SOFTWARE TO WHICH THE
37  * CONTRIBUTION HAS BEEN MADE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL
38  * ALCATEL-LUCENT BE LIABLE FOR ANY DAMAGES OR OTHER LIABLITY, WHETHER IN
39  * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
40  * CONTRIBUTION OR THE USE OR OTHER DEALINGS IN THE CONTRIBUTION, WHETHER
41  * TOGETHER WITH THE SOFTWARE TO WHICH THE CONTRIBUTION RELATES OR ON A STAND
42  * ALONE BASIS."
43  */
44
45 ini_set("memory_limit", "64M");
46
47 // Disable compression, seems needed to get all the messages.
48 $no_gz_buffer=true;
49
50 require_once('pre.php');
51
52 if (!$group_id || !$project) {
53     exit_error("Invalid Project","Invalid Project");
54 } else {
55
56     $group_name = $project->getUnixName();
57     $group_public_name = $project->getPublicName();
58
59     define('VIRTUAL_PATH', '/wiki/g/'.$group_name);
60     define('PAGE_PREFIX', '_g'.$group_id.'_');
61
62     define('THEME', 'gforge');
63
64     // For Gforge, we create some specific pages, located in the theme
65     // except for project "cssforge"
66     if ($group_name == "cssforge") {
67         define('WIKI_PGSRC', 'pgsrc/');
68     } else {
69         define('WIKI_PGSRC', 'themes/gforge/pgsrc/');
70     }
71
72     define('GFORGE', true);
73
74     define('PATH_INFO_PREFIX', '/'.$group_name . '/');
75     define('USE_PATH_INFO', true);
76
77     define('WIKI_NAME', $group_name);
78
79     define('UPLOAD_FILE_PATH', '/opt/groups/'.WIKI_NAME.'/www/uploads/');
80     // define('UPLOAD_DATA_PATH', SERVER_URL . '/www/'.WIKI_NAME.'/uploads/');
81     // define('UPLOAD_DATA_PATH', SERVER_URL . '/www/'.WIKI_NAME.'/uploads/');
82     define('UPLOAD_DATA_PATH', '/www/'.WIKI_NAME.'/uploads/');
83
84     // Do not use a directory per user but only one (per project)
85     define('UPLOAD_USERDIR', false);
86
87     // GForge is UTF-8, so use the same.
88     define('CHARSET', 'UTF-8');
89
90     // Disable access log (already in apache & gforge).
91     define('ACCESS_LOG_SQL', 0);
92
93     define('DEBUG', false);
94     // define('_DEBUG_LOGIN', true);
95
96     // Disable VACUUM (they are performed every night)
97     define('DATABASE_OPTIMISE_FREQUENCY', 0);
98
99     // It is not used by it is required by libs.
100     define('ADMIN_USER', 'Project Administrators');
101     define('ADMIN_PASSWD', 'xxx');
102
103     // Allow ".jpeg" as extension
104     define('INLINE_IMAGES', 'png|jpg|jpeg|gif');
105
106     // Allow template with MediaWiki syntax
107     define('ENABLE_MARKUP_TEMPLATE', true);
108
109     // Allow tables with MediaWiki syntax
110     define('ENABLE_MARKUP_MEDIAWIKI_TABLE', true);
111
112     // Allow parsing of headers for CreateToc
113     define('TOC_FULL_SYNTAX', true);
114
115     // Allow <div> and <span> in wiki code
116     define('ENABLE_MARKUP_DIVSPAN', true);
117
118     // Disable ENABLE_ACDROPDOWN, it creates a <style> in the <body> (illegal)
119     define('ENABLE_ACDROPDOWN', false);
120
121     define('TOOLBAR_PAGELINK_PULLDOWN', false);
122     define('TOOLBAR_TEMPLATE_PULLDOWN', false);
123     define('TOOLBAR_IMAGE_PULLDOWN', true);
124
125     // Disable WYSIWYG
126     define('ENABLE_WYSIWYG', false);
127
128     // Which backend? Might need to be seperately installed. See lib/WysiwygEdit/
129     // Recommended is only Wikiwyg.
130     //
131     //  Wikiwyg     http://openjsan.org/doc/i/in/ingy/Wikiwyg/
132     //  tinymce     http://tinymce.moxiecode.com/
133     //  FCKeditor   http://fckeditor.net/
134     //  spaw        http://sourceforge.net/projects/spaw
135     //  htmlarea3
136     //  htmlarea2
137     define('WYSIWYG_BACKEND', 'tinymce');
138     //
139     // Store all WYSIWYG pages as HTML? Will loose most link and plugin options.
140     // Not recommended, but presented here to test several WYSIWYG backends.
141     define('WYSIWYG_DEFAULT_PAGETYPE_HTML', false);
142
143     // Disable public pages
144     define('ENABLE_PAGE_PUBLIC', false);
145
146     // Let all revisions be stored. Default since 1.3.11
147     define('MAJOR_MIN_KEEP', 2147483647);
148     define('MINOR_MIN_KEEP', 2147483647);
149     define('MAJOR_MAX_AGE', 2147483647);
150     define('MAJOR_KEEP', 2147483647);
151     define('MINOR_MAX_AGE', 2147483647);
152     define('MINOR_KEEP', 2147483647);
153     define('AUTHOR_MAX_AGE', 2147483647);
154     define('AUTHOR_KEEP', 2147483647);
155     define('AUTHOR_MIN_AGE', 2147483647);
156     define('AUTHOR_MAX_KEEP', 2147483647);
157
158     //
159     // Define access rights for the wiki.
160     //
161
162     // Allow anonymous user to view the pages.
163     define('ALLOW_ANON_USER', true);
164
165     // Do not allow anon users to edit pages
166     define('ALLOW_ANON_EDIT', false);
167
168     // Do not allow fake user
169     define('ALLOW_BOGO_LOGIN', false);
170     define('ALLOW_USER_PASSWORDS', true);
171
172     // A dedicated auth has been created to get auth from GForge
173     $USER_AUTH_ORDER = array("GForge");
174     define('USER_AUTH_ORDER', 'GForge');
175     define('USER_AUTH_POLICY', 'strict');
176
177     define('EXTERNAL_LINK_TARGET', '_top');
178
179     // Override the default configuration for CONSTANTS before index.php
180     $LANG='en'; $LC_ALL='en_US';
181
182     // We use a local interwiki map file
183     define('INTERWIKI_MAP_FILE', 'themes/gforge/interwiki.map');
184
185     define('DEFAULT_WIKI_PAGES', "");
186
187     define('ERROR_REPORTING', E_ERROR);
188
189     define('DBAUTH_AUTH_CHECK', "SELECT IF(passwd='\$password',1,0) as ok FROM plugin_wiki_pref WHERE userid='\$userid'");
190     define('DBAUTH_AUTH_USER_EXISTS', "SELECT userid FROM plugin_wiki_pref WHERE userid='\$userid'");
191     define('DBAUTH_AUTH_CREATE', "INSERT INTO plugin_wiki_pref (passwd,userid) VALUES ('\$password','\$userid')");
192     define('DBAUTH_PREF_SELECT', "SELECT prefs FROM plugin_wiki_pref WHERE userid='\$userid'");
193     define('DBAUTH_PREF_UPDATE', "UPDATE plugin_wiki_pref SET prefs='\$pref_blob' WHERE userid='\$userid'");
194     define('DBAUTH_PREF_INSERT', "INSERT INTO plugin_wiki_pref (prefs,userid) VALUES ('\$pref_blob','\$userid')");
195     define('DBAUTH_IS_MEMBER', "SELECT userid FROM plugin_wiki_pref WHERE userid='\$userid' AND groupname='\$groupname'");
196     define('DBAUTH_GROUP_MEMBERS', "SELECT userid FROM plugin_wiki_pref WHERE groupname='\$groupname'");
197     define('DBAUTH_USER_GROUPS', "SELECT groupname FROM plugin_wiki_pref WHERE userid='\$userid'");
198
199     define('USE_DB_SESSION', true);
200
201     define('USE_BYTEA', true);
202
203     define('ENABLE_SPAMBLOCKLIST', false);
204     
205     define('ENCRYPTED_PASSWD', true);
206
207     define('ENABLE_REVERSE_DNS', true);
208
209     define('ZIPDUMP_AUTH', false);
210
211     define('ENABLE_RAW_HTML', true);
212
213     define('ENABLE_RAW_HTML_LOCKEDONLY', true);
214
215     define('ENABLE_RAW_HTML_SAFE', true);
216
217     define('STRICT_MAILABLE_PAGEDUMPS', false);
218
219     define('DEFAULT_DUMP_DIR', "/tmp/wikidump");
220     define('HTML_DUMP_DIR', "/tmp/wikidumphtml");
221     define('HTML_DUMP_SUFFIX', ".html");
222
223     define('MAX_UPLOAD_SIZE', 16777216);
224
225     define('MINOR_EDIT_TIMEOUT', 604800);
226
227     define('COMPRESS_OUTPUT', false);
228
229     define('CACHE_CONTROL', "NO_CACHE");
230
231     define('CACHE_CONTROL_MAX_AGE', 600);
232
233     define('COOKIE_EXPIRATION_DAYS', 365);
234
235     define('GROUP_METHOD', "WIKIPAGE");
236
237     define('DBAUTH_AUTH_CRYPT_METHOD', "plain");
238
239     define('DEFAULT_LANGUAGE', "en");
240
241     define('DISABLE_GETIMAGESIZE', true);
242
243     if (isset($sys_use_selenium) && $sys_use_selenium) {
244         // Temporary disabled for selenium based tests.
245         define('ENABLE_EDIT_TOOLBAR', false);
246     }
247
248     // If the user is logged in, let the Wiki know
249     if (session_loggedin()){
250         // let php do it's session stuff too!
251         //ini_set('session.save_handler', 'files');
252         // session_start();
253         $user = session_get_user();
254
255         if ($user && is_object($user) && !$user->isError() && $user->isActive()) {
256             $user_name = $user->getRealName();
257             $_SESSION['user_id'] = $user_name;
258             $_SERVER['PHP_AUTH_USER'] = $user_name;
259             $HTTP_SERVER_VARS['PHP_AUTH_USER'] = $user_name;
260         }
261     } else {
262         // clear out the globals, just in case...
263     }
264
265     // Load the default configuration.
266     include "index.php";
267
268     // Override the default configuration for VARIABLES after index.php:
269     // E.g. Use another DB:
270     $DBParams['dbtype'] = 'SQL';
271     $DBParams['dsn']    = 'pgsql://' . $sys_dbuser . ':' .
272         $sys_dbpasswd . '@' . $sys_dbhost .'/' . $sys_dbname;
273
274     $DBParams['prefix'] = "plugin_wiki_";
275
276     // Start the wiki
277     include "lib/main.php";
278 }
279 ?>