2 rcs_id('$Id: main.php,v 1.125 2004-03-14 16:30:52 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']);
23 include_once('lib/DB_Session.php');
24 $prefix = isset($GLOBALS['DBParams']['prefix']) ? $GLOBALS['DBParams']['prefix'] : '';
25 $this->_dbsession = & new DB_Session($this->getDbh(),
26 $prefix . $GLOBALS['DBParams']['db_session_table']);
28 // Fixme: Does pear reset the error mask to 1? We have to find the culprit
29 $x = error_reporting();
34 $this->setArg('pagename', $this->_deducePagename());
35 $this->setArg('action', $this->_deduceAction());
37 // Restore auth state. This doesn't check for proper authorization!
38 if (ENABLE_USER_NEW) {
39 $userid = $this->_deduceUsername();
40 if (isset($this->_user) and $this->_user->_authhow == 'session') {
41 // users might switch in a session between the two objects.
42 // restore old auth level here or in updateAuthAndPrefs?
43 $user = $this->getSessionVar('wiki_user');
44 // revive db handle, because these don't survive sessions
45 unset($this->_user->_HomePagehandle);
46 $this->_user->hasHomePage();
47 if (!isa($user,WikiUserClassname()) or empty($user->_level)) {
48 $user = UpgradeUser($this->_user,$user);
50 $this->_prefs = $this->_user->_prefs;
52 $user = WikiUser($userid);
53 //Todo: upgrade later at updateAuthAndPrefs()
54 if (isset($this->_user))
55 $user = UpgradeUser($this->_user,$user);
57 $this->_prefs = $this->_user->_prefs;
60 $this->_user = new WikiUser($this, $this->_deduceUsername());
61 $this->_prefs = $this->_user->getPreferences();
65 function initializeLang () {
66 if ($user_lang = $this->getPref('lang')) {
67 //trigger_error("DEBUG: initializeLang() ". $user_lang ." calling update_locale()...");
68 update_locale($user_lang);
69 FindLocalizedButtonFile(".",'missing_ok','reinit');
73 function initializeTheme () {
77 if ($user_theme = $this->getPref('theme'))
78 include_once("themes/$user_theme/themeinfo.php");
79 if (empty($Theme) and defined ('THEME'))
80 include_once("themes/" . THEME . "/themeinfo.php");
82 include_once("themes/default/themeinfo.php");
83 assert(!empty($Theme));
86 // This really maybe should be part of the constructor, but since it
87 // may involve HTML/template output, the global $request really needs
88 // to be initialized before we do this stuff.
89 function updateAuthAndPrefs () {
91 // Handle authentication request, if any.
92 if ($auth_args = $this->getArg('auth')) {
93 $this->setArg('auth', false);
94 $this->_handleAuthRequest($auth_args); // possible NORETURN
96 elseif ( ! $this->_user or ! $this->_user->isSignedIn() ) {
97 // If not auth request, try to sign in as saved user.
98 if (($saved_user = $this->getPref('userid')) != false) {
99 $this->_signIn($saved_user);
103 // Save preferences in session and cookie
104 if (isset($this->_user) and
105 (!isset($this->_user->_authhow) or $this->_user->_authhow != 'session')) {
107 $this->_user->setPreferences($this->_prefs, $id_only);
109 $this->setSessionVar('wiki_user', $this->_user);
110 //$this->setSessionVar('wiki_prefs', $this->_prefs);
113 // Ensure user has permissions for action
114 $require_level = $this->requiredAuthority($this->getArg('action'));
115 if (! $this->_user->hasAuthority($require_level))
116 $this->_notAuthorized($require_level); // NORETURN
119 function getUser () {
123 function getPrefs () {
124 return $this->_prefs;
127 // Convenience function:
128 function getPref ($key) {
129 if (isset($this->_prefs))
130 return $this->_prefs->get($key);
138 * Get requested page from the page database.
139 * By default it will grab the page requested via the URL
141 * This is a convenience function.
142 * @param string $pagename Name of page to get.
143 * @return WikiDB_Page Object with methods to pull data from
144 * database for the page requested.
146 function getPage ($pagename = false) {
147 if (!isset($this->_dbi))
150 $pagename = $this->getArg('pagename');
151 return $this->_dbi->getPage($pagename);
154 /** Get URL for POST actions.
156 * Officially, we should just use SCRIPT_NAME (or some such),
157 * but that causes problems when we try to issue a redirect, e.g.
158 * after saving a page.
160 * Some browsers (at least NS4 and Mozilla 0.97 won't accept
161 * a redirect from a page to itself.)
163 * So, as a HACK, we include pagename and action as query args in
164 * the URL. (These should be ignored when we receive the POST
167 function getPostURL ($pagename=false) {
168 if ($pagename === false)
169 $pagename = $this->getArg('pagename');
170 $action = $this->getArg('action');
171 if (!empty($_GET['start_debug'])) // zend ide support
172 return WikiURL($pagename, array('action' => $action, 'start_debug' => 1));
174 return WikiURL($pagename, array('action' => $action));
177 function _handleAuthRequest ($auth_args) {
178 if (!is_array($auth_args))
181 // Ignore password unless POST'ed.
182 if (!$this->isPost())
183 unset($auth_args['passwd']);
185 $olduser = $this->_user;
186 $user = $this->_user->AuthCheck($auth_args);
187 if (isa($user,WikiUserClassname())) {
188 // Successful login (or logout.)
189 $this->_setUser($user);
191 elseif (is_string($user)) {
192 // Login attempt failed.
193 $fail_message = $user;
194 $auth_args['pass_required'] = true;
195 // If no password was submitted, it's not really
196 // a failure --- just need to prompt for password...
197 if (!isset($auth_args['passwd'])) {
198 //$auth_args['pass_required'] = false;
199 $fail_message = false;
201 $olduser->PrintLoginForm($this, $auth_args, $fail_message);
202 $this->finish(); //NORETURN
205 // Login request cancelled.
210 * Attempt to sign in (bogo-login).
214 * @param $userid string Userid to attempt to sign in as.
217 function _signIn ($userid) {
218 if (ENABLE_USER_NEW) {
220 $this->_user = new _BogoUser($userid);
222 $this->_user = new _PassUser($userid);
224 $user = $this->_user->AuthCheck(array('userid' => $userid));
225 if (isa($user,WikiUserClassname())) {
226 $this->_setUser($user); // success!
230 // login or logout or restore state
231 function _setUser ($user) {
232 $this->_user = $user;
233 $this->setCookieVar('WIKI_ID', $user->getAuthenticatedId(), 365);
234 $this->setSessionVar('wiki_user', $user);
235 if ($user->isSignedIn())
236 $user->_authhow = 'signin';
238 // Save userid to prefs..
239 if (!($this->_prefs = $this->_user->getPreferences()))
240 $this->_prefs = $this->_user->_prefs;
241 $this->_prefs->set('userid',
242 $user->isSignedIn() ? $user->getId() : '');
243 $this->initializeTheme();
246 /* Permission system */
248 function _notAuthorized ($require_level) {
249 // Display the authority message in the Wiki's default
250 // language, in case it is not english.
252 // Note that normally a user will not see such an error once
253 // logged in, unless the admin has altered the default
254 // disallowed wikiactions. In that case we should probably
255 // check the user's language prefs too at this point; this
256 // would be a situation which is not really handled with the
258 update_locale(DEFAULT_LANGUAGE);
260 // User does not have required authority. Prompt for login.
261 $what = $this->getActionDescription($this->getArg('action'));
263 if ($require_level == WIKIAUTH_FORBIDDEN) {
264 $this->finish(fmt("%s is disallowed on this wiki.",
265 $this->getDisallowedActionDescription($this->getArg('action'))));
267 elseif ($require_level == WIKIAUTH_BOGO)
268 $msg = fmt("You must sign in to %s.", $what);
269 elseif ($require_level == WIKIAUTH_USER)
270 $msg = fmt("You must log in to %s.", $what);
272 $msg = fmt("You must be an administrator to %s.", $what);
273 $pass_required = ($require_level >= WIKIAUTH_USER);
275 $this->_user->PrintLoginForm($this, compact('require_level','pass_required'), $msg);
276 $this->finish(); // NORETURN
279 // Fixme: for PagePermissions we'll need other strings,
280 // relevant to the requested page, not just for the action on the whole wiki.
281 function getActionDescription($action) {
282 static $actionDescriptions;
283 if (! $actionDescriptions) {
285 = array('browse' => _("view this page"),
286 'diff' => _("diff this page"),
287 'dumphtml' => _("dump html pages"),
288 'dumpserial' => _("dump serial pages"),
289 'edit' => _("edit this page"),
290 'create' => _("create this page"),
291 'loadfile' => _("load files into this wiki"),
292 'lock' => _("lock this page"),
293 'remove' => _("remove this page"),
294 'unlock' => _("unlock this page"),
295 'upload' => _("upload a zip dump"),
296 'verify' => _("verify the current action"),
297 'viewsource' => _("view the source of this page"),
298 'xmlrpc' => _("access this wiki via XML-RPC"),
299 'zip' => _("download a zip dump from this wiki"),
300 'ziphtml' => _("download an html zip dump from this wiki")
303 if (in_array($action, array_keys($actionDescriptions)))
304 return $actionDescriptions[$action];
308 function getDisallowedActionDescription($action) {
309 static $disallowedActionDescriptions;
310 if (! $disallowedActionDescriptions) {
311 $disallowedActionDescriptions
312 = array('browse' => _("Browsing pages"),
313 'diff' => _("Diffing pages"),
314 'dumphtml' => _("Dumping html pages"),
315 'dumpserial' => _("Dumping serial pages"),
316 'edit' => _("Editing pages"),
317 'create' => _("Creating pages"),
318 'loadfile' => _("Loading files"),
319 'lock' => _("Locking pages"),
320 'remove' => _("Removing pages"),
321 'unlock' => _("Unlocking pages"),
322 'upload' => _("Uploading zip dumps"),
323 'verify' => _("Verify the current action"),
324 'viewsource' => _("Viewing the source of pages"),
325 'xmlrpc' => _("XML-RPC access"),
326 'zip' => _("Downloading zip dumps"),
327 'ziphtml' => _("Downloading html zip dumps")
330 if (in_array($action, array_keys($disallowedActionDescriptions)))
331 return $disallowedActionDescriptions[$action];
336 function requiredAuthority ($action) {
337 $auth = $this->requiredAuthorityForAction($action);
338 if (!ALLOW_ANON_USER) return WIKIAUTH_USER;
341 * This is a hook for plugins to require authority
342 * for posting to them.
344 * IMPORTANT: this is not a secure check, so the plugin
345 * may not assume that any POSTs to it are authorized.
346 * All this does is cause PhpWiki to prompt for login
347 * if the user doesn't have the required authority.
349 if ($this->isPost()) {
350 $post_auth = $this->getArg('require_authority_for_post');
351 if ($post_auth !== false)
352 $auth = max($auth, $post_auth);
357 function requiredAuthorityForAction ($action) {
358 if (class_exists("PagePermission")) {
359 return requiredAuthorityForPage($action);
369 return WIKIAUTH_ANON;
373 if (defined('ZIPDUMP_AUTH') && ZIPDUMP_AUTH)
374 return WIKIAUTH_ADMIN;
375 return WIKIAUTH_ANON;
378 if (defined('REQUIRE_SIGNIN_BEFORE_EDIT') && REQUIRE_SIGNIN_BEFORE_EDIT)
379 return WIKIAUTH_BOGO;
380 return WIKIAUTH_ANON;
381 // return WIKIAUTH_BOGO;
384 $page = $this->getPage();
385 $current = $page->getCurrentRevision();
386 if ($current->hasDefaultContents())
387 return $this->requiredAuthorityForAction('edit');
388 return $this->requiredAuthorityForAction('browse');
398 return WIKIAUTH_ADMIN;
400 global $WikiNameRegexp;
401 if (preg_match("/$WikiNameRegexp\Z/A", $action))
402 return WIKIAUTH_ANON; // ActionPage.
404 return WIKIAUTH_ADMIN;
408 /* End of Permission system */
410 function possiblyDeflowerVirginWiki () {
411 if ($this->getArg('action') != 'browse')
413 if ($this->getArg('pagename') != HOME_PAGE)
416 $page = $this->getPage();
417 $current = $page->getCurrentRevision();
418 if ($current->getVersion() > 0)
419 return; // Homepage exists.
421 include('lib/loadsave.php');
423 $this->finish(); // NORETURN
426 function handleAction () {
427 $action = $this->getArg('action');
428 $method = "action_$action";
429 if (method_exists($this, $method)) {
432 elseif ($page = $this->findActionPage($action)) {
433 $this->actionpage($page);
436 $this->finish(fmt("%s: Bad action", $action));
440 function finish ($errormsg = false) {
444 exit(); // just in case CloseDataBase calls us
447 if (!empty($this->_dbi))
448 $this->_dbi->close();
452 global $ErrorManager;
453 $ErrorManager->flushPostponedErrors();
455 if (!empty($errormsg)) {
458 HTML::h2(_("Fatal PhpWiki Error")),
461 echo "\n</body></html>";
468 function _deducePagename () {
469 if ($this->getArg('pagename'))
470 return $this->getArg('pagename');
473 $pathinfo = $this->get('PATH_INFO');
474 $tail = substr($pathinfo, strlen(PATH_INFO_PREFIX));
476 if ($tail && $pathinfo == PATH_INFO_PREFIX . $tail) {
480 elseif ($this->isPost()) {
482 * In general, for security reasons, HTTP_GET_VARS should be ignored
483 * on POST requests, but we make an exception here (only for pagename).
485 * The justifcation for this hack is the following
486 * asymmetry: When POSTing with USE_PATH_INFO set, the
487 * pagename can (and should) be communicated through the
488 * request URL via PATH_INFO. When POSTing with
489 * USE_PATH_INFO off, this cannot be done --- the only way
490 * to communicate the pagename through the URL is via
491 * QUERY_ARGS (HTTP_GET_VARS).
493 global $HTTP_GET_VARS;
494 if (isset($HTTP_GET_VARS['pagename'])) {
495 return $HTTP_GET_VARS['pagename'];
500 * Support for PhpWiki 1.2 style requests.
502 $query_string = $this->get('QUERY_STRING');
503 if (preg_match('/^[^&=]+$/', $query_string)) {
504 return urldecode($query_string);
510 function _deduceAction () {
511 if (!($action = $this->getArg('action'))) {
512 // Detect XML-RPC requests
514 && $this->get('CONTENT_TYPE') == 'text/xml') {
515 global $HTTP_RAW_POST_DATA;
516 if (strstr($HTTP_RAW_POST_DATA, '<methodCall>')) {
521 return 'browse'; // Default if no action specified.
524 if (method_exists($this, "action_$action"))
527 // Allow for, e.g. action=LikePages
528 if ($this->isActionPage($action))
531 trigger_error("$action: Unknown action", E_USER_NOTICE);
535 function _deduceUsername() {
536 if (!empty($this->args['auth']) and !empty($this->args['auth']['userid']))
537 return $this->args['auth']['userid'];
538 if (!empty($_SERVER['PHP_AUTH_USER']))
539 return $_SERVER['PHP_AUTH_USER'];
541 if ($user = $this->getSessionVar('wiki_user')) {
542 $this->_user = $user;
543 $this->_user->_authhow = 'session';
544 return ENABLE_USER_NEW ? $user->UserName() : $this->_user;
546 if ($userid = $this->getCookieVar('WIKI_ID')) {
547 if (!empty($this->_user))
548 $this->_user->authhow = 'cookie';
554 function _isActionPage ($pagename) {
555 $dbi = $this->getDbh();
556 $page = $dbi->getPage($pagename);
557 $rev = $page->getCurrentRevision();
558 // FIXME: more restrictive check for sane plugin?
559 if (strstr($rev->getPackedContent(), '<?plugin'))
561 if (!$rev->hasDefaultContents())
562 trigger_error("$pagename: Does not appear to be an 'action page'", E_USER_NOTICE);
566 function findActionPage ($action) {
569 // check for translated version, as per users preferred language
570 // (or system default in case it is not en)
571 $translation = gettext($action);
573 if (isset($cache) and isset($cache[$translation]))
574 return $cache[$translation];
576 // check for cached translated version
577 if ($this->_isActionPage($translation))
578 return $cache[$action] = $translation;
580 // Allow for, e.g. action=LikePages
581 global $WikiNameRegexp;
582 if (!preg_match("/$WikiNameRegexp\\Z/A", $action))
583 return $cache[$action] = false;
585 // check for translated version (default language)
587 if ($LANG != DEFAULT_LANGUAGE and $LANG != "en") {
589 //trigger_error("DEBUG: findActionPage() ". DEFAULT_LANGUAGE." calling update_locale()...");
590 update_locale(DEFAULT_LANGUAGE);
591 $default = gettext($action);
592 //trigger_error("DEBUG: findActionPage() ". $save_lang." restoring save_lang, calling update_locale()...");
593 update_locale($save_lang);
594 if ($this->_isActionPage($default))
595 return $cache[$action] = $default;
598 $default = $translation;
601 // check for english version
602 if ($action != $translation and $action != $default) {
603 if ($this->_isActionPage($action))
604 return $cache[$action] = $action;
607 trigger_error("$action: Cannot find action page", E_USER_NOTICE);
608 return $cache[$action] = false;
611 function isActionPage ($pagename) {
612 return $this->findActionPage($pagename);
615 function action_browse () {
616 $this->buffer_output();
617 include_once("lib/display.php");
621 function action_verify () {
622 $this->action_browse();
625 function actionpage ($action) {
626 $this->buffer_output();
627 include_once("lib/display.php");
628 actionPage($this, $action);
631 function action_diff () {
632 $this->buffer_output();
633 include_once "lib/diff.php";
637 function action_search () {
638 // This is obsolete: reformulate URL and redirect.
639 // FIXME: this whole section should probably be deleted.
640 if ($this->getArg('searchtype') == 'full') {
641 $search_page = _("FullTextSearch");
644 $search_page = _("TitleSearch");
646 $this->redirect(WikiURL($search_page,
647 array('s' => $this->getArg('searchterm')),
651 function action_edit () {
652 $this->buffer_output();
653 include "lib/editpage.php";
654 $e = new PageEditor ($this);
658 function action_create () {
659 $this->action_edit();
662 function action_viewsource () {
663 $this->buffer_output();
664 include "lib/editpage.php";
665 $e = new PageEditor ($this);
669 function action_lock () {
670 $page = $this->getPage();
671 $page->set('locked', true);
672 $this->action_browse();
675 function action_unlock () {
676 // FIXME: This check is redundant.
677 //$user->requireAuth(WIKIAUTH_ADMIN);
678 $page = $this->getPage();
679 $page->set('locked', false);
680 $this->action_browse();
683 function action_remove () {
684 // FIXME: This check is redundant.
685 //$user->requireAuth(WIKIAUTH_ADMIN);
686 $pagename = $this->getArg('pagename');
687 if (strstr($pagename,_('PhpWikiAdministration'))) {
688 $this->action_browse();
690 include('lib/removepage.php');
695 function action_xmlrpc () {
696 include_once("lib/XmlRpcServer.php");
697 $xmlrpc = new XmlRpcServer($this);
701 function action_zip () {
702 include_once("lib/loadsave.php");
704 // I don't think it hurts to add cruft at the end of the zip file.
705 echo "\n========================================================\n";
706 echo "PhpWiki " . PHPWIKI_VERSION . " source:\n$GLOBALS[RCS_IDS]\n";
709 function action_ziphtml () {
710 include_once("lib/loadsave.php");
711 MakeWikiZipHtml($this);
712 // I don't think it hurts to add cruft at the end of the zip file.
713 echo "\n========================================================\n";
714 echo "PhpWiki " . PHPWIKI_VERSION . " source:\n$GLOBALS[RCS_IDS]\n";
717 function action_dumpserial () {
718 include_once("lib/loadsave.php");
722 function action_dumphtml () {
723 include_once("lib/loadsave.php");
724 DumpHtmlToDir($this);
727 function action_upload () {
728 include_once("lib/loadsave.php");
732 function action_upgrade () {
733 include_once("lib/loadsave.php");
734 include_once("lib/upgrade.php");
738 function action_loadfile () {
739 include_once("lib/loadsave.php");
740 LoadFileOrDir($this);
745 function is_safe_action ($action) {
746 return WikiRequest::requiredAuthorityForAction($action) < WIKIAUTH_ADMIN;
749 function validateSessionPath() {
750 // Try to defer any session.save_path PHP errors before any html
751 // is output, which causes some versions of IE to display a blank
752 // page (due to its strict mode while parsing a page?).
753 if (! is_writeable(ini_get('session.save_path'))) {
756 (sprintf(_("%s is not writable."),
757 _("The session.save_path directory"))
759 . sprintf(_("Please ensure that %s is writable, or redefine %s in index.php."),
760 sprintf(_("the directory '%s'"),
761 ini_get('session.save_path')),
764 . sprintf(_("Attempting to use the directory '%s' instead."),
767 if (! is_writeable($tmpdir)) {
769 (sprintf(_("%s is not writable."), $tmpdir)
771 . _("Users will not be able to sign in.")
775 ini_set('session.save_path', $tmpdir);
781 validateSessionPath();
785 $request = new WikiRequest();
788 * Allow for disabling of markup cache.
789 * (Mostly for debugging ... hopefully.)
791 * See also <?plugin WikiAdminUtils action=purge-cache ?>
793 if (!defined('WIKIDB_NOCACHE_MARKUP') and $request->getArg('nocache'))
794 define('WIKIDB_NOCACHE_MARKUP', $request->getArg('nocache'));
796 // Initialize with system defaults in case user not logged in.
797 // Should this go into constructor?
798 $request->initializeTheme();
800 $request->updateAuthAndPrefs();
801 $request->initializeLang();
803 // Enable the output of most of the warning messages.
804 // The warnings will screw up zip files though.
805 global $ErrorManager;
806 if (substr($request->getArg('action'), 0, 3) != 'zip') {
807 $ErrorManager->setPostponedErrorMask(E_NOTICE|E_USER_NOTICE);
808 //$ErrorManager->setPostponedErrorMask(0);
812 //if ($user->is_authenticated())
813 // $LogEntry->user = $user->getId();
815 $request->possiblyDeflowerVirginWiki();
817 if (defined('WIKI_XMLRPC') and WIKI_XMLRPC) return;
818 if (defined('WIKI_SOAP') and WIKI_SOAP) return;
820 $validators = array('wikiname' => WIKI_NAME,
821 'args' => hash($request->getArgs()),
822 'prefs' => hash($request->getPrefs()));
823 if (CACHE_CONTROL == 'STRICT') {
824 $dbi = $request->getDbh();
825 $timestamp = $dbi->getTimestamp();
826 $validators['mtime'] = $timestamp;
827 $validators['%mtime'] = (int)$timestamp;
829 // FIXME: we should try to generate strong validators when possible,
830 // but for now, our validator is weak, since equal validators do not
831 // indicate byte-level equality of content. (Due to DEBUG timing output, etc...)
833 // (If DEBUG if off, this may be a strong validator, but I'm going
834 // to go the paranoid route here pending further study and testing.)
836 $validators['%weak'] = true;
838 $request->setValidators($validators);
840 $request->handleAction();
842 if (defined('DEBUG') and DEBUG & 4) phpinfo(INFO_VARIABLES);
846 $x = error_reporting(); // why is it 1 here? should be E_ALL
847 error_reporting(E_ALL);
851 // $Log: not supported by cvs2svn $
852 // Revision 1.124 2004/03/12 15:48:07 rurban
853 // fixed explodePageList: wrong sortby argument order in UnfoldSubpages
854 // simplified lib/stdlib.php:explodePageList
856 // Revision 1.123 2004/03/10 15:41:27 rurban
857 // use default pref mysql table
859 // Revision 1.122 2004/03/08 18:17:09 rurban
860 // added more WikiGroup::getMembersOf methods, esp. for special groups
861 // fixed $LDAP_SET_OPTIONS
862 // fixed _AuthInfo group methods
864 // Revision 1.121 2004/03/01 13:48:45 rurban
866 // p[] consistency fix
868 // Revision 1.120 2004/03/01 10:22:41 rurban
869 // initializeTheme optimize
871 // Revision 1.119 2004/02/26 20:45:06 rurban
872 // check for ALLOW_ANON_USER = false
874 // Revision 1.118 2004/02/26 01:32:03 rurban
875 // fixed session login with old WikiUser object. strangely, the errormask gets corruoted to 1, Pear???
877 // Revision 1.117 2004/02/24 17:19:37 rurban
878 // debugging helpers only
880 // Revision 1.116 2004/02/24 15:17:14 rurban
881 // improved auth errors with individual pages. the fact that you may not browse a certain admin page does not conclude that you may not browse the whole wiki. renamed browse => view
883 // Revision 1.115 2004/02/15 21:34:37 rurban
884 // PageList enhanced and improved.
885 // fixed new WikiAdmin... plugins
886 // editpage, Theme with exp. htmlarea framework
887 // (htmlarea yet committed, this is really questionable)
888 // WikiUser... code with better session handling for prefs
889 // enhanced UserPreferences (again)
890 // RecentChanges for show_deleted: how should pages be deleted then?
892 // Revision 1.114 2004/02/15 17:30:13 rurban
893 // workaround for lost db connnection handle on session restauration (->_auth_dbi)
894 // fixed getPreferences() (esp. from sessions)
895 // fixed setPreferences() (update and set),
896 // fixed AdoDb DB statements,
897 // update prefs only at UserPreferences POST (for testing)
898 // unified db prefs methods (but in external pref classes yet)
900 // Revision 1.113 2004/02/12 13:05:49 rurban
901 // Rename functional for PearDB backend
902 // some other minor changes
903 // SiteMap comes with a not yet functional feature request: includepages (tbd)
905 // Revision 1.112 2004/02/09 03:58:12 rurban
906 // for now default DB_SESSION to false
908 // * not existing perms will now query the parent, and not
909 // return the default perm
910 // * added pagePermissions func which returns the object per page
911 // * added getAccessDescription
913 // * added global ->prepare (not yet used) with smart user/pref/member table prefixing.
914 // * force init of authdbh in the 2 db classes
916 // * fixed session handling (not triple auth request anymore)
917 // * don't store cookie prefs with sessions
918 // stdlib: global obj2hash helper from _AuthInfo, also needed for PagePerm
920 // Revision 1.111 2004/02/07 10:41:25 rurban
921 // fixed auth from session (still double code but works)
923 // fixed DbPassUser upgrade and policy=old
926 // Revision 1.110 2004/02/03 09:45:39 rurban
927 // LDAP cleanup, start of new Pref classes
929 // Revision 1.109 2004/01/30 19:57:58 rurban
930 // fixed DBAuthParams['pref_select']: wrong _auth_dbi object used.
932 // Revision 1.108 2004/01/28 14:34:14 rurban
933 // session table takes the common prefix
934 // + various minor stuff
935 // reallow password changing
937 // Revision 1.107 2004/01/27 23:23:39 rurban
938 // renamed ->Username => _userid for consistency
939 // renamed mayCheckPassword => mayCheckPass
940 // fixed recursion problem in WikiUserNew
941 // fixed bogo login (but not quite 100% ready yet, password storage)
943 // Revision 1.106 2004/01/26 09:17:49 rurban
944 // * changed stored pref representation as before.
945 // the array of objects is 1) bigger and 2)
946 // less portable. If we would import packed pref
947 // objects and the object definition was changed, PHP would fail.
948 // This doesn't happen with an simple array of non-default values.
949 // * use $prefs->retrieve and $prefs->store methods, where retrieve
950 // understands the interim format of array of objects also.
951 // * simplified $prefs->get() and fixed $prefs->set()
952 // * added $user->_userid and class '_WikiUser' portability functions
953 // * fixed $user object ->_level upgrading, mostly using sessions.
954 // this fixes yesterdays problems with loosing authorization level.
955 // * fixed WikiUserNew::checkPass to return the _level
956 // * fixed WikiUserNew::isSignedIn
957 // * added explodePageList to class PageList, support sortby arg
958 // * fixed UserPreferences for WikiUserNew
959 // * fixed WikiPlugin for empty defaults array
960 // * UnfoldSubpages: added pagename arg, renamed pages arg,
961 // removed sort arg, support sortby arg
963 // Revision 1.105 2004/01/25 03:57:15 rurban
964 // WikiUserNew support (temp. ENABLE_USER_NEW constant)
966 // Revision 1.104 2003/12/26 06:41:16 carstenklapp
967 // Bugfix: Try to defer OS errors about session.save_path and ACCESS_LOG,
968 // so they don't prevent IE from partially (or not at all) rendering the
969 // page. This should help a little for the IE user who encounters trouble
970 // when setting up a new PhpWiki for the first time.
972 // Revision 1.103 2003/12/02 00:10:00 carstenklapp
973 // Bugfix: Ongoing work to untangle UserPreferences/WikiUser/request code
974 // mess: UserPreferences should take effect immediately now upon signing
977 // Revision 1.102 2003/11/25 22:55:32 carstenklapp
978 // Localization bugfix: For wikis where English is not the default system
979 // language, make sure that the authority error message (i.e. "You must
980 // sign in to edit pages in this wiki" etc.) is displayed in the wiki's
981 // default language. Previously it would always display in English.
982 // (Added call to update_locale() before displaying any messages prior to
983 // the login prompt.)
985 // Revision 1.101 2003/11/25 21:49:44 carstenklapp
986 // Bugfix: For a non-english wiki or when the user's preference is not
987 // english, the wiki would always use the english ActionPage first if it
988 // was present rather than the appropriate localised variant. (PhpWikis
989 // running only in english or Wikis running ONLY without any english
990 // ActionPages would not notice this bug, only when both english and
991 // localised ActionPages were in the DB.) Now we check for the localised
994 // Revision 1.100 2003/11/18 16:54:18 carstenklapp
995 // Reformatting only: Tabs to spaces, added rcs log.
1002 // c-basic-offset: 4
1003 // c-hanging-comment-ender-p: nil
1004 // indent-tabs-mode: nil