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
12 Copyright 1999,2000,2001,2002,2003,2004 $ThePhpWikiProgrammingTeam
14 "Steve Wainstead", "Clifford A. Adams", "Lawrence Akka",
15 "Scott R. Anderson", "Jon Åslund", "Neil Brown", "Jeff Dairiki",
16 "Stéphane Gourichon", "Jan Hidders", "Arno Hollosi", "John Jorgensen",
17 "Antti Kaihola", "Jeremie Kass", "Carsten Klapp", "Marco Milanesi",
18 "Grant Morgan", "Jan Nieuwenhuizen", "Aredridel Niothke",
19 "Pablo Roca Rozas", "Sandino Araico Sánchez", "Joel Uckelman",
20 "Reini Urban", "Tim Voght", "Jochen Kalmbach");
22 This file is part of PhpWiki.
24 PhpWiki is free software; you can redistribute it and/or modify
25 it under the terms of the GNU General Public License as published by
26 the Free Software Foundation; either version 2 of the License, or
27 (at your option) any later version.
29 PhpWiki is distributed in the hope that it will be useful,
30 but WITHOUT ANY WARRANTY; without even the implied warranty of
31 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32 GNU General Public License for more details.
34 You should have received a copy of the GNU General Public License
35 along with PhpWiki; if not, write to the Free Software
36 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
39 require_once "lib/prepend.php";
40 rcs_id('$Id: index.php,v 1.141 2004-04-19 23:13:02 zorloc Exp $');
42 require_once "lib/IniConfig.php";
43 IniConfig("config/config.ini");
45 //if (defined('WIKI_SOAP') and WIKI_SOAP) return;
47 ////////////////////////////////////////////////////////////////
49 // Check if we were included by some other wiki version
50 // (getimg.php, en, de, wiki, ...) or not.
51 // If the server requested this index.php fire up the code by loading lib/main.php.
52 // Parallel wiki scripts can now simply include /index.php for the
53 // main configuration, extend or redefine some settings and
54 // load lib/main.php by themselves. See the file 'wiki'.
55 // This overcomes the IndexAsConfigProblem.
57 // define('VIRTUAL_PATH', $_SERVER['SCRIPT_NAME']);
58 // is enough in the wiki file, plus the action definition in a .htaccess file
59 ////////////////////////////////////////////////////////////////
61 // If your lib/main.php is not loaded, comment that out, and
62 // uncomment the include "lib/main.php" line below.
63 if (defined('VIRTUAL_PATH') and defined('USE_PATH_INFO')) {
64 if ($HTTP_SERVER_VARS['SCRIPT_NAME'] != VIRTUAL_PATH) {
65 include "lib/main.php";
67 elseif (defined('SCRIPT_NAME') and
68 ($HTTP_SERVER_VARS['SCRIPT_NAME'] != SCRIPT_NAME)) {
69 include "lib/main.php";
72 if (defined('SCRIPT_NAME') and
73 ($HTTP_SERVER_VARS['SCRIPT_NAME'] == SCRIPT_NAME)) {
74 include "lib/main.php";
75 } elseif (strstr($HTTP_SERVER_VARS['PHP_SELF'],'index.php')) {
76 include "lib/main.php";
79 //include "lib/main.php";
81 // $Log: not supported by cvs2svn $
82 // Revision 1.140 2004/04/12 18:29:12 rurban
83 // exp. Session auth for already authenticated users from another app
85 // Revision 1.139 2004/04/12 16:24:28 rurban
86 // 1.3.10pre, JS_SEARCHREPLACE => pref option
88 // Revision 1.138 2004/04/12 12:27:07 rurban
89 // more notes and themes
91 // Revision 1.137 2004/04/11 10:42:02 rurban
92 // pgsrc/CreatePagePlugin
94 // Revision 1.136 2004/04/10 04:14:13 rurban
95 // sf.net 906436 Suggestion
97 // Revision 1.135 2004/04/10 03:33:03 rurban
100 // Revision 1.134 2004/04/10 02:55:48 rurban
101 // fixed old WikiUser
103 // Revision 1.133 2004/04/08 01:22:53 rurban
104 // fixed PageChange Notification
106 // Revision 1.132 2004/04/01 15:57:10 rurban
107 // simplified Sidebar theme: table, not absolute css positioning
108 // added the new box methods.
109 // remaining problems: large left margin, how to override _autosplitWikiWords in Template only
111 // Revision 1.131 2004/03/14 16:24:35 rurban
112 // authenti(fi)cation spelling
114 // Revision 1.130 2004/03/09 17:16:43 rurban
115 // fixed $LDAP_SET_OPTION
117 // Revision 1.129 2004/02/29 04:10:55 rurban
118 // new POP3 auth (thanks to BiloBilo: pentothal at despammed dot com)
119 // fixed syntax error in index.php
121 // Revision 1.128 2004/02/29 02:06:05 rurban
122 // And this is the SOAP server. Just a view methods for now. (page content)
123 // I would like to see common-wiki soap wdsl.
125 // "SOAP is a bloated, over engineered mess of a perfectly trivial concept. Sigh."
126 // -- http://www.wlug.org.nz/SOAP
128 // Revision 1.127 2004/02/28 21:18:29 rurban
129 // new SQL auth_create, don't ever use REPLACE sql calls!
130 // moved HttpAuth to the end of the chain
131 // PrettyWiki enabled again
133 // Revision 1.126 2004/02/27 16:27:48 rurban
134 // REPLACE is a dirty hack, and erases passwd btw.
136 // Revision 1.125 2004/02/24 02:51:57 rurban
137 // release 1.3.8 ready
139 // Revision 1.124 2004/02/16 00:20:30 rurban
140 // new Japanses language
142 // Revision 1.123 2004/02/09 03:58:07 rurban
143 // for now default DB_SESSION to false
145 // * not existing perms will now query the parent, and not
146 // return the default perm
147 // * added pagePermissions func which returns the object per page
148 // * added getAccessDescription
150 // * added global ->prepare (not yet used) with smart user/pref/member table prefixing.
151 // * force init of authdbh in the 2 db classes
153 // * fixed session handling (not triple auth request anymore)
154 // * don't store cookie prefs with sessions
155 // stdlib: global obj2hash helper from _AuthInfo, also needed for PagePerm
157 // Revision 1.122 2004/02/07 14:20:18 rurban
158 // consistent mysql schema with index.php (userid)
160 // Revision 1.121 2004/02/07 10:41:25 rurban
161 // fixed auth from session (still double code but works)
163 // fixed DbPassUser upgrade and policy=old
166 // Revision 1.120 2004/02/03 09:45:39 rurban
167 // LDAP cleanup, start of new Pref classes
169 // Revision 1.119 2004/02/01 09:14:10 rurban
170 // Started with Group_Ldap (not yet ready)
171 // added new _AuthInfo plugin to help in auth problems (warning: may display passwords)
172 // fixed some configurator vars
173 // renamed LDAP_AUTH_SEARCH to LDAP_BASE_DN
174 // changed PHPWIKI_VERSION from 1.3.8a to 1.3.8pre
175 // USE_DB_SESSION defaults to true on SQL
176 // changed GROUP_METHOD definition to string, not constants
177 // changed sample user DBAuthParams from UPDATE to REPLACE to be able to
178 // create users. (Not to be used with external databases generally, but
179 // with the default internal user table)
181 // fixed the IndexAsConfigProblem logic. this was flawed:
182 // scripts which are the same virtual path defined their own lib/main call
183 // (hmm, have to test this better, phpwiki.sf.net/demo works again)
185 // Revision 1.118 2004/01/28 14:34:13 rurban
186 // session table takes the common prefix
187 // + various minor stuff
188 // reallow password changing
190 // Revision 1.117 2004/01/27 23:25:50 rurban
191 // added new tables to mysql schema
192 // fixed default DBAUthParam samples to match these
193 // added group constants (look terrible, I'd prefer strings instead of constants)
195 // Revision 1.116 2004/01/25 04:21:02 rurban
196 // WikiUserNew support (temp. ENABLE_USER_NEW constant)
198 // Revision 1.115 2003/12/22 04:58:11 carstenklapp
199 // Incremented release version.
201 // Revision 1.114 2003/12/05 16:00:42 carstenklapp
202 // ACK! gettext is not available at this point in index.php.
204 // Revision 1.113 2003/12/05 15:51:37 carstenklapp
205 // Added note that use of the configurator is depreciated.
207 // Enable localization/gettextification of $KeywordLinkRegexp. (Also, now
208 // users not familiar with regex can more easily just edit the $keywords
211 // Added four new constants to define author and copyright link rel~s
212 // used in html head. This makes it easier to run multiple wikis off of
215 // Eliminated RECENT_CHANGES constant for RSS auto discovery because it's
216 // another step to watch out for when running a non-english wiki. Now
217 // simply defined as _("RecentChanges") in head.tmpl itself. Non-standard
218 // wikis where the RecentChanges page has been named to something else
219 // will have to modify this in head.tmpl (along with all other places the
220 // word RecentChanges appears in the code, something that already would
221 // have had to be done on such a wiki anyway).
223 // Added a little more info and instructions to flesh out:
224 // DEBUG, WIKI_NAME, ADMIN_USER, $DisabledActions, $DBParams, CHARSET.
226 // A few typos and spelling mistakes corrected, and some text rewrapped.
228 // Revision 1.112 2003/11/17 15:49:21 carstenklapp
229 // Updated version number to 1.3.7pre (beyond current release
230 // 1.3.6). Disabled DEBUG output by default (hide DebugInfo, XHTML &
231 // CSS validator buttons). Note the DebugInfo button remains visible
232 // for the Admin, and can be accessed by anyone else by adding
233 // "?action=DebugInfo" to the URL for the occasional use.
235 // Revision 1.111 2003/03/18 21:40:04 dairiki
236 // Copy Lawrence's memo on USE_PATH_INFO/AcceptPathInfo to configurator.php
239 // Plus slight clarification of default (auto-detect) behavior.
241 // Revision 1.110 2003/03/18 20:51:10 lakka
242 // Revised comments on use of USE_PATH_INFO with Apache 2
244 // Revision 1.109 2003/03/17 21:24:50 dairiki
245 // Fix security bugs in the RawHtml plugin.
247 // Change the default configuration to allow use of plugin, since
248 // I believe the plugin is now safe for general use. (Raw HTML will only
249 // work on locked pages.)
251 // Revision 1.108 2003/03/07 22:47:01 dairiki
252 // A few more if(!defined(...))'s
254 // Revision 1.107 2003/03/07 20:51:54 dairiki
255 // New feature: Automatic extraction of keywords (for the meta keywords tag)
256 // from Category* and Topic* links on each page.
258 // Revision 1.106 2003/03/07 02:48:23 dairiki
259 // Add option to prevent HTTP redirect.
261 // Revision 1.105 2003/03/04 02:08:08 dairiki
262 // Fix and document the WIKIDB_NOCACHE_MARKUP config define.
264 // Revision 1.104 2003/02/26 02:55:52 dairiki
265 // New config settings in index.php to control cache control strictness.
267 // Revision 1.103 2003/02/22 19:43:50 dairiki
268 // Fix comment regarding connecting to SQL server over a unix socket.
270 // Revision 1.102 2003/02/22 18:53:38 dairiki
271 // Renamed method Request::compress_output to Request::buffer_output.
273 // Added config option to disable compression.
275 // Revision 1.101 2003/02/21 19:29:30 dairiki
276 // Update PHPWIKI_VERSION to 1.3.5pre.
278 // Revision 1.100 2003/01/04 03:36:58 wainstead
279 // Added 'file' as a database type alongside 'dbm'; added cvs log tag
282 // (c-file-style: "gnu")
287 // c-hanging-comment-ender-p: nil
288 // indent-tabs-mode: nil