2 rcs_id('$Id: main.php,v 1.112 2004-02-09 03:58:12 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');
9 require_once('lib/WikiDB.php');
11 require_once("lib/WikiUserNew.php");
13 require_once("lib/WikiUser.php");
14 require_once("lib/WikiGroup.php");
15 require_once("lib/PagePerm.php");
17 class WikiRequest extends Request {
20 function WikiRequest () {
21 $this->_dbi = WikiDB::open($GLOBALS['DBParams']);
24 include_once('lib/DB_Session.php');
25 $prefix = isset($GLOBALS['DBParams']['prefix']) ? $GLOBALS['DBParams']['prefix'] : '';
26 $this->_dbsession = & new DB_Session($this->getDbh(),
27 $prefix . $GLOBALS['DBParams']['db_session_table']);
33 $this->setArg('pagename', $this->_deducePagename());
34 $this->setArg('action', $this->_deduceAction());
36 // Restore auth state. This doesn't check for proper authorization!
37 if (ENABLE_USER_NEW) {
38 $userid = $this->_deduceUsername();
39 if (isset($this->_user) and $this->_user->_authhow == 'session') {
40 // users might switch in a session between the two objects.
41 // restore old auth level here or in updateAuthAndPrefs?
42 $user = $this->getSessionVar('wiki_user');
43 if (isa($user,WikiUserClassname()) and !empty($user->_level)) {
46 if (empty($this->_user)) {
47 $c = get_class($user);
48 $userid = $user->UserName();
49 $this->_user = new $c($userid);
51 if ($user = UpgradeUser($this->_user,$user))
55 $user = UpgradeUser($this->_user,$user);
57 $this->_prefs = $this->_user->_prefs;
59 $user = WikiUser($userid);
60 //Todo: upgrade later at updateAuthAndPrefs()
61 if (isset($this->_user))
62 $user = UpgradeUser($this->_user,$user);
64 $this->_prefs = $this->_user->_prefs;
67 // no upgrade from session
68 $this->_user = new WikiUser($this, $this->_deduceUsername());
69 $this->_prefs = $this->_user->getPreferences();
73 function initializeLang () {
74 if ($user_lang = $this->getPref('lang')) {
75 //trigger_error("DEBUG: initializeLang() ". $user_lang ." calling update_locale()...");
76 update_locale($user_lang);
80 function initializeTheme () {
84 if ($user_theme = $this->getPref('theme'))
85 include_once("themes/$user_theme/themeinfo.php");
86 if (empty($Theme) and defined ('THEME'))
87 include_once("themes/" . THEME . "/themeinfo.php");
89 include_once("themes/default/themeinfo.php");
90 assert(!empty($Theme));
94 // This really maybe should be part of the constructor, but since it
95 // may involve HTML/template output, the global $request really needs
96 // to be initialized before we do this stuff.
97 function updateAuthAndPrefs () {
99 // Handle preference updates, and authentication requests, if any.
100 if ($new_prefs = $this->getArg('pref')) {
101 $this->setArg('pref', false);
102 if ($this->isPost() and !empty($new_prefs['passwd']) and
103 ($new_prefs['passwd2'] != $new_prefs['passwd'])) {
105 $this->_prefs->set('passwd','');
106 // $this->_prefs->set('passwd2',''); // This is not stored anyway
109 foreach ($new_prefs as $key => $val) {
110 if ($key == 'passwd') {
112 $val = crypt('passwd');
114 $this->_prefs->set($key, $val);
118 // FIXME: need to move authentication request processing
119 // up to be before pref request processing, I think,
120 // since logging in may change which preferences
121 // we're talking about...
123 // even we have disallow anon users?
124 // if (! $this->_user ) $this->_user = new _AnonUser();
126 // Handle authentication request, if any.
127 if ($auth_args = $this->getArg('auth')) {
128 $this->setArg('auth', false);
129 $this->_handleAuthRequest($auth_args); // possible NORETURN
131 elseif ( ! $this->_user or ! $this->_user->isSignedIn() ) {
132 // If not auth request, try to sign in as saved user.
133 if (($saved_user = $this->getPref('userid')) != false) {
134 $this->_signIn($saved_user);
138 // Save preferences in session and cookie
139 if (isset($this->_user) and
140 (!isset($this->_user->_authhow) or $this->_user->_authhow != 'session')) {
142 $this->_user->setPreferences($this->_prefs, $id_only);
144 $this->setSessionVar('wiki_user', $this->_user);
145 $this->setSessionVar('wiki_prefs', $this->_prefs);
148 // Ensure user has permissions for action
149 $require_level = $this->requiredAuthority($this->getArg('action'));
150 if (! $this->_user->hasAuthority($require_level))
151 $this->_notAuthorized($require_level); // NORETURN
154 function getUser () {
158 function getPrefs () {
159 return $this->_prefs;
162 // Convenience function:
163 function getPref ($key) {
164 if (isset($this->_prefs))
165 return $this->_prefs->get($key);
173 * Get requested page from the page database.
174 * By default it will grab the page requested via the URL
176 * This is a convenience function.
177 * @param string $pagename Name of page to get.
178 * @return WikiDB_Page Object with methods to pull data from
179 * database for the page requested.
181 function getPage ($pagename = false) {
182 if (!isset($this->_dbi))
185 $pagename = $this->getArg('pagename');
186 return $this->_dbi->getPage($pagename);
189 /** Get URL for POST actions.
191 * Officially, we should just use SCRIPT_NAME (or some such),
192 * but that causes problems when we try to issue a redirect, e.g.
193 * after saving a page.
195 * Some browsers (at least NS4 and Mozilla 0.97 won't accept
196 * a redirect from a page to itself.)
198 * So, as a HACK, we include pagename and action as query args in
199 * the URL. (These should be ignored when we receive the POST
202 function getPostURL ($pagename=false) {
203 if ($pagename === false)
204 $pagename = $this->getArg('pagename');
205 $action = $this->getArg('action');
206 if ($this->getArg('start_debug')) // zend ide support
207 return WikiURL($pagename, array('action' => $action, 'start_debug' => 1));
209 return WikiURL($pagename, array('action' => $action));
212 function _handleAuthRequest ($auth_args) {
213 if (!is_array($auth_args))
216 // Ignore password unless POST'ed.
217 if (!$this->isPost())
218 unset($auth_args['passwd']);
220 $olduser = $this->_user;
221 $user = $this->_user->AuthCheck($auth_args);
222 if (isa($user,WikiUserClassname())) {
223 // Successful login (or logout.)
224 $this->_setUser($user);
226 elseif (is_string($user)) {
227 // Login attempt failed.
228 $fail_message = $user;
229 $auth_args['pass_required'] = true;
230 // If no password was submitted, it's not really
231 // a failure --- just need to prompt for password...
232 if (!isset($auth_args['passwd'])) {
233 //$auth_args['pass_required'] = false;
234 $fail_message = false;
236 $olduser->PrintLoginForm($this, $auth_args, $fail_message);
237 $this->finish(); //NORETURN
240 // Login request cancelled.
245 * Attempt to sign in (bogo-login).
249 * @param $userid string Userid to attempt to sign in as.
252 function _signIn ($userid) {
253 if (ENABLE_USER_NEW) {
255 $this->_user = new _BogoUser($userid);
257 $this->_user = new _PassUser($userid);
259 $user = $this->_user->AuthCheck(array('userid' => $userid));
260 if (isa($user,WikiUserClassname())) {
261 $this->_setUser($user); // success!
265 // login or logout or restore state
266 function _setUser ($user) {
267 $this->_user = $user;
268 $this->setCookieVar('WIKI_ID', $user->getAuthenticatedId(), 365);
269 $this->setSessionVar('wiki_user', $user);
270 if ($user->isSignedIn())
271 $user->_authhow = 'signin';
273 // Save userid to prefs..
274 if (!($this->_prefs = $this->_user->getPreferences()))
275 $this->_prefs = $this->_user->_prefs;
276 $this->_prefs->set('userid',
277 $user->isSignedIn() ? $user->getId() : '');
280 /* Permission system */
282 function _notAuthorized ($require_level) {
283 // Display the authority message in the Wiki's default
284 // language, in case it is not english.
286 // Note that normally a user will not see such an error once
287 // logged in, unless the admin has altered the default
288 // disallowed wikiactions. In that case we should probably
289 // check the user's language prefs too at this point; this
290 // would be a situation which is not really handled with the
292 update_locale(DEFAULT_LANGUAGE);
294 // User does not have required authority. Prompt for login.
295 $what = $this->getActionDescription($this->getArg('action'));
297 if ($require_level == WIKIAUTH_FORBIDDEN) {
298 $this->finish(fmt("%s is disallowed on this wiki.",
299 $this->getDisallowedActionDescription($this->getArg('action'))));
301 elseif ($require_level == WIKIAUTH_BOGO)
302 $msg = fmt("You must sign in to %s.", $what);
303 elseif ($require_level == WIKIAUTH_USER)
304 $msg = fmt("You must log in to %s.", $what);
306 $msg = fmt("You must be an administrator to %s.", $what);
307 $pass_required = ($require_level >= WIKIAUTH_USER);
309 $this->_user->PrintLoginForm($this, compact('require_level','pass_required'), $msg);
310 $this->finish(); // NORETURN
313 // Fixme: for PagePermissions we'll need other strings,
314 // relevant to the requested page, not just for the action on the whole wiki.
315 function getActionDescription($action) {
316 static $actionDescriptions;
317 if (! $actionDescriptions) {
319 = array('browse' => _("browse pages in this wiki"),
320 'diff' => _("diff pages in this wiki"),
321 'dumphtml' => _("dump html pages from this wiki"),
322 'dumpserial' => _("dump serial pages from this wiki"),
323 'edit' => _("edit pages in this wiki"),
324 'create' => _("create pages in this wiki"),
325 'loadfile' => _("load files into this wiki"),
326 'lock' => _("lock pages in this wiki"),
327 'remove' => _("remove pages from this wiki"),
328 'unlock' => _("unlock pages in this wiki"),
329 'upload' => _("upload a zip dump to this wiki"),
330 'verify' => _("verify the current action"),
331 'viewsource' => _("view the source of pages in this wiki"),
332 'xmlrpc' => _("access this wiki via XML-RPC"),
333 'zip' => _("download a zip dump from this wiki"),
334 'ziphtml' => _("download an html zip dump from this wiki")
337 if (in_array($action, array_keys($actionDescriptions)))
338 return $actionDescriptions[$action];
342 function getDisallowedActionDescription($action) {
343 static $disallowedActionDescriptions;
344 if (! $disallowedActionDescriptions) {
345 $disallowedActionDescriptions
346 = array('browse' => _("Browsing pages"),
347 'diff' => _("Diffing pages"),
348 'dumphtml' => _("Dumping html pages"),
349 'dumpserial' => _("Dumping serial pages"),
350 'edit' => _("Editing pages"),
351 'create' => _("Creating pages"),
352 'loadfile' => _("Loading files"),
353 'lock' => _("Locking pages"),
354 'remove' => _("Removing pages"),
355 'unlock' => _("Unlocking pages"),
356 'upload' => _("Uploading zip dumps"),
357 'verify' => _("Verify the current action"),
358 'viewsource' => _("Viewing the source of pages"),
359 'xmlrpc' => _("XML-RPC access"),
360 'zip' => _("Downloading zip dumps"),
361 'ziphtml' => _("Downloading html zip dumps")
364 if (in_array($action, array_keys($disallowedActionDescriptions)))
365 return $disallowedActionDescriptions[$action];
370 function requiredAuthority ($action) {
371 $auth = $this->requiredAuthorityForAction($action);
374 * This is a hook for plugins to require authority
375 * for posting to them.
377 * IMPORTANT: this is not a secure check, so the plugin
378 * may not assume that any POSTs to it are authorized.
379 * All this does is cause PhpWiki to prompt for login
380 * if the user doesn't have the required authority.
382 if ($this->isPost()) {
383 $post_auth = $this->getArg('require_authority_for_post');
384 if ($post_auth !== false)
385 $auth = max($auth, $post_auth);
390 function requiredAuthorityForAction ($action) {
392 // Todo: Check individual page permissions instead.
400 return WIKIAUTH_ANON;
404 if (defined('ZIPDUMP_AUTH') && ZIPDUMP_AUTH)
405 return WIKIAUTH_ADMIN;
406 return WIKIAUTH_ANON;
409 if (defined('REQUIRE_SIGNIN_BEFORE_EDIT') && REQUIRE_SIGNIN_BEFORE_EDIT)
410 return WIKIAUTH_BOGO;
411 return WIKIAUTH_ANON;
412 // return WIKIAUTH_BOGO;
415 $page = $this->getPage();
416 $current = $page->getCurrentRevision();
417 if ($current->hasDefaultContents())
418 return $this->requiredAuthorityForAction('edit');
419 return $this->requiredAuthorityForAction('browse');
428 return WIKIAUTH_ADMIN;
430 global $WikiNameRegexp;
431 if (preg_match("/$WikiNameRegexp\Z/A", $action))
432 return WIKIAUTH_ANON; // ActionPage.
434 return WIKIAUTH_ADMIN;
437 /* End of Permission system */
439 function possiblyDeflowerVirginWiki () {
440 if ($this->getArg('action') != 'browse')
442 if ($this->getArg('pagename') != HOME_PAGE)
445 $page = $this->getPage();
446 $current = $page->getCurrentRevision();
447 if ($current->getVersion() > 0)
448 return; // Homepage exists.
450 include('lib/loadsave.php');
452 $this->finish(); // NORETURN
455 function handleAction () {
456 $action = $this->getArg('action');
457 $method = "action_$action";
458 if (method_exists($this, $method)) {
461 elseif ($page = $this->findActionPage($action)) {
462 $this->actionpage($page);
465 $this->finish(fmt("%s: Bad action", $action));
469 function finish ($errormsg = false) {
473 exit(); // just in case CloseDataBase calls us
476 if (!empty($this->_dbi))
477 $this->_dbi->close();
481 global $ErrorManager;
482 $ErrorManager->flushPostponedErrors();
484 if (!empty($errormsg)) {
487 HTML::h2(_("Fatal PhpWiki Error")),
490 echo "\n</body></html>";
497 function _deducePagename () {
498 if ($this->getArg('pagename'))
499 return $this->getArg('pagename');
502 $pathinfo = $this->get('PATH_INFO');
503 $tail = substr($pathinfo, strlen(PATH_INFO_PREFIX));
505 if ($tail && $pathinfo == PATH_INFO_PREFIX . $tail) {
509 elseif ($this->isPost()) {
511 * In general, for security reasons, HTTP_GET_VARS should be ignored
512 * on POST requests, but we make an exception here (only for pagename).
514 * The justifcation for this hack is the following
515 * asymmetry: When POSTing with USE_PATH_INFO set, the
516 * pagename can (and should) be communicated through the
517 * request URL via PATH_INFO. When POSTing with
518 * USE_PATH_INFO off, this cannot be done --- the only way
519 * to communicate the pagename through the URL is via
520 * QUERY_ARGS (HTTP_GET_VARS).
522 global $HTTP_GET_VARS;
523 if (isset($HTTP_GET_VARS['pagename'])) {
524 return $HTTP_GET_VARS['pagename'];
529 * Support for PhpWiki 1.2 style requests.
531 $query_string = $this->get('QUERY_STRING');
532 if (preg_match('/^[^&=]+$/', $query_string)) {
533 return urldecode($query_string);
539 function _deduceAction () {
540 if (!($action = $this->getArg('action'))) {
541 // Detect XML-RPC requests
543 && $this->get('CONTENT_TYPE') == 'text/xml') {
544 global $HTTP_RAW_POST_DATA;
545 if (strstr($HTTP_RAW_POST_DATA, '<methodCall>')) {
550 return 'browse'; // Default if no action specified.
553 if (method_exists($this, "action_$action"))
556 // Allow for, e.g. action=LikePages
557 if ($this->isActionPage($action))
560 trigger_error("$action: Unknown action", E_USER_NOTICE);
564 function _deduceUsername() {
565 if (!empty($this->args['auth']) and !empty($this->args['auth']['userid']))
566 return $this->args['auth']['userid'];
568 if ($user = $this->getSessionVar('wiki_user')) {
569 $this->_user = $user;
570 $this->_user->_authhow = 'session';
571 return $user->UserName();
573 if ($userid = $this->getCookieVar('WIKI_ID')) {
574 if (!empty($this->_user))
575 $this->_user->authhow = 'cookie';
581 function _isActionPage ($pagename) {
582 $dbi = $this->getDbh();
583 $page = $dbi->getPage($pagename);
584 $rev = $page->getCurrentRevision();
585 // FIXME: more restrictive check for sane plugin?
586 if (strstr($rev->getPackedContent(), '<?plugin'))
588 if (!$rev->hasDefaultContents())
589 trigger_error("$pagename: Does not appear to be an 'action page'", E_USER_NOTICE);
593 function findActionPage ($action) {
596 // check for translated version, as per users preferred language
597 // (or system default in case it is not en)
598 $translation = gettext($action);
600 if (isset($cache) and isset($cache[$translation]))
601 return $cache[$translation];
603 // check for cached translated version
604 if ($this->_isActionPage($translation))
605 return $cache[$action] = $translation;
607 // Allow for, e.g. action=LikePages
608 global $WikiNameRegexp;
609 if (!preg_match("/$WikiNameRegexp\\Z/A", $action))
610 return $cache[$action] = false;
612 // check for translated version (default language)
614 if ($LANG != DEFAULT_LANGUAGE and $LANG != "en") {
616 //trigger_error("DEBUG: findActionPage() ". DEFAULT_LANGUAGE." calling update_locale()...");
617 update_locale(DEFAULT_LANGUAGE);
618 $default = gettext($action);
619 //trigger_error("DEBUG: findActionPage() ". $save_lang." restoring save_lang, calling update_locale()...");
620 update_locale($save_lang);
621 if ($this->_isActionPage($default))
622 return $cache[$action] = $default;
625 $default = $translation;
628 // check for english version
629 if ($action != $translation and $action != $default) {
630 if ($this->_isActionPage($action))
631 return $cache[$action] = $action;
634 trigger_error("$action: Cannot find action page", E_USER_NOTICE);
635 return $cache[$action] = false;
638 function isActionPage ($pagename) {
639 return $this->findActionPage($pagename);
642 function action_browse () {
643 $this->buffer_output();
644 include_once("lib/display.php");
648 function action_verify () {
649 $this->action_browse();
652 function actionpage ($action) {
653 $this->buffer_output();
654 include_once("lib/display.php");
655 actionPage($this, $action);
658 function action_diff () {
659 $this->buffer_output();
660 include_once "lib/diff.php";
664 function action_search () {
665 // This is obsolete: reformulate URL and redirect.
666 // FIXME: this whole section should probably be deleted.
667 if ($this->getArg('searchtype') == 'full') {
668 $search_page = _("FullTextSearch");
671 $search_page = _("TitleSearch");
673 $this->redirect(WikiURL($search_page,
674 array('s' => $this->getArg('searchterm')),
678 function action_edit () {
679 $this->buffer_output();
680 include "lib/editpage.php";
681 $e = new PageEditor ($this);
685 function action_create () {
686 $this->action_edit();
689 function action_viewsource () {
690 $this->buffer_output();
691 include "lib/editpage.php";
692 $e = new PageEditor ($this);
696 function action_lock () {
697 $page = $this->getPage();
698 $page->set('locked', true);
699 $this->action_browse();
702 function action_unlock () {
703 // FIXME: This check is redundant.
704 //$user->requireAuth(WIKIAUTH_ADMIN);
705 $page = $this->getPage();
706 $page->set('locked', false);
707 $this->action_browse();
710 function action_remove () {
711 // FIXME: This check is redundant.
712 //$user->requireAuth(WIKIAUTH_ADMIN);
713 $pagename = $this->getArg('pagename');
714 if (strstr($pagename,_('PhpWikiAdministration'))) {
715 $this->action_browse();
717 include('lib/removepage.php');
723 function action_upload () {
724 include_once("lib/loadsave.php");
728 function action_xmlrpc () {
729 include_once("lib/XmlRpcServer.php");
730 $xmlrpc = new XmlRpcServer($this);
734 function action_zip () {
735 include_once("lib/loadsave.php");
737 // I don't think it hurts to add cruft at the end of the zip file.
738 echo "\n========================================================\n";
739 echo "PhpWiki " . PHPWIKI_VERSION . " source:\n$GLOBALS[RCS_IDS]\n";
742 function action_ziphtml () {
743 include_once("lib/loadsave.php");
744 MakeWikiZipHtml($this);
745 // I don't think it hurts to add cruft at the end of the zip file.
746 echo "\n========================================================\n";
747 echo "PhpWiki " . PHPWIKI_VERSION . " source:\n$GLOBALS[RCS_IDS]\n";
750 function action_dumpserial () {
751 include_once("lib/loadsave.php");
755 function action_dumphtml () {
756 include_once("lib/loadsave.php");
757 DumpHtmlToDir($this);
760 function action_loadfile () {
761 include_once("lib/loadsave.php");
762 LoadFileOrDir($this);
767 function is_safe_action ($action) {
768 return WikiRequest::requiredAuthorityForAction($action) < WIKIAUTH_ADMIN;
771 function validateSessionPath() {
772 // Try to defer any session.save_path PHP errors before any html
773 // is output, which causes some versions of IE to display a blank
774 // page (due to its strict mode while parsing a page?).
775 if (! is_writeable(ini_get('session.save_path'))) {
778 (sprintf(_("%s is not writable."),
779 _("The session.save_path directory"))
781 . sprintf(_("Please ensure that %s is writable, or redefine %s in index.php."),
782 sprintf(_("the directory '%s'"),
783 ini_get('session.save_path')),
786 . sprintf(_("Attempting to use the directory '%s' instead."),
789 if (! is_writeable($tmpdir)) {
791 (sprintf(_("%s is not writable."), $tmpdir)
793 . _("Users will not be able to sign in.")
797 ini_set('session.save_path', $tmpdir);
803 validateSessionPath();
807 $request = new WikiRequest();
810 * Allow for disabling of markup cache.
811 * (Mostly for debugging ... hopefully.)
813 * See also <?plugin WikiAdminUtils action=purge-cache ?>
815 if (!defined('WIKIDB_NOCACHE_MARKUP') and $request->getArg('nocache'))
816 define('WIKIDB_NOCACHE_MARKUP', $request->getArg('nocache'));
818 // Initialize with system defaults in case user not logged in.
819 // Should this go into constructor?
820 $request->initializeTheme();
822 $request->updateAuthAndPrefs();
823 // initialize again with user's prefs
824 $request->initializeTheme();
825 $request->initializeLang();
827 // Enable the output of most of the warning messages.
828 // The warnings will screw up zip files though.
829 global $ErrorManager;
830 if (substr($request->getArg('action'), 0, 3) != 'zip') {
831 $ErrorManager->setPostponedErrorMask(E_NOTICE|E_USER_NOTICE);
832 //$ErrorManager->setPostponedErrorMask(0);
836 //if ($user->is_authenticated())
837 // $LogEntry->user = $user->getId();
839 $request->possiblyDeflowerVirginWiki();
841 if(defined('WIKI_XMLRPC')) return;
843 $validators = array('wikiname' => WIKI_NAME,
844 'args' => hash($request->getArgs()),
845 'prefs' => hash($request->getPrefs()));
846 if (CACHE_CONTROL == 'STRICT') {
847 $dbi = $request->getDbh();
848 $timestamp = $dbi->getTimestamp();
849 $validators['mtime'] = $timestamp;
850 $validators['%mtime'] = (int)$timestamp;
852 // FIXME: we should try to generate strong validators when possible,
853 // but for now, our validator is weak, since equal validators do not
854 // indicate byte-level equality of content. (Due to DEBUG timing output, etc...)
856 // (If DEBUG if off, this may be a strong validator, but I'm going
857 // to go the paranoid route here pending further study and testing.)
859 $validators['%weak'] = true;
861 $request->setValidators($validators);
863 $request->handleAction();
865 if (defined('DEBUG') and DEBUG>1) phpinfo(INFO_VARIABLES);
873 // $Log: not supported by cvs2svn $
874 // Revision 1.111 2004/02/07 10:41:25 rurban
875 // fixed auth from session (still double code but works)
877 // fixed DbPassUser upgrade and policy=old
880 // Revision 1.110 2004/02/03 09:45:39 rurban
881 // LDAP cleanup, start of new Pref classes
883 // Revision 1.109 2004/01/30 19:57:58 rurban
884 // fixed DBAuthParams['pref_select']: wrong _auth_dbi object used.
886 // Revision 1.108 2004/01/28 14:34:14 rurban
887 // session table takes the common prefix
888 // + various minor stuff
889 // reallow password changing
891 // Revision 1.107 2004/01/27 23:23:39 rurban
892 // renamed ->Username => _userid for consistency
893 // renamed mayCheckPassword => mayCheckPass
894 // fixed recursion problem in WikiUserNew
895 // fixed bogo login (but not quite 100% ready yet, password storage)
897 // Revision 1.106 2004/01/26 09:17:49 rurban
898 // * changed stored pref representation as before.
899 // the array of objects is 1) bigger and 2)
900 // less portable. If we would import packed pref
901 // objects and the object definition was changed, PHP would fail.
902 // This doesn't happen with an simple array of non-default values.
903 // * use $prefs->retrieve and $prefs->store methods, where retrieve
904 // understands the interim format of array of objects also.
905 // * simplified $prefs->get() and fixed $prefs->set()
906 // * added $user->_userid and class '_WikiUser' portability functions
907 // * fixed $user object ->_level upgrading, mostly using sessions.
908 // this fixes yesterdays problems with loosing authorization level.
909 // * fixed WikiUserNew::checkPass to return the _level
910 // * fixed WikiUserNew::isSignedIn
911 // * added explodePageList to class PageList, support sortby arg
912 // * fixed UserPreferences for WikiUserNew
913 // * fixed WikiPlugin for empty defaults array
914 // * UnfoldSubpages: added pagename arg, renamed pages arg,
915 // removed sort arg, support sortby arg
917 // Revision 1.105 2004/01/25 03:57:15 rurban
918 // WikiUserNew support (temp. ENABLE_USER_NEW constant)
920 // Revision 1.104 2003/12/26 06:41:16 carstenklapp
921 // Bugfix: Try to defer OS errors about session.save_path and ACCESS_LOG,
922 // so they don't prevent IE from partially (or not at all) rendering the
923 // page. This should help a little for the IE user who encounters trouble
924 // when setting up a new PhpWiki for the first time.
926 // Revision 1.103 2003/12/02 00:10:00 carstenklapp
927 // Bugfix: Ongoing work to untangle UserPreferences/WikiUser/request code
928 // mess: UserPreferences should take effect immediately now upon signing
931 // Revision 1.102 2003/11/25 22:55:32 carstenklapp
932 // Localization bugfix: For wikis where English is not the default system
933 // language, make sure that the authority error message (i.e. "You must
934 // sign in to edit pages in this wiki" etc.) is displayed in the wiki's
935 // default language. Previously it would always display in English.
936 // (Added call to update_locale() before displaying any messages prior to
937 // the login prompt.)
939 // Revision 1.101 2003/11/25 21:49:44 carstenklapp
940 // Bugfix: For a non-english wiki or when the user's preference is not
941 // english, the wiki would always use the english ActionPage first if it
942 // was present rather than the appropriate localised variant. (PhpWikis
943 // running only in english or Wikis running ONLY without any english
944 // ActionPages would not notice this bug, only when both english and
945 // localised ActionPages were in the DB.) Now we check for the localised
948 // Revision 1.100 2003/11/18 16:54:18 carstenklapp
949 // Reformatting only: Tabs to spaces, added rcs log.
957 // c-hanging-comment-ender-p: nil
958 // indent-tabs-mode: nil