]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - index.php
Added note that use of the configurator is depreciated.
[SourceForge/phpwiki.git] / index.php
1 <?php // -*-php-*-
2 // iso-8859-1
3
4 // IMPORTANT NOTE: Use of the ***configurator.php*** to generate an
5 // index.php is depreciated, because it is out of date and a new
6 // configuration system is in the works (see the config directory, not
7 // finished yet though). DO compare or diff the configurator's output
8 // against this file if you feel you must use it to generate an
9 // index.php!
10
11 /*
12 Copyright 1999, 2000, 2001, 2002 $ThePhpWikiProgrammingTeam = array(
13 "Steve Wainstead", "Clifford A. Adams", "Lawrence Akka", 
14 "Scott R. Anderson", "Jon Åslund", "Neil Brown", "Jeff Dairiki",
15 "Stéphane Gourichon", "Jan Hidders", "Arno Hollosi", "John Jorgensen",
16 "Antti Kaihola", "Jeremie Kass", "Carsten Klapp", "Marco Milanesi",
17 "Grant Morgan", "Jan Nieuwenhuizen", "Aredridel Niothke", 
18 "Pablo Roca Rozas", "Sandino Araico Sánchez", "Joel Uckelman", 
19 "Reini Urban", "Tim Voght", "Jochen Kalmbach");
20
21 This file is part of PhpWiki.
22
23 PhpWiki is free software; you can redistribute it and/or modify
24 it under the terms of the GNU General Public License as published by
25 the Free Software Foundation; either version 2 of the License, or
26 (at your option) any later version.
27
28 PhpWiki is distributed in the hope that it will be useful,
29 but WITHOUT ANY WARRANTY; without even the implied warranty of
30 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
31 GNU General Public License for more details.
32
33 You should have received a copy of the GNU General Public License
34 along with PhpWiki; if not, write to the Free Software
35 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
36 */
37
38
39 /////////////////////////////////////////////////////////////////////
40 /*
41   This is the starting file for PhpWiki. All this file does is set
42   configuration options, and at the end of the file it includes() the
43   file lib/main.php, where the real action begins.
44
45   This file is divided into seven parts: Parts Zero, One, Two, Three,
46   Four, Five and Six. Each one has different configuration settings you can
47   change; in all cases the default should work on your system,
48   however, we recommend you tailor things to your particular setting.
49 */
50
51 /////////////////////////////////////////////////////////////////////
52 // Part Zero: If PHP needs help in finding where you installed the
53 //   rest of the PhpWiki code, you can set the include_path here.
54
55 // Define PHP's include path so that it can find the PHP source code
56 // for this PhpWiki.
57 // 
58 // You shouldn't need to do this unless you've moved index.php out
59 // of the PhpWiki install directory.
60 //
61 // Note that on Windows-based servers, you should use ; rather than :
62 // as the path separator.
63 //ini_set('include_path', '.:/usr/local/httpd/phpwiki');
64
65 // Set DEBUG to 1 to view the XHTML and CSS validator icons, page
66 // processing timer, and possibly other debugging messages at the
67 // bottom of each page.
68 if (!defined('DEBUG')) define ('DEBUG', 0);
69
70 /////////////////////////////////////////////////////////////////////
71 // Part Null: Don't touch this!
72
73 define ('PHPWIKI_VERSION', '1.3.7pre');
74 require "lib/prepend.php";
75 rcs_id('$Id: index.php,v 1.113 2003-12-05 15:51:37 carstenklapp Exp $');
76
77 /////////////////////////////////////////////////////////////////////
78 //
79 // Part One:
80 // Authentication and security settings. See Part Three for more.
81 // 
82 /////////////////////////////////////////////////////////////////////
83
84 // The name of your wiki.
85 //
86 // This is used to generate a keywords meta tag in the HTML templates,
87 // in bookmark titles for any bookmarks made to pages in your wiki,
88 // and during RSS generation for the <title> of the RSS channel.
89 //
90 // To use your own logo and signature files, name them PhpWikiLogo.png
91 // and PhpWikiSignature.png and put them into themes/default/images
92 // (substituting "PhpWiki" in the filename with the name you define
93 // here).
94 //
95 // It is recommended this be a relatively short WikiWord like the
96 // InterWiki monikers found in the InterWikiMap. (For examples, see
97 // lib/interwiki.map).
98 if (!defined('WIKI_NAME')) define('WIKI_NAME', 'PhpWiki');
99
100 // Visitor Hostname Lookup
101 //
102 // If set, reverse dns lookups will be performed to attempt to convert
103 // the user's IP number into a host name, in the case where the http
104 // server does not do this.
105 if (!defined('ENABLE_REVERSE_DNS')) define('ENABLE_REVERSE_DNS', true);
106
107 // Username and password of administrator.
108 //
109 // Set these to your preferences. For heaven's sake pick a good
110 // password and use the passencrypt.php tool. See:
111 // http://wolfram.org/writing/howto/password.html
112 // 
113 // Log into the wiki with the admin user and password to lock, unlock,
114 // or remove pages and to perform other PhpWikiAdministration
115 // functions. On all other occasions you should simply log in with
116 // your regular WikiName.
117 if (!defined('ADMIN_USER')) define('ADMIN_USER', "");
118 if (!defined('ADMIN_PASSWD')) define('ADMIN_PASSWD', "");
119 // It is recommended to use the passencrypt.php utility to encode the
120 // admin password, in the unlikely event someone gains ftp or ssh
121 // access to the server and directory containing phpwiki. Once you
122 // have pasted the encrypted password into ADMIN_PASSWD, uncomment
123 // this next line.
124 //if (!defined('ENCRYPTED_PASSWD')) define('ENCRYPTED_PASSWD', true);
125
126 // Private ZIP Dumps of All Wiki Pages
127 //
128 // If true, only the admin user can make zip dumps. Otherwise anyone
129 // may download all wiki pages as a single zip archive.
130 if (!defined('ZIPDUMP_AUTH')) define('ZIPDUMP_AUTH', false);
131
132 // Define to false to disable the RawHtml plugin.
133 //if (!defined('ENABLE_RAW_HTML')) define('ENABLE_RAW_HTML', false);
134
135 // If you define this to true, (MIME-type) page-dumps (either zip dumps,
136 // or "dumps to directory" will be encoded using the quoted-printable
137 // encoding.  If you're actually thinking of mailing the raw page dumps,
138 // then this might be useful, since (among other things,) it ensures
139 // that all lines in the message body are under 80 characters in length.
140 //
141 // Also, setting this will cause a few additional mail headers
142 // to be generated, so that the resulting dumps are valid
143 // RFC 2822 e-mail messages.
144 //
145 // Probably you can just leave this set to false, in which case you get
146 // raw ('binary' content-encoding) page dumps.
147 if (!defined('STRICT_MAILABLE_PAGEDUMPS')) define('STRICT_MAILABLE_PAGEDUMPS', false);
148
149 // Here you can change the filename suffix used for XHTML page dumps.
150 // If you don't want any suffix just comment this out.
151 $HTML_DUMP_SUFFIX = '.html';
152
153 // The maximum file upload size.
154 if (!defined('MAX_UPLOAD_SIZE')) define('MAX_UPLOAD_SIZE', 16 * 1024 * 1024);
155
156 // If the last edit is older than MINOR_EDIT_TIMEOUT seconds, the
157 // default state for the "minor edit" checkbox on the edit page form
158 // will be off.
159 if (!defined('MINOR_EDIT_TIMEOUT')) define("MINOR_EDIT_TIMEOUT", 7 * 24 * 3600);
160
161 // Actions listed in this array will not be allowed. The complete list
162 // of actions can be found in lib/main.php within the function
163 // getActionDescription.
164 //$DisabledActions = array('dumpserial', 'loadfile');
165
166 // PhpWiki can generate an access_log (in "NCSA combined log" format)
167 // for you. If you want one, define this to the name of the log
168 // file. The server must have write access to the directory specified.
169 //define('ACCESS_LOG', '/var/tmp/wiki_access_log');
170
171
172 // By default PhpWiki will try to have PHP compress its output
173 // before sending it to the browser (if you have a recent enough
174 // version of PHP and the browser supports it.)
175 // Define COMPRESS_OUTPUT to false to prevent output compression.
176 // Define COMPRESS_OUTPUT to true to force output compression,
177 // even if we think your version of PHP does this in a buggy
178 // fashion.
179 // Leave it undefined to leave the choice up to PhpWiki.
180 //define('COMPRESS_OUTPUT', false);
181
182
183 // HTTP CACHE_CONTROL
184 //
185 // This controls how PhpWiki sets the HTTP cache control
186 // headers (Expires: and Cache-Control:) 
187 //
188 // Choose one of:
189 //
190 // NONE: This is roughly the old (pre 1.3.4) behavior.  PhpWiki will
191 //       instruct proxies and browsers never to cache PhpWiki output.
192 //
193 // STRICT: Cached pages will be invalidated whenever the database global
194 //       timestamp changes.  This should behave just like NONE (modulo
195 //       bugs in PhpWiki and your proxies and browsers), except that
196 //       things will be slightly more efficient.
197 //
198 // LOOSE: Cached pages will be invalidated whenever they are edited,
199 //       or, if the pages include plugins, when the plugin output could
200 //       concievably have changed.
201 //
202 //       Behavior should be much like STRICT, except that sometimes
203 //       wikilinks will show up as undefined (with the question mark)
204 //       when in fact they refer to (recently) created pages.
205 //       (Hitting your browsers reload or perhaps shift-reload button
206 //       should fix the problem.)
207 //
208 // ALLOW_STALE: Proxies and browsers will be allowed to used stale pages.
209 //       (The timeout for stale pages is controlled by CACHE_CONTROL_MAX_AGE.)
210 //
211 //       This setting will result in quirky behavior.  When you edit a
212 //       page your changes may not show up until you shift-reload the
213 //       page, etc...
214 //
215 //       This setting is generally not advisable, however it may be useful
216 //       in certain cases (e.g. if your wiki gets lots of page views,
217 //       and few edits by knowledgable people who won't freak over the quirks.)
218 //
219 // The default is currently LOOSE.
220 //
221 if (!defined('CACHE_CONTROL')) define('CACHE_CONTROL', 'LOOSE');
222
223 // Maximum page staleness, in seconds.
224 //
225 // This only has effect if CACHE_CONTROL is set to ALLOW_STALE.
226 if (!defined('CACHE_CONTROL_MAX_AGE')) define('CACHE_CONTROL_MAX_AGE', 600);
227
228
229 // MARKUP CACHING
230 //
231 // PhpWiki normally caches a preparsed version (i.e. mostly
232 // converted to HTML) of the most recent version of each page.
233 // (Parsing the wiki-markup takes a fair amount of CPU.)
234 //
235 // Define WIKIDB_NOCACHE_MARKUP to true to disable the
236 // caching of marked-up page content.
237 //
238 // Note that you can also disable markup caching on a per-page
239 // temporary basis by addinging a query arg of '?nocache=1'
240 // to the URL to the page.  (Use '?nocache=purge' to completely
241 // discard the cached version of the page.)
242 //
243 // You can also purge the cached markup globally by using the
244 // "Purge Markup Cache" button on the PhpWikiAdministration page.
245 //if (!defined('WIKIDB_NOCACHE_MARKUP')) define ('WIKIDB_NOCACHE_MARKUP', true);
246
247
248 /////////////////////////////////////////////////////////////////////
249 //
250 // Part Two:
251 // Database Selection
252 //
253 /////////////////////////////////////////////////////////////////////
254
255 //
256 // This array holds the parameters which select the database to use.
257 //
258 // Not all of these parameters are used by any particular DB backend.
259 //
260 $DBParams = array(
261    // Select the database type:
262    //
263    // Choose ADODB or SQL to use an SQL database with ADODB or PEAR
264    // respectively (both ADODB and PEAR libraries are already included
265    // with PhpWiki).
266    // Choose dba to use one of the standard UNIX dbm libraries.
267    // Choose file to use a flat file database.
268    //'dbtype' => 'ADODB',
269    //'dbtype' => 'SQL',
270    'dbtype'   => 'dba',
271    //'dbtype' => 'file',
272    
273    // For SQL based backends, specify the database as a DSN
274    // The most general form of a DSN looks like:
275    //
276    //   phptype(dbsyntax)://username:password@protocol+hostspec/database
277    //
278    // For a MySQL database, the following should work:
279    //
280    //   mysql://user:password@host/databasename
281    //
282    // To connect over a unix socket, use something like
283    //
284    //   mysql://user:password@unix(/path/to/socket)/databasename
285    //
286    //'dsn' => 'mysql://guest@unix(/var/lib/mysql/mysql.sock)/test',
287    //'dsn' => 'mysql://guest@localhost/test',
288    //'dsn' => 'pgsql://localhost/test',
289
290    // experimental
291    'db_session_table'   => 'session',
292    
293    // Used by all DB types:
294
295    // prefix for filenames or table names
296    /* 
297     * currently you MUST EDIT THE SQL file too (in the schemas/
298     * directory because we aren't doing on the fly sql generation
299     * during the installation.
300    */
301    //'prefix' => 'phpwiki_',
302    
303    // Used by either 'dba' or 'file' and must be writable by the web
304    // server If you leave this as '/tmp' you will probably lose all
305    // your files eventually
306    'directory'     => "/tmp",
307
308    // choose the type of DB database file to use; most GNU systems have gdbm
309    'dba_handler'   => 'gdbm',   // Either of 'gdbm' or 'db2' work great for me.
310    //'dba_handler' => 'db2',
311    //'dba_handler' => 'db3',    // Works fine on Windows, but not on every linux.
312    //'dba_handler' => 'dbm',    // On sf.net redhat there's dbm and gdbm.
313                                 // dbm suffers from limits on size of data items?
314
315    'timeout'   => 20,
316    //'timeout' => 5
317 );
318
319 // Only for 'dbtype' => 'SQL'. See schemas/mysql.sql or schemas/psql.sql
320 //define('USE_DB_SESSION',true);
321
322 /////////////////////////////////////////////////////////////////////
323 //
324 // The next section controls how many old revisions of each page are
325 // kept in the database.
326 //
327 // There are two basic classes of revisions: major and minor. Which
328 // class a revision belongs in is determined by whether the author
329 // checked the "this is a minor revision" checkbox when they saved the
330 // page.
331 // 
332 // There is, additionally, a third class of revisions: author
333 // revisions. The most recent non-mergable revision from each distinct
334 // author is and author revision.
335 //
336 // The expiry parameters for each of those three classes of revisions
337 // can be adjusted seperately. For each class there are five
338 // parameters (usually, only two or three of the five are actually
339 // set) which control how long those revisions are kept in the
340 // database.
341 //
342 //   max_keep: If set, this specifies an absolute maximum for the
343 //             number of archived revisions of that class. This is
344 //             meant to be used as a safety cap when a non-zero
345 //             min_age is specified. It should be set relatively high,
346 //             and it's purpose is to prevent malicious or accidental
347 //             database overflow due to someone causing an
348 //             unreasonable number of edits in a short period of time.
349 //
350 //   min_age:  Revisions younger than this (based upon the supplanted
351 //             date) will be kept unless max_keep is exceeded. The age
352 //             should be specified in days. It should be a
353 //             non-negative, real number,
354 //
355 //   min_keep: At least this many revisions will be kept.
356 //
357 //   keep:     No more than this many revisions will be kept.
358 //
359 //   max_age:  No revision older than this age will be kept.
360 //
361 // Supplanted date: Revisions are timestamped at the instant that they
362 // cease being the current revision. Revision age is computed using
363 // this timestamp, not the edit time of the page.
364 //
365 // Merging: When a minor revision is deleted, if the preceding
366 // revision is by the same author, the minor revision is merged with
367 // the preceding revision before it is deleted. Essentially: this
368 // replaces the content (and supplanted timestamp) of the previous
369 // revision with the content after the merged minor edit, the rest of
370 // the page metadata for the preceding version (summary, mtime, ...)
371 // is not changed.
372 //
373 // Keep up to 8 major edits, but keep them no longer than a month.
374 $ExpireParams['major'] = array('max_age' => 32,
375                                'keep'    => 8);
376 // Keep up to 4 minor edits, but keep them no longer than a week.
377 $ExpireParams['minor'] = array('max_age' => 7,
378                                'keep'    => 4);
379 // Keep the latest contributions of the last 8 authors up to a year.
380 // Additionally, (in the case of a particularly active page) try to
381 // keep the latest contributions of all authors in the last week (even
382 // if there are more than eight of them,) but in no case keep more
383 // than twenty unique author revisions.
384 $ExpireParams['author'] = array('max_age'  => 365,
385                                 'keep'     => 8,
386                                 'min_age'  => 7,
387                                 'max_keep' => 20);
388
389 /////////////////////////////////////////////////////////////////////
390 //
391 // Part Three: (optional)
392 // User Authentication
393 //
394 /////////////////////////////////////////////////////////////////////
395
396 // The wiki can be protected by HTTP Auth. Use the username and password 
397 // from there, but this is not sufficient. Try the other methods also.
398 if (!defined('ALLOW_HTTP_AUTH_LOGIN')) define('ALLOW_HTTP_AUTH_LOGIN', false);
399
400 // If ALLOW_USER_LOGIN is true, any defined internal and external
401 // authentication method is tried. If not, we don't care about
402 // passwords, but listen to the next two constants. Note that external
403 // authentication is not supported at this time, you will likely have
404 // to patch code yourself to get PhpWiki to recognise userids and
405 // passwords from an external source.
406 if (!defined('ALLOW_USER_LOGIN')) define('ALLOW_USER_LOGIN', false);
407
408 // If ALLOW_BOGO_LOGIN is true, users are allowed to login (with
409 // any/no password) using any userid which: 
410 //  1) is not the ADMIN_USER,
411 //  2) is a valid WikiWord (matches $WikiNameRegexp.)
412 // If true, users may be created by themselves. Otherwise we need
413 // seperate auth. This might be renamed to ALLOW_SELF_REGISTRATION.
414 if (!defined('ALLOW_BOGO_LOGIN')) define('ALLOW_BOGO_LOGIN', true);
415
416 // This will go away, with true page permissions.
417 // If set, then if an anonymous user attempts to edit a page he will
418 // be required to sign in.  (If ALLOW_BOGO_LOGIN is true, of course,
419 // no password is required, but the user must still sign in under
420 // some sort of WikiWordName.)
421 if (!defined('REQUIRE_SIGNIN_BEFORE_EDIT')) define('REQUIRE_SIGNIN_BEFORE_EDIT', false);
422
423 // The login code now uses PHP's session support. Usually, the default
424 // configuration of PHP is to store the session state information in
425 // /tmp. That probably will work fine, but fails e.g. on clustered
426 // servers where each server has their own distinct /tmp (this is the
427 // case on SourceForge's project web server.) You can specify an
428 // alternate directory in which to store state information like so
429 // (whatever user your httpd runs as must have read/write permission
430 // in this directory):
431
432 //ini_set('session.save_path', 'some_other_directory');
433
434 // If your php was compiled with --enable-trans-sid it tries to
435 // add a PHPSESSID query argument to all URL strings when cookie
436 // support isn't detected in the client browser.  For reasons
437 // which aren't entirely clear (PHP bug) this screws up the URLs
438 // generated by PhpWiki.  Therefore, transparent session ids
439 // should be disabled.  This next line does that.
440 //
441 // (At the present time, you will not be able to log-in to PhpWiki,
442 // unless your browser supports cookies.)
443 @ini_set('session.use_trans_sid', 0);
444
445 // LDAP auth
446 if (!defined('ALLOW_LDAP_LOGIN')) define('ALLOW_LDAP_LOGIN', true and function_exists('ldap_connect'));
447 if (!defined('LDAP_AUTH_HOST'))   define('LDAP_AUTH_HOST', 'localhost');
448 // Give the right LDAP root search information in the next statement. 
449 if (!defined('LDAP_AUTH_SEARCH')) define('LDAP_AUTH_SEARCH', "ou=mycompany.com,o=My Company");
450
451 // IMAP auth: check userid/passwords from a imap server, defaults to localhost
452 if (!defined('ALLOW_IMAP_LOGIN')) define('ALLOW_IMAP_LOGIN', true and function_exists('imap_open'));
453 if (!defined('IMAP_AUTH_HOST'))   define('IMAP_AUTH_HOST', 'localhost');
454
455 // Sample of external AuthDB mysql tables to check against
456 /*
457 use phpwiki;
458 CREATE TABLE pref (
459   userid char(48) binary NOT NULL UNIQUE,
460   preferences text NULL default '',
461   PRIMARY KEY (userid)
462 ) TYPE=MyISAM;
463 INSERT INTO user VALUES ('ReiniUrban', 'a:1:{s:6:"passwd";s:13:"7cyrcMAh0grMI";}');
464
465 // or password only
466 CREATE TABLE user (
467   userid char(48) binary NOT NULL UNIQUE,
468   passwd char(48) binary default '*',
469   PRIMARY KEY (userid)
470 ) TYPE=MyISAM;
471
472 */
473 // external mysql member table
474 /*
475  CREATE TABLE member (
476    user  char(48) NOT NULL,
477    group char(48) NOT NULL default 'users',
478    PRIMARY KEY (user),
479    KEY groupname (groupname)
480  ) TYPE=MyISAM;
481  INSERT INTO member VALUES ('wikiadmin', 'root');
482  INSERT INTO member VALUES ('TestUser', 'users');
483 */
484
485 // 
486 // Seperate DB User Authentication. 
487 //   Can be external, like radius, phpnuke, courier authmysql,
488 //   apache auth_mysql or something else.
489 // The default is to store the data as metadata in WikiPages.
490 // The most likely dsn option is the same dsn as the wikipages.
491 $DBAuthParams = array(
492    //'auth_dsn'         => 'mysql://localhost/phpwiki',
493
494    // USER => PASSWORD
495    'auth_check'  => 'SELECT passwd FROM user WHERE username="$userid"',
496    // Alternatively we accept files also. (not yet)
497    //'auth_user_file'  => '/etc/shadow', // '/etc/httpd/.htpasswd'
498
499    'auth_crypt_method'  => 'crypt',     // 'crypt' (unix) or 'md5' (mysql) or just 'plain'
500    // 'auth_crypt_method'  => 'md5',    // for 'mysql://localhost/mysql' users
501    // 'auth_crypt_method'  => 'plain',
502
503    // If 'auth_update' is not defined but 'auth_check' is defined, the user cannot 
504    // change his password.
505    // $password is processed  by the 'auth_crypt_method'.
506    'auth_update'  => 'UPDATE user SET password="$password" WHERE username="$userid"',
507
508    // USER => PREFERENCES
509    //   This can be optionally defined in an external DB. 
510    //   The default is the users homepage.
511    //'pref_select' => 'SELECT pref from user WHERE username="$userid"',
512    //'pref_update' => 'UPDATE user SET prefs="$pref_blob" WHERE username="$userid"',
513
514    // USERS <=> GROUPS
515    //   This can be optionally defined in an external DB. The default is a 
516    //   special locked wikipage for groupmembers .(which?)
517    // All members of the group:
518    'group_members' => 'SELECT username FROM grouptable WHERE groupname="$group"',
519    // All groups this user belongs to:
520    'user_groups' => 'SELECT groupname FROM grouptable WHERE username="$userid"',
521    // Alternatively we accept files also. (not yet)
522    //'auth_group_file' => '/etc/groups', // '/etc/httpd/.htgroup'
523
524    'dummy' => false,
525 );
526
527 /////////////////////////////////////////////////////////////////////
528 //
529 // Part Four:
530 // Page appearance and layout
531 //
532 /////////////////////////////////////////////////////////////////////
533
534 /* THEME
535  *
536  * Most of the page appearance is controlled by files in the theme
537  * subdirectory.
538  *
539  * There are a number of pre-defined themes shipped with PhpWiki.
540  * Or you may create your own (e.g. by copying and then modifying one of
541  * stock themes.)
542  *
543  * Pick one.
544  */
545 if (!defined('THEME')) {
546 define('THEME', 'default');
547 //define('THEME', 'Hawaiian');
548 //define('THEME', 'MacOSX');
549 //define('THEME', 'Portland');
550 //define('THEME', 'Sidebar');
551 //define('THEME', 'SpaceWiki');
552 }
553
554 // Select a valid charset name to be inserted into the xml/html pages,
555 // and to reference links to the stylesheets (css). For more info see:
556 // <http://www.iana.org/assignments/character-sets>. Note that PhpWiki
557 // has been extensively tested only with the latin1 (iso-8859-1)
558 // character set.
559 //
560 // If you change the default from iso-8859-1 PhpWiki may not work
561 // properly and will require code modifications, at the very least you
562 // will have to convert the files in pgsrc or locale/xx/pgsrc to
563 // match!
564 //
565 // Character sets similar to iso-8859-1 may work with little or no
566 // modification depending on your setup. The database must also
567 // support the same charset, and of course the same is true for the
568 // web browser. (Some work is in progress hopefully to allow more
569 // flexibility in this area in the future).
570 if (!defined('CHARSET')) define("CHARSET", "iso-8859-1");
571
572 // Select your language/locale - default language is "en" for English.
573 // Other languages available:
574 // English "en"  (English    - HomePage)
575 // Dutch   "nl" (Nederlands - ThuisPagina)
576 // Spanish "es" (Español    - PáginaPrincipal)
577 // French  "fr" (Français   - Accueil)
578 // German  "de" (Deutsch    - StartSeite)
579 // Swedish "sv" (Svenska    - Framsida)
580 // Italian "it" (Italiano   - PaginaPrincipale)
581 //
582 // If you set DEFAULT_LANGUAGE to the empty string, your system's
583 // default language (as determined by the applicable environment
584 // variables) will be used.
585 //
586 if (!defined('DEFAULT_LANGUAGE')) define('DEFAULT_LANGUAGE', 'en');
587
588 /* WIKI_PGSRC -- specifies the source for the initial page contents of
589  * the Wiki. The setting of WIKI_PGSRC only has effect when the wiki is
590  * accessed for the first time (or after clearing the database.)
591  * WIKI_PGSRC can either name a directory or a zip file. In either case
592  * WIKI_PGSRC is scanned for files -- one file per page.
593  */
594 if (!defined('WIKI_PGSRC')) define('WIKI_PGSRC', "pgsrc"); // Default (old) behavior.
595 //define('WIKI_PGSRC', 'wiki.zip'); // New style.
596 //define('WIKI_PGSRC', '../../../Logs/Hamwiki/hamwiki-20010830.zip'); // New style.
597
598 /*
599  * DEFAULT_WIKI_PGSRC is only used when the language is *not* the
600  * default (English) and when reading from a directory: in that case
601  * some English pages are inserted into the wiki as well.
602  * DEFAULT_WIKI_PGSRC defines where the English pages reside.
603  */
604 // FIXME: is this really needed?  Can't we just copy these pages into
605 // the localized pgsrc?
606 define('DEFAULT_WIKI_PGSRC', "pgsrc");
607 // These are the pages which will get loaded from DEFAULT_WIKI_PGSRC.   
608 $GenericPages = array("ReleaseNotes", "SteveWainstead", "TestPage");
609
610 /////////////////////////////////////////////////////////////////////
611 //
612 // Part Five:
613 // Mark-up options.
614 // 
615 /////////////////////////////////////////////////////////////////////
616
617 // allowed protocols for links - be careful not to allow "javascript:"
618 // URL of these types will be automatically linked.
619 // within a named link [name|uri] one more protocol is defined: phpwiki
620 $AllowedProtocols = "http|https|mailto|ftp|news|nntp|ssh|gopher";
621
622 // URLs ending with the following extension should be inlined as images
623 $InlineImages = "png|jpg|gif";
624
625 // Perl regexp for WikiNames ("bumpy words")
626 // (?<!..) & (?!...) used instead of '\b' because \b matches '_' as well
627 $WikiNameRegexp = "(?<![[:alnum:]])(?:[[:upper:]][[:lower:]]+){2,}(?![[:alnum:]])";
628
629 // Defaults to '/', but '.' was also used.
630 if (!defined('SUBPAGE_SEPARATOR')) define('SUBPAGE_SEPARATOR', '/');
631
632 // InterWiki linking -- wiki-style links to other wikis on the web
633 //
634 // The map will be taken from a page name InterWikiMap.
635 // If that page is not found (or is not locked), or map
636 // data can not be found in it, then the file specified
637 // by INTERWIKI_MAP_FILE (if any) will be used.
638 define('INTERWIKI_MAP_FILE', "lib/interwiki.map");
639
640 // Display a warning if the internal lib/interwiki.map is used, and 
641 // not the public InterWikiMap page. This file is not readable from outside.
642 //define('WARN_NONPUBLIC_INTERWIKIMAP', false);
643
644 // Regexp used for automatic keyword extraction.
645 //
646 // Any links on a page to pages whose names match this regexp will
647 // be used keywords in the keywords meta tag.  (This is an aid to
648 // classification by search engines.)  The value of the match is
649 // used as the keyword.
650 //
651 // The default behavior is to match Category* and Topic* links.
652 $keywords = array(_("Category"), _("Topic"));
653 $KeywordLinkRegexp = '(?<=^'. join('|^', $keywords) . ')[[:upper:]].*$';
654
655 // Author and Copyright Site Navigation Links
656 //
657 // These will be inserted as <link rel> tags in the html header of
658 // every page, for search engines and for browsers like Mozilla which
659 // take advantage of link rel site navigation.
660 //
661 // If you have your own copyright and contact information pages change
662 // these as appropriate.
663 if (!defined('COPYRIGHTPAGE_TITLE')) define('COPYRIGHTPAGE_TITLE',
664     "GNU General Public License");
665 if (!defined('COPYRIGHTPAGE_URL')) define('COPYRIGHTPAGE_URL',
666     'http://www.gnu.org/copyleft/gpl.html#SEC1');
667 if (!defined('AUTHORPAGE_TITLE')) define('AUTHORPAGE_TITLE',
668     _("The PhpWiki Programming Team"));
669 if (!defined('AUTHORPAGE_URL')) define('AUTHORPAGE_URL',
670     'http://phpwiki.sourceforge.net/phpwiki/ThePhpWikiProgrammingTeam');
671
672
673 /////////////////////////////////////////////////////////////////////
674 //
675 // Part Six:
676 // URL options -- you can probably skip this section.
677 //
678 /////////////////////////////////////////////////////////////////////
679 /******************************************************************
680  *
681  * The following section contains settings which you can use to tailor
682  * the URLs which PhpWiki generates.
683  *
684  * Any of these parameters which are left undefined will be deduced
685  * automatically. You need only set them explicitly if the
686  * auto-detected values prove to be incorrect.
687  *
688  * In most cases the auto-detected values should work fine, so
689  * hopefully you don't need to mess with this section.
690  *
691  * In case of local overrides of short placeholders, which themselves 
692  * include index.php, we check for most constants. See '/wiki'.
693  * We can override DATA_PATH and PHPWIKI_DIR to support multiple phpwiki 
694  * versions (for development), but most likely other values like 
695  * THEME, $LANG and $DbParams for a WikiFarm.
696  *
697  ******************************************************************/
698
699 /*
700  * Canonical name and httpd port of the server on which this PhpWiki
701  * resides.
702  */
703 //if (!defined('SERVER_NAME')) define('SERVER_NAME', 'some.host.com');
704 //define('SERVER_PORT', 80);
705
706 /*
707  * Relative URL (from the server root) of the PhpWiki
708  * script.
709  */
710 //if (!defined('SCRIPT_NAME')) define('SCRIPT_NAME', '/some/where/index.php');
711
712 /*
713  * URL of the PhpWiki install directory.  (You only need to set this
714  * if you've moved index.php out of the install directory.)  This can
715  * be either a relative URL (from the directory where the top-level
716  * PhpWiki script is) or an absolute one.
717  */
718 //if (!defined('DATA_PATH')) define('DATA_PATH', '/home/user/phpwiki');
719
720 /*
721  * Path to the PhpWiki install directory.  This is the local
722  * filesystem counterpart to DATA_PATH.  (If you have to set
723  * DATA_PATH, your probably have to set this as well.)  This can be
724  * either an absolute path, or a relative path interpreted from the
725  * directory where the top-level PhpWiki script (normally index.php)
726  * resides.
727  */
728 //if (!defined('PHPWIKI_DIR')) define('PHPWIKI_DIR', 'C:/Apache/phpwiki');
729 //if (!defined('PHPWIKI_DIR')) define('PHPWIKI_DIR', '/home/user/public_html/phpwiki');
730
731 /*
732  * PhpWiki will try to use short urls to pages, eg 
733  * http://www.example.com/index.php/HomePage
734  * If you want to use urls like 
735  * http://www.example.com/index.php?pagename=HomePage
736  * then define 'USE_PATH_INFO' as false by uncommenting the line below.
737  * NB:  If you are using Apache >= 2.0.30, then you may need to to use
738  * the directive "AcceptPathInfo On" in your Apache configuration file
739  * (or in an appropriate <.htaccess> file) for the short urls to work:  
740  * See http://httpd.apache.org/docs-2.0/mod/core.html#acceptpathinfo
741  * 
742  * See also http://phpwiki.sourceforge.net/phpwiki/PrettyWiki for more ideas
743  * on prettifying your urls.
744  *
745  * Default: PhpWiki will try to divine whether use of PATH_INFO
746  * is supported in by your webserver/PHP configuration, and will
747  * use PATH_INFO if it thinks that is possible.
748  */
749 //if (!defined('USE_PATH_INFO')) define('USE_PATH_INFO', false);
750
751 /*
752  * VIRTUAL_PATH is the canonical URL path under which your your wiki
753  * appears. Normally this is the same as dirname(SCRIPT_NAME), however
754  * using, e.g. apaches mod_actions (or mod_rewrite), you can make it
755  * something different.
756  *
757  * If you do this, you should set VIRTUAL_PATH here.
758  *
759  * E.g. your phpwiki might be installed at at /scripts/phpwiki/index.php,
760  * but  * you've made it accessible through eg. /wiki/HomePage.
761  *
762  * One way to do this is to create a directory named 'wiki' in your
763  * server root. The directory contains only one file: an .htaccess
764  * file which reads something like:
765  *
766  *    Action x-phpwiki-page /scripts/phpwiki/index.php
767  *    SetHandler x-phpwiki-page
768  *    DirectoryIndex /scripts/phpwiki/index.php
769  *
770  * In that case you should set VIRTUAL_PATH to '/wiki'.
771  *
772  * (VIRTUAL_PATH is only used if USE_PATH_INFO is true.)
773  */
774 //if (!defined('VIRTUAL_PATH')) define('VIRTUAL_PATH', '/SomeWiki');
775
776 /////////////////////////////////////////////////////////////////////
777 //
778 // Part Seven:
779 // Miscellaneous settings
780 //
781 /////////////////////////////////////////////////////////////////////
782
783 /*
784  * Disable HTTP redirects.
785  *
786  * (You probably don't need to touch this.)
787  *
788  * PhpWiki uses HTTP redirects for some of it's functionality.
789  * (e.g. after saving changes, PhpWiki redirects your browser to
790  * view the page you just saved.)
791  *
792  * Some web service providers (notably free European Lycos) don't seem to
793  * allow these redirects.  (On Lycos the result in an "Internal Server Error"
794  * report.)  In that case you can set DISABLE_HTTP_REDIRECT to true.
795  * (In which case, PhpWiki will revert to sneakier tricks to try to
796  * redirect the browser...)
797  */
798 //if (!defined('DISABLE_HTTP_REDIRECT')) define ('DISABLE_HTTP_REDIRECT', true);
799
800 ////////////////////////////////////////////////////////////////
801 // Check if we were included by some other wiki version 
802 // (getimg.php, en, de, wiki, ...) or not. 
803 // If the server requested this index.php fire up the code by loading lib/main.php.
804 // Parallel wiki scripts can now simply include /index.php for the 
805 // main configuration, extend or redefine some settings and 
806 // load lib/main.php by themselves. See the file 'wiki'.
807 // This overcomes the IndexAsConfigProblem.
808 ////////////////////////////////////////////////////////////////
809
810 // Tested: Works with CGI also.
811 if (defined('VIRTUAL_PATH') and defined('USE_PATH_INFO')) {
812     if ($HTTP_SERVER_VARS['SCRIPT_NAME'] == VIRTUAL_PATH) {
813         include "lib/main.php";
814     }
815 } else {
816     if (defined('SCRIPT_NAME') and 
817         ($HTTP_SERVER_VARS['SCRIPT_NAME'] == SCRIPT_NAME)) {
818         include "lib/main.php";
819     } elseif (strstr($HTTP_SERVER_VARS['PHP_SELF'],'index.php')) {
820         include "lib/main.php";
821     }
822 }
823
824 // (c-file-style: "gnu")
825 // Local Variables:
826 // mode: php
827 // tab-width: 8
828 // c-basic-offset: 4
829 // c-hanging-comment-ender-p: nil
830 // indent-tabs-mode: nil
831 // End:   
832
833 // $Log: not supported by cvs2svn $
834 // Revision 1.112  2003/11/17 15:49:21  carstenklapp
835 // Updated version number to 1.3.7pre (beyond current release
836 // 1.3.6). Disabled DEBUG output by default (hide DebugInfo, XHTML &
837 // CSS validator buttons). Note the DebugInfo button remains visible
838 // for the Admin, and can be accessed by anyone else by adding
839 // "?action=DebugInfo" to the URL for the occasional use.
840 //
841 // Revision 1.111  2003/03/18 21:40:04  dairiki
842 // Copy Lawrence's memo on USE_PATH_INFO/AcceptPathInfo to configurator.php
843 // (as promised).
844 //
845 // Plus slight clarification of default (auto-detect) behavior.
846 //
847 // Revision 1.110  2003/03/18 20:51:10  lakka
848 // Revised comments on use of USE_PATH_INFO with Apache 2
849 //
850 // Revision 1.109  2003/03/17 21:24:50  dairiki
851 // Fix security bugs in the RawHtml plugin.
852 //
853 // Change the default configuration to allow use of plugin, since
854 // I believe the plugin is now safe for general use. (Raw HTML will only
855 // work on locked pages.)
856 //
857 // Revision 1.108  2003/03/07 22:47:01  dairiki
858 // A few more if(!defined(...))'s
859 //
860 // Revision 1.107  2003/03/07 20:51:54  dairiki
861 // New feature: Automatic extraction of keywords (for the meta keywords tag)
862 // from Category* and Topic* links on each page.
863 //
864 // Revision 1.106  2003/03/07 02:48:23  dairiki
865 // Add option to prevent HTTP redirect.
866 //
867 // Revision 1.105  2003/03/04 02:08:08  dairiki
868 // Fix and document the WIKIDB_NOCACHE_MARKUP config define.
869 //
870 // Revision 1.104  2003/02/26 02:55:52  dairiki
871 // New config settings in index.php to control cache control strictness.
872 //
873 // Revision 1.103  2003/02/22 19:43:50  dairiki
874 // Fix comment regarding connecting to SQL server over a unix socket.
875 //
876 // Revision 1.102  2003/02/22 18:53:38  dairiki
877 // Renamed method Request::compress_output to Request::buffer_output.
878 //
879 // Added config option to disable compression.
880 //
881 // Revision 1.101  2003/02/21 19:29:30  dairiki
882 // Update PHPWIKI_VERSION to 1.3.5pre.
883 //
884 // Revision 1.100  2003/01/04 03:36:58  wainstead
885 // Added 'file' as a database type alongside 'dbm'; added cvs log tag
886 //
887
888 ?>