2 rcs_id('$Id: main.php,v 1.106 2004-01-26 09:17:49 rurban Exp $');
4 define ('USE_PREFS_IN_PAGE', true);
6 include "lib/config.php";
7 require_once("lib/stdlib.php");
8 require_once('lib/Request.php');
10 require_once("lib/WikiUserNew.php");
12 require_once("lib/WikiUser.php");
13 require_once('lib/WikiDB.php');
15 class WikiRequest extends Request {
18 function WikiRequest () {
19 $this->_dbi = WikiDB::open($GLOBALS['DBParams']);
22 include_once('lib/DB_Session.php');
23 $this->_dbsession = & new DB_Session($this->getDbh(),
24 $GLOBALS['DBParams']['db_session_table']);
30 $this->setArg('pagename', $this->_deducePagename());
31 $this->setArg('action', $this->_deduceAction());
33 // Restore auth state. This doesn't check for proper authorization!
34 if (ENABLE_USER_NEW) {
35 $userid = $this->_deduceUsername();
36 $user = WikiUser($userid);
37 if (isset($this->_user))
38 $user = UpgradeUser($this->_user,$user);
40 $this->_prefs = $this->_user->_prefs;
42 $this->_user = new WikiUser($this, $this->_deduceUsername());
43 $this->_prefs = $this->_user->getPreferences();
47 function initializeLang () {
48 if ($user_lang = $this->getPref('lang')) {
49 //trigger_error("DEBUG: initializeLang() ". $user_lang ." calling update_locale()...");
50 update_locale($user_lang);
54 function initializeTheme () {
58 if ($user_theme = $this->getPref('theme'))
59 include_once("themes/$user_theme/themeinfo.php");
60 if (empty($Theme) and defined ('THEME'))
61 include_once("themes/" . THEME . "/themeinfo.php");
63 include_once("themes/default/themeinfo.php");
64 assert(!empty($Theme));
68 // This really maybe should be part of the constructor, but since it
69 // may involve HTML/template output, the global $request really needs
70 // to be initialized before we do this stuff.
71 function updateAuthAndPrefs () {
73 // Handle preference updates, and authentication requests, if any.
74 if ($new_prefs = $this->getArg('pref')) {
75 $this->setArg('pref', false);
76 if ($this->isPost() and !empty($new_prefs['passwd']) and
77 ($new_prefs['passwd2'] != $new_prefs['passwd'])) {
79 $this->_prefs->set('passwd','');
80 // $this->_prefs->set('passwd2',''); // This is not stored anyway
83 foreach ($new_prefs as $key => $val) {
84 if ($key == 'passwd') {
86 $val = crypt('passwd');
88 $this->_prefs->set($key, $val);
92 // FIXME: need to move authentication request processing
93 // up to be before pref request processing, I think,
94 // since logging in may change which preferences
95 // we're talking about...
97 // even we have disallow anon users?
98 // if (! $this->_user ) $this->_user = new _AnonUser();
100 // Handle authentication request, if any.
101 if ($auth_args = $this->getArg('auth')) {
102 $this->setArg('auth', false);
103 $this->_handleAuthRequest($auth_args); // possible NORETURN
105 elseif ( ! $this->_user or ! $this->_user->isSignedIn() ) {
106 // If not auth request, try to sign in as saved user.
107 if (($saved_user = $this->getPref('userid')) != false) {
108 $this->_signIn($saved_user);
112 // Save preferences in session and cookie
113 // FIXME: hey! what about anonymous users? Can't they have
117 $this->_user->setPreferences($this->_prefs, $id_only);
119 // Ensure user has permissions for action
120 $require_level = $this->requiredAuthority($this->getArg('action'));
121 if (! $this->_user->hasAuthority($require_level))
122 $this->_notAuthorized($require_level); // NORETURN
125 function getUser () {
129 function getPrefs () {
130 return $this->_prefs;
133 // Convenience function:
134 function getPref ($key) {
135 if (isset($this->_prefs))
136 return $this->_prefs->get($key);
143 function getAuthDbh () {
144 global $DBParams, $DBAuthParams;
145 if (!isset($this->_auth_dbi)) {
146 if ($DBParams['dbtype'] == 'dba' or empty($DBAuthParams['auth_dsn']))
147 $this->_auth_dbi = $this->getDbh(); // use phpwiki database
148 elseif ($DBAuthParams['auth_dsn'] == $DBParams['dsn'])
149 $this->_auth_dbi = $this->getDbh(); // same phpwiki database
150 else // use external database
151 // needs PHP 4.1. better use $this->_user->...
152 $this->_auth_dbi = WikiDB_User::open($DBAuthParams);
154 return $this->_auth_dbi;
158 * Get requested page from the page database.
159 * By default it will grab the page requested via the URL
161 * This is a convenience function.
162 * @param string $pagename Name of page to get.
163 * @return WikiDB_Page Object with methods to pull data from
164 * database for the page requested.
166 function getPage ($pagename = false) {
167 if (!isset($this->_dbi))
170 $pagename = $this->getArg('pagename');
171 return $this->_dbi->getPage($pagename);
174 /** Get URL for POST actions.
176 * Officially, we should just use SCRIPT_NAME (or some such),
177 * but that causes problems when we try to issue a redirect, e.g.
178 * after saving a page.
180 * Some browsers (at least NS4 and Mozilla 0.97 won't accept
181 * a redirect from a page to itself.)
183 * So, as a HACK, we include pagename and action as query args in
184 * the URL. (These should be ignored when we receive the POST
187 function getPostURL ($pagename=false) {
188 if ($pagename === false)
189 $pagename = $this->getArg('pagename');
190 $action = $this->getArg('action');
191 if ($this->getArg('start_debug')) // zend ide support
192 return WikiURL($pagename, array('action' => $action, 'start_debug' => 1));
194 return WikiURL($pagename, array('action' => $action));
197 function _handleAuthRequest ($auth_args) {
198 if (!is_array($auth_args))
201 // Ignore password unless POST'ed.
202 if (!$this->isPost())
203 unset($auth_args['passwd']);
205 $olduser = $this->_user;
206 $user = $this->_user->AuthCheck($auth_args);
208 if (isa($user,WikiUserClassname()) and $user->isSignedIn()) {
209 // Successful login (or logout.)
210 $this->_setUser($user);
212 elseif (is_string($user)) {
213 // Login attempt failed.
214 $fail_message = $user;
215 $auth_args['pass_required'] = true;
216 // If no password was submitted, it's not really
217 // a failure --- just need to prompt for password...
218 if (!isset($auth_args['passwd'])) {
219 //$auth_args['pass_required'] = false;
220 $fail_message = false;
222 $olduser->PrintLoginForm($this, $auth_args, $fail_message);
223 $this->finish(); //NORETURN
226 // Login request cancelled.
231 * Attempt to sign in (bogo-login).
235 * @param $userid string Userid to attempt to sign in as.
238 function _signIn ($userid) {
239 if (ENABLE_USER_NEW) {
241 $this->_user = new _BogoUser($userid);
243 $this->_user = new _PassUser($userid);
245 $user = $this->_user->AuthCheck(array('userid' => $userid));
246 if (isa($user,WikiUserClassname())) {
247 $this->_setUser($user); // success!
251 function _setUser ($user) {
252 $this->_user = $user;
253 $this->setCookieVar('WIKI_ID', $user->getAuthenticatedId(), 365);
254 $this->setSessionVar('wiki_user', $user);
255 if ($user->isSignedIn())
256 $user->_authhow = 'signin';
258 // Save userid to prefs..
259 if (!($this->_prefs = $this->_user->getPreferences()))
260 $this->_prefs = $this->_user->_prefs;
261 $this->_prefs->set('userid',
262 $user->isSignedIn() ? $user->getId() : '');
265 function _notAuthorized ($require_level) {
266 // Display the authority message in the Wiki's default
267 // language, in case it is not english.
269 // Note that normally a user will not see such an error once
270 // logged in, unless the admin has altered the default
271 // disallowed wikiactions. In that case we should probably
272 // check the user's language prefs too at this point; this
273 // would be a situation which is not really handled with the
275 update_locale(DEFAULT_LANGUAGE);
277 // User does not have required authority. Prompt for login.
278 $what = $this->getActionDescription($this->getArg('action'));
280 if ($require_level == WIKIAUTH_FORBIDDEN) {
281 $this->finish(fmt("%s is disallowed on this wiki.",
282 $this->getDisallowedActionDescription($this->getArg('action'))));
284 elseif ($require_level == WIKIAUTH_BOGO)
285 $msg = fmt("You must sign in to %s.", $what);
286 elseif ($require_level == WIKIAUTH_USER)
287 $msg = fmt("You must log in to %s.", $what);
289 $msg = fmt("You must be an administrator to %s.", $what);
290 $pass_required = ($require_level >= WIKIAUTH_USER);
292 $this->_user->PrintLoginForm($this, compact('require_level','pass_required'), $msg);
293 $this->finish(); // NORETURN
296 function getActionDescription($action) {
297 static $actionDescriptions;
298 if (! $actionDescriptions) {
300 = array('browse' => _("browse pages in this wiki"),
301 'diff' => _("diff pages in this wiki"),
302 'dumphtml' => _("dump html pages from this wiki"),
303 'dumpserial' => _("dump serial pages from this wiki"),
304 'edit' => _("edit pages in this wiki"),
305 'create' => _("create pages in this wiki"),
306 'loadfile' => _("load files into this wiki"),
307 'lock' => _("lock pages in this wiki"),
308 'remove' => _("remove pages from this wiki"),
309 'unlock' => _("unlock pages in this wiki"),
310 'upload' => _("upload a zip dump to this wiki"),
311 'verify' => _("verify the current action"),
312 'viewsource' => _("view the source of pages in this wiki"),
313 'xmlrpc' => _("access this wiki via XML-RPC"),
314 'zip' => _("download a zip dump from this wiki"),
315 'ziphtml' => _("download an html zip dump from this wiki")
318 if (in_array($action, array_keys($actionDescriptions)))
319 return $actionDescriptions[$action];
323 function getDisallowedActionDescription($action) {
324 static $disallowedActionDescriptions;
325 if (! $disallowedActionDescriptions) {
326 $disallowedActionDescriptions
327 = array('browse' => _("Browsing pages"),
328 'diff' => _("Diffing pages"),
329 'dumphtml' => _("Dumping html pages"),
330 'dumpserial' => _("Dumping serial pages"),
331 'edit' => _("Editing pages"),
332 'create' => _("Creating pages"),
333 'loadfile' => _("Loading files"),
334 'lock' => _("Locking pages"),
335 'remove' => _("Removing pages"),
336 'unlock' => _("Unlocking pages"),
337 'upload' => _("Uploading zip dumps"),
338 'verify' => _("Verify the current action"),
339 'viewsource' => _("Viewing the source of pages"),
340 'xmlrpc' => _("XML-RPC access"),
341 'zip' => _("Downloading zip dumps"),
342 'ziphtml' => _("Downloading html zip dumps")
345 if (in_array($action, array_keys($disallowedActionDescriptions)))
346 return $disallowedActionDescriptions[$action];
351 function requiredAuthority ($action) {
352 $auth = $this->requiredAuthorityForAction($action);
355 * This is a hook for plugins to require authority
356 * for posting to them.
358 * IMPORTANT: this is not a secure check, so the plugin
359 * may not assume that any POSTs to it are authorized.
360 * All this does is cause PhpWiki to prompt for login
361 * if the user doesn't have the required authority.
363 if ($this->isPost()) {
364 $post_auth = $this->getArg('require_authority_for_post');
365 if ($post_auth !== false)
366 $auth = max($auth, $post_auth);
371 function requiredAuthorityForAction ($action) {
373 // Todo: Check individual page permissions instead.
381 return WIKIAUTH_ANON;
385 if (defined('ZIPDUMP_AUTH') && ZIPDUMP_AUTH)
386 return WIKIAUTH_ADMIN;
387 return WIKIAUTH_ANON;
390 if (defined('REQUIRE_SIGNIN_BEFORE_EDIT') && REQUIRE_SIGNIN_BEFORE_EDIT)
391 return WIKIAUTH_BOGO;
392 return WIKIAUTH_ANON;
393 // return WIKIAUTH_BOGO;
396 $page = $this->getPage();
397 $current = $page->getCurrentRevision();
398 if ($current->hasDefaultContents())
399 return $this->requiredAuthorityForAction('edit');
400 return $this->requiredAuthorityForAction('browse');
409 return WIKIAUTH_ADMIN;
411 global $WikiNameRegexp;
412 if (preg_match("/$WikiNameRegexp\Z/A", $action))
413 return WIKIAUTH_ANON; // ActionPage.
415 return WIKIAUTH_ADMIN;
419 function possiblyDeflowerVirginWiki () {
420 if ($this->getArg('action') != 'browse')
422 if ($this->getArg('pagename') != HOME_PAGE)
425 $page = $this->getPage();
426 $current = $page->getCurrentRevision();
427 if ($current->getVersion() > 0)
428 return; // Homepage exists.
430 include('lib/loadsave.php');
432 $this->finish(); // NORETURN
435 function handleAction () {
436 $action = $this->getArg('action');
437 $method = "action_$action";
438 if (method_exists($this, $method)) {
441 elseif ($page = $this->findActionPage($action)) {
442 $this->actionpage($page);
445 $this->finish(fmt("%s: Bad action", $action));
449 function finish ($errormsg = false) {
453 exit(); // just in case CloseDataBase calls us
456 if (!empty($this->_dbi))
457 $this->_dbi->close();
461 global $ErrorManager;
462 $ErrorManager->flushPostponedErrors();
464 if (!empty($errormsg)) {
467 HTML::h2(_("Fatal PhpWiki Error")),
470 echo "\n</body></html>";
477 function _deducePagename () {
478 if ($this->getArg('pagename'))
479 return $this->getArg('pagename');
482 $pathinfo = $this->get('PATH_INFO');
483 $tail = substr($pathinfo, strlen(PATH_INFO_PREFIX));
485 if ($tail && $pathinfo == PATH_INFO_PREFIX . $tail) {
489 elseif ($this->isPost()) {
491 * In general, for security reasons, HTTP_GET_VARS should be ignored
492 * on POST requests, but we make an exception here (only for pagename).
494 * The justifcation for this hack is the following
495 * asymmetry: When POSTing with USE_PATH_INFO set, the
496 * pagename can (and should) be communicated through the
497 * request URL via PATH_INFO. When POSTing with
498 * USE_PATH_INFO off, this cannot be done --- the only way
499 * to communicate the pagename through the URL is via
500 * QUERY_ARGS (HTTP_GET_VARS).
502 global $HTTP_GET_VARS;
503 if (isset($HTTP_GET_VARS['pagename'])) {
504 return $HTTP_GET_VARS['pagename'];
509 * Support for PhpWiki 1.2 style requests.
511 $query_string = $this->get('QUERY_STRING');
512 if (preg_match('/^[^&=]+$/', $query_string)) {
513 return urldecode($query_string);
519 function _deduceAction () {
520 if (!($action = $this->getArg('action'))) {
521 // Detect XML-RPC requests
523 && $this->get('CONTENT_TYPE') == 'text/xml') {
524 global $HTTP_RAW_POST_DATA;
525 if (strstr($HTTP_RAW_POST_DATA, '<methodCall>')) {
530 return 'browse'; // Default if no action specified.
533 if (method_exists($this, "action_$action"))
536 // Allow for, e.g. action=LikePages
537 if ($this->isActionPage($action))
540 trigger_error("$action: Unknown action", E_USER_NOTICE);
544 function _deduceUsername() {
545 if (!empty($this->args['auth']) and !empty($this->args['auth']['userid']))
546 return $this->args['auth']['userid'];
548 if ($user = $this->getSessionVar('wiki_user')) {
549 // users might switch in a session between the two objects
550 // restore old auth level?
551 if (isa($user,WikiUserClassname()) and !empty($user->_level)) {
552 if (empty($this->_user)) {
553 $c = get_class($user);
554 $userid = $user->UserName();
556 $this->_user = new $c($userid);
558 $this->_user = new $c($this,$userid,$user->_level);
560 if ($user = UpgradeUser($this->_user,$user))
561 $this->_user = $user;
562 $this->_user->_authhow = 'session';
565 if (isa($user,WikiUserClassname()))
566 return $user->UserName();
568 if ($userid = $this->getCookieVar('WIKI_ID')) {
569 if (!empty($this->_user))
570 $this->_user->authhow = 'cookie';
576 function _isActionPage ($pagename) {
577 $dbi = $this->getDbh();
578 $page = $dbi->getPage($pagename);
579 $rev = $page->getCurrentRevision();
580 // FIXME: more restrictive check for sane plugin?
581 if (strstr($rev->getPackedContent(), '<?plugin'))
583 if (!$rev->hasDefaultContents())
584 trigger_error("$pagename: Does not appear to be an 'action page'", E_USER_NOTICE);
588 function findActionPage ($action) {
591 // check for translated version, as per users preferred language
592 // (or system default in case it is not en)
593 $translation = gettext($action);
595 if (isset($cache) and isset($cache[$translation]))
596 return $cache[$translation];
598 // check for cached translated version
599 if ($this->_isActionPage($translation))
600 return $cache[$action] = $translation;
602 // Allow for, e.g. action=LikePages
603 global $WikiNameRegexp;
604 if (!preg_match("/$WikiNameRegexp\\Z/A", $action))
605 return $cache[$action] = false;
607 // check for translated version (default language)
609 if ($LANG != DEFAULT_LANGUAGE and $LANG != "en") {
611 //trigger_error("DEBUG: findActionPage() ". DEFAULT_LANGUAGE." calling update_locale()...");
612 update_locale(DEFAULT_LANGUAGE);
613 $default = gettext($action);
614 //trigger_error("DEBUG: findActionPage() ". $save_lang." restoring save_lang, calling update_locale()...");
615 update_locale($save_lang);
616 if ($this->_isActionPage($default))
617 return $cache[$action] = $default;
620 $default = $translation;
623 // check for english version
624 if ($action != $translation and $action != $default) {
625 if ($this->_isActionPage($action))
626 return $cache[$action] = $action;
629 trigger_error("$action: Cannot find action page", E_USER_NOTICE);
630 return $cache[$action] = false;
633 function isActionPage ($pagename) {
634 return $this->findActionPage($pagename);
637 function action_browse () {
638 $this->buffer_output();
639 include_once("lib/display.php");
643 function action_verify () {
644 $this->action_browse();
647 function actionpage ($action) {
648 $this->buffer_output();
649 include_once("lib/display.php");
650 actionPage($this, $action);
653 function action_diff () {
654 $this->buffer_output();
655 include_once "lib/diff.php";
659 function action_search () {
660 // This is obsolete: reformulate URL and redirect.
661 // FIXME: this whole section should probably be deleted.
662 if ($this->getArg('searchtype') == 'full') {
663 $search_page = _("FullTextSearch");
666 $search_page = _("TitleSearch");
668 $this->redirect(WikiURL($search_page,
669 array('s' => $this->getArg('searchterm')),
673 function action_edit () {
674 $this->buffer_output();
675 include "lib/editpage.php";
676 $e = new PageEditor ($this);
680 function action_create () {
681 $this->action_edit();
684 function action_viewsource () {
685 $this->buffer_output();
686 include "lib/editpage.php";
687 $e = new PageEditor ($this);
691 function action_lock () {
692 $page = $this->getPage();
693 $page->set('locked', true);
694 $this->action_browse();
697 function action_unlock () {
698 // FIXME: This check is redundant.
699 //$user->requireAuth(WIKIAUTH_ADMIN);
700 $page = $this->getPage();
701 $page->set('locked', false);
702 $this->action_browse();
705 function action_remove () {
706 // FIXME: This check is redundant.
707 //$user->requireAuth(WIKIAUTH_ADMIN);
708 $pagename = $this->getArg('pagename');
709 if (strstr($pagename,_('PhpWikiAdministration'))) {
710 $this->action_browse();
712 include('lib/removepage.php');
718 function action_upload () {
719 include_once("lib/loadsave.php");
723 function action_xmlrpc () {
724 include_once("lib/XmlRpcServer.php");
725 $xmlrpc = new XmlRpcServer($this);
729 function action_zip () {
730 include_once("lib/loadsave.php");
732 // I don't think it hurts to add cruft at the end of the zip file.
733 echo "\n========================================================\n";
734 echo "PhpWiki " . PHPWIKI_VERSION . " source:\n$GLOBALS[RCS_IDS]\n";
737 function action_ziphtml () {
738 include_once("lib/loadsave.php");
739 MakeWikiZipHtml($this);
740 // I don't think it hurts to add cruft at the end of the zip file.
741 echo "\n========================================================\n";
742 echo "PhpWiki " . PHPWIKI_VERSION . " source:\n$GLOBALS[RCS_IDS]\n";
745 function action_dumpserial () {
746 include_once("lib/loadsave.php");
750 function action_dumphtml () {
751 include_once("lib/loadsave.php");
752 DumpHtmlToDir($this);
755 function action_loadfile () {
756 include_once("lib/loadsave.php");
757 LoadFileOrDir($this);
762 function is_safe_action ($action) {
763 return WikiRequest::requiredAuthorityForAction($action) < WIKIAUTH_ADMIN;
766 function validateSessionPath() {
767 // Try to defer any session.save_path PHP errors before any html
768 // is output, which causes some versions of IE to display a blank
769 // page (due to its strict mode while parsing a page?).
770 if (! is_writeable(ini_get('session.save_path'))) {
773 (sprintf(_("%s is not writable."),
774 _("The session.save_path directory"))
776 . sprintf(_("Please ensure that %s is writable, or redefine %s in index.php."),
777 sprintf(_("the directory '%s'"),
778 ini_get('session.save_path')),
781 . sprintf(_("Attempting to use the directory '%s' instead."),
784 if (! is_writeable($tmpdir)) {
786 (sprintf(_("%s is not writable."), $tmpdir)
788 . _("Users will not be able to sign in.")
792 ini_set('session.save_path', $tmpdir);
798 validateSessionPath();
802 $request = new WikiRequest();
805 * Allow for disabling of markup cache.
806 * (Mostly for debugging ... hopefully.)
808 * See also <?plugin WikiAdminUtils action=purge-cache ?>
810 if (!defined('WIKIDB_NOCACHE_MARKUP') and $request->getArg('nocache'))
811 define('WIKIDB_NOCACHE_MARKUP', $request->getArg('nocache'));
813 // Initialize with system defaults in case user not logged in.
814 // Should this go into constructor?
815 $request->initializeTheme();
817 $request->updateAuthAndPrefs();
818 // initialize again with user's prefs
819 $request->initializeTheme();
820 $request->initializeLang();
822 // Enable the output of most of the warning messages.
823 // The warnings will screw up zip files though.
824 global $ErrorManager;
825 if (substr($request->getArg('action'), 0, 3) != 'zip') {
826 $ErrorManager->setPostponedErrorMask(E_NOTICE|E_USER_NOTICE);
827 //$ErrorManager->setPostponedErrorMask(0);
831 //if ($user->is_authenticated())
832 // $LogEntry->user = $user->getId();
834 $request->possiblyDeflowerVirginWiki();
836 if(defined('WIKI_XMLRPC')) return;
838 $validators = array('wikiname' => WIKI_NAME,
839 'args' => hash($request->getArgs()),
840 'prefs' => hash($request->getPrefs()));
841 if (CACHE_CONTROL == 'STRICT') {
842 $dbi = $request->getDbh();
843 $timestamp = $dbi->getTimestamp();
844 $validators['mtime'] = $timestamp;
845 $validators['%mtime'] = (int)$timestamp;
847 // FIXME: we should try to generate strong validators when possible,
848 // but for now, our validator is weak, since equal validators do not
849 // indicate byte-level equality of content. (Due to DEBUG timing output, etc...)
851 // (If DEBUG if off, this may be a strong validator, but I'm going
852 // to go the paranoid route here pending further study and testing.)
854 $validators['%weak'] = true;
856 $request->setValidators($validators);
858 $request->handleAction();
860 if (defined('DEBUG') and DEBUG>1) phpinfo(INFO_VARIABLES);
868 // $Log: not supported by cvs2svn $
869 // Revision 1.105 2004/01/25 03:57:15 rurban
870 // WikiUserNew support (temp. ENABLE_USER_NEW constant)
872 // Revision 1.104 2003/12/26 06:41:16 carstenklapp
873 // Bugfix: Try to defer OS errors about session.save_path and ACCESS_LOG,
874 // so they don't prevent IE from partially (or not at all) rendering the
875 // page. This should help a little for the IE user who encounters trouble
876 // when setting up a new PhpWiki for the first time.
878 // Revision 1.103 2003/12/02 00:10:00 carstenklapp
879 // Bugfix: Ongoing work to untangle UserPreferences/WikiUser/request code
880 // mess: UserPreferences should take effect immediately now upon signing
883 // Revision 1.102 2003/11/25 22:55:32 carstenklapp
884 // Localization bugfix: For wikis where English is not the default system
885 // language, make sure that the authority error message (i.e. "You must
886 // sign in to edit pages in this wiki" etc.) is displayed in the wiki's
887 // default language. Previously it would always display in English.
888 // (Added call to update_locale() before displaying any messages prior to
889 // the login prompt.)
891 // Revision 1.101 2003/11/25 21:49:44 carstenklapp
892 // Bugfix: For a non-english wiki or when the user's preference is not
893 // english, the wiki would always use the english ActionPage first if it
894 // was present rather than the appropriate localised variant. (PhpWikis
895 // running only in english or Wikis running ONLY without any english
896 // ActionPages would not notice this bug, only when both english and
897 // localised ActionPages were in the DB.) Now we check for the localised
900 // Revision 1.100 2003/11/18 16:54:18 carstenklapp
901 // Reformatting only: Tabs to spaces, added rcs log.
909 // c-hanging-comment-ender-p: nil
910 // indent-tabs-mode: nil