2 rcs_id('$Id: main.php,v 1.123 2004-03-10 15:41:27 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 if (!isa($user,WikiUserClassname()) or empty($user->_level)) {
45 $user = UpgradeUser($this->_user,$user);
47 $this->_prefs = $this->_user->_prefs;
49 $user = WikiUser($userid);
50 //Todo: upgrade later at updateAuthAndPrefs()
51 if (isset($this->_user))
52 $user = UpgradeUser($this->_user,$user);
54 $this->_prefs = $this->_user->_prefs;
57 $this->_user = new WikiUser($this, $this->_deduceUsername());
58 $this->_prefs = $this->_user->getPreferences();
62 function initializeLang () {
63 if ($user_lang = $this->getPref('lang')) {
64 //trigger_error("DEBUG: initializeLang() ". $user_lang ." calling update_locale()...");
65 update_locale($user_lang);
69 function initializeTheme () {
73 if ($user_theme = $this->getPref('theme'))
74 include_once("themes/$user_theme/themeinfo.php");
75 if (empty($Theme) and defined ('THEME'))
76 include_once("themes/" . THEME . "/themeinfo.php");
78 include_once("themes/default/themeinfo.php");
79 assert(!empty($Theme));
82 // This really maybe should be part of the constructor, but since it
83 // may involve HTML/template output, the global $request really needs
84 // to be initialized before we do this stuff.
85 function updateAuthAndPrefs () {
87 // Handle authentication request, if any.
88 if ($auth_args = $this->getArg('auth')) {
89 $this->setArg('auth', false);
90 $this->_handleAuthRequest($auth_args); // possible NORETURN
92 elseif ( ! $this->_user or ! $this->_user->isSignedIn() ) {
93 // If not auth request, try to sign in as saved user.
94 if (($saved_user = $this->getPref('userid')) != false) {
95 $this->_signIn($saved_user);
99 // Save preferences in session and cookie
100 if (isset($this->_user) and
101 (!isset($this->_user->_authhow) or $this->_user->_authhow != 'session')) {
103 $this->_user->setPreferences($this->_prefs, $id_only);
105 $this->setSessionVar('wiki_user', $this->_user);
106 //$this->setSessionVar('wiki_prefs', $this->_prefs);
109 // Ensure user has permissions for action
110 $require_level = $this->requiredAuthority($this->getArg('action'));
111 if (! $this->_user->hasAuthority($require_level))
112 $this->_notAuthorized($require_level); // NORETURN
115 function getUser () {
119 function getPrefs () {
120 return $this->_prefs;
123 // Convenience function:
124 function getPref ($key) {
125 if (isset($this->_prefs))
126 return $this->_prefs->get($key);
134 * Get requested page from the page database.
135 * By default it will grab the page requested via the URL
137 * This is a convenience function.
138 * @param string $pagename Name of page to get.
139 * @return WikiDB_Page Object with methods to pull data from
140 * database for the page requested.
142 function getPage ($pagename = false) {
143 if (!isset($this->_dbi))
146 $pagename = $this->getArg('pagename');
147 return $this->_dbi->getPage($pagename);
150 /** Get URL for POST actions.
152 * Officially, we should just use SCRIPT_NAME (or some such),
153 * but that causes problems when we try to issue a redirect, e.g.
154 * after saving a page.
156 * Some browsers (at least NS4 and Mozilla 0.97 won't accept
157 * a redirect from a page to itself.)
159 * So, as a HACK, we include pagename and action as query args in
160 * the URL. (These should be ignored when we receive the POST
163 function getPostURL ($pagename=false) {
164 if ($pagename === false)
165 $pagename = $this->getArg('pagename');
166 $action = $this->getArg('action');
167 if (!empty($_GET['start_debug'])) // zend ide support
168 return WikiURL($pagename, array('action' => $action, 'start_debug' => 1));
170 return WikiURL($pagename, array('action' => $action));
173 function _handleAuthRequest ($auth_args) {
174 if (!is_array($auth_args))
177 // Ignore password unless POST'ed.
178 if (!$this->isPost())
179 unset($auth_args['passwd']);
181 $olduser = $this->_user;
182 $user = $this->_user->AuthCheck($auth_args);
183 if (isa($user,WikiUserClassname())) {
184 // Successful login (or logout.)
185 $this->_setUser($user);
187 elseif (is_string($user)) {
188 // Login attempt failed.
189 $fail_message = $user;
190 $auth_args['pass_required'] = true;
191 // If no password was submitted, it's not really
192 // a failure --- just need to prompt for password...
193 if (!isset($auth_args['passwd'])) {
194 //$auth_args['pass_required'] = false;
195 $fail_message = false;
197 $olduser->PrintLoginForm($this, $auth_args, $fail_message);
198 $this->finish(); //NORETURN
201 // Login request cancelled.
206 * Attempt to sign in (bogo-login).
210 * @param $userid string Userid to attempt to sign in as.
213 function _signIn ($userid) {
214 if (ENABLE_USER_NEW) {
216 $this->_user = new _BogoUser($userid);
218 $this->_user = new _PassUser($userid);
220 $user = $this->_user->AuthCheck(array('userid' => $userid));
221 if (isa($user,WikiUserClassname())) {
222 $this->_setUser($user); // success!
226 // login or logout or restore state
227 function _setUser ($user) {
228 $this->_user = $user;
229 $this->setCookieVar('WIKI_ID', $user->getAuthenticatedId(), 365);
230 $this->setSessionVar('wiki_user', $user);
231 if ($user->isSignedIn())
232 $user->_authhow = 'signin';
234 // Save userid to prefs..
235 if (!($this->_prefs = $this->_user->getPreferences()))
236 $this->_prefs = $this->_user->_prefs;
237 $this->_prefs->set('userid',
238 $user->isSignedIn() ? $user->getId() : '');
239 $this->initializeTheme();
242 /* Permission system */
244 function _notAuthorized ($require_level) {
245 // Display the authority message in the Wiki's default
246 // language, in case it is not english.
248 // Note that normally a user will not see such an error once
249 // logged in, unless the admin has altered the default
250 // disallowed wikiactions. In that case we should probably
251 // check the user's language prefs too at this point; this
252 // would be a situation which is not really handled with the
254 update_locale(DEFAULT_LANGUAGE);
256 // User does not have required authority. Prompt for login.
257 $what = $this->getActionDescription($this->getArg('action'));
259 if ($require_level == WIKIAUTH_FORBIDDEN) {
260 $this->finish(fmt("%s is disallowed on this wiki.",
261 $this->getDisallowedActionDescription($this->getArg('action'))));
263 elseif ($require_level == WIKIAUTH_BOGO)
264 $msg = fmt("You must sign in to %s.", $what);
265 elseif ($require_level == WIKIAUTH_USER)
266 $msg = fmt("You must log in to %s.", $what);
268 $msg = fmt("You must be an administrator to %s.", $what);
269 $pass_required = ($require_level >= WIKIAUTH_USER);
271 $this->_user->PrintLoginForm($this, compact('require_level','pass_required'), $msg);
272 $this->finish(); // NORETURN
275 // Fixme: for PagePermissions we'll need other strings,
276 // relevant to the requested page, not just for the action on the whole wiki.
277 function getActionDescription($action) {
278 static $actionDescriptions;
279 if (! $actionDescriptions) {
281 = array('browse' => _("view this page"),
282 'diff' => _("diff this page"),
283 'dumphtml' => _("dump html pages"),
284 'dumpserial' => _("dump serial pages"),
285 'edit' => _("edit this page"),
286 'create' => _("create this page"),
287 'loadfile' => _("load files into this wiki"),
288 'lock' => _("lock this page"),
289 'remove' => _("remove this page"),
290 'unlock' => _("unlock this page"),
291 'upload' => _("upload a zip dump"),
292 'verify' => _("verify the current action"),
293 'viewsource' => _("view the source of this page"),
294 'xmlrpc' => _("access this wiki via XML-RPC"),
295 'zip' => _("download a zip dump from this wiki"),
296 'ziphtml' => _("download an html zip dump from this wiki")
299 if (in_array($action, array_keys($actionDescriptions)))
300 return $actionDescriptions[$action];
304 function getDisallowedActionDescription($action) {
305 static $disallowedActionDescriptions;
306 if (! $disallowedActionDescriptions) {
307 $disallowedActionDescriptions
308 = array('browse' => _("Browsing pages"),
309 'diff' => _("Diffing pages"),
310 'dumphtml' => _("Dumping html pages"),
311 'dumpserial' => _("Dumping serial pages"),
312 'edit' => _("Editing pages"),
313 'create' => _("Creating pages"),
314 'loadfile' => _("Loading files"),
315 'lock' => _("Locking pages"),
316 'remove' => _("Removing pages"),
317 'unlock' => _("Unlocking pages"),
318 'upload' => _("Uploading zip dumps"),
319 'verify' => _("Verify the current action"),
320 'viewsource' => _("Viewing the source of pages"),
321 'xmlrpc' => _("XML-RPC access"),
322 'zip' => _("Downloading zip dumps"),
323 'ziphtml' => _("Downloading html zip dumps")
326 if (in_array($action, array_keys($disallowedActionDescriptions)))
327 return $disallowedActionDescriptions[$action];
332 function requiredAuthority ($action) {
333 $auth = $this->requiredAuthorityForAction($action);
334 if (!ALLOW_ANON_USER) return WIKIAUTH_USER;
337 * This is a hook for plugins to require authority
338 * for posting to them.
340 * IMPORTANT: this is not a secure check, so the plugin
341 * may not assume that any POSTs to it are authorized.
342 * All this does is cause PhpWiki to prompt for login
343 * if the user doesn't have the required authority.
345 if ($this->isPost()) {
346 $post_auth = $this->getArg('require_authority_for_post');
347 if ($post_auth !== false)
348 $auth = max($auth, $post_auth);
353 function requiredAuthorityForAction ($action) {
354 if (class_exists("PagePermission")) {
355 return requiredAuthorityForPage($action);
365 return WIKIAUTH_ANON;
369 if (defined('ZIPDUMP_AUTH') && ZIPDUMP_AUTH)
370 return WIKIAUTH_ADMIN;
371 return WIKIAUTH_ANON;
374 if (defined('REQUIRE_SIGNIN_BEFORE_EDIT') && REQUIRE_SIGNIN_BEFORE_EDIT)
375 return WIKIAUTH_BOGO;
376 return WIKIAUTH_ANON;
377 // return WIKIAUTH_BOGO;
380 $page = $this->getPage();
381 $current = $page->getCurrentRevision();
382 if ($current->hasDefaultContents())
383 return $this->requiredAuthorityForAction('edit');
384 return $this->requiredAuthorityForAction('browse');
393 return WIKIAUTH_ADMIN;
395 global $WikiNameRegexp;
396 if (preg_match("/$WikiNameRegexp\Z/A", $action))
397 return WIKIAUTH_ANON; // ActionPage.
399 return WIKIAUTH_ADMIN;
403 /* End of Permission system */
405 function possiblyDeflowerVirginWiki () {
406 if ($this->getArg('action') != 'browse')
408 if ($this->getArg('pagename') != HOME_PAGE)
411 $page = $this->getPage();
412 $current = $page->getCurrentRevision();
413 if ($current->getVersion() > 0)
414 return; // Homepage exists.
416 include('lib/loadsave.php');
418 $this->finish(); // NORETURN
421 function handleAction () {
422 $action = $this->getArg('action');
423 $method = "action_$action";
424 if (method_exists($this, $method)) {
427 elseif ($page = $this->findActionPage($action)) {
428 $this->actionpage($page);
431 $this->finish(fmt("%s: Bad action", $action));
435 function finish ($errormsg = false) {
439 exit(); // just in case CloseDataBase calls us
442 if (!empty($this->_dbi))
443 $this->_dbi->close();
447 global $ErrorManager;
448 $ErrorManager->flushPostponedErrors();
450 if (!empty($errormsg)) {
453 HTML::h2(_("Fatal PhpWiki Error")),
456 echo "\n</body></html>";
463 function _deducePagename () {
464 if ($this->getArg('pagename'))
465 return $this->getArg('pagename');
468 $pathinfo = $this->get('PATH_INFO');
469 $tail = substr($pathinfo, strlen(PATH_INFO_PREFIX));
471 if ($tail && $pathinfo == PATH_INFO_PREFIX . $tail) {
475 elseif ($this->isPost()) {
477 * In general, for security reasons, HTTP_GET_VARS should be ignored
478 * on POST requests, but we make an exception here (only for pagename).
480 * The justifcation for this hack is the following
481 * asymmetry: When POSTing with USE_PATH_INFO set, the
482 * pagename can (and should) be communicated through the
483 * request URL via PATH_INFO. When POSTing with
484 * USE_PATH_INFO off, this cannot be done --- the only way
485 * to communicate the pagename through the URL is via
486 * QUERY_ARGS (HTTP_GET_VARS).
488 global $HTTP_GET_VARS;
489 if (isset($HTTP_GET_VARS['pagename'])) {
490 return $HTTP_GET_VARS['pagename'];
495 * Support for PhpWiki 1.2 style requests.
497 $query_string = $this->get('QUERY_STRING');
498 if (preg_match('/^[^&=]+$/', $query_string)) {
499 return urldecode($query_string);
505 function _deduceAction () {
506 if (!($action = $this->getArg('action'))) {
507 // Detect XML-RPC requests
509 && $this->get('CONTENT_TYPE') == 'text/xml') {
510 global $HTTP_RAW_POST_DATA;
511 if (strstr($HTTP_RAW_POST_DATA, '<methodCall>')) {
516 return 'browse'; // Default if no action specified.
519 if (method_exists($this, "action_$action"))
522 // Allow for, e.g. action=LikePages
523 if ($this->isActionPage($action))
526 trigger_error("$action: Unknown action", E_USER_NOTICE);
530 function _deduceUsername() {
531 if (!empty($this->args['auth']) and !empty($this->args['auth']['userid']))
532 return $this->args['auth']['userid'];
533 if (!empty($_SERVER['PHP_AUTH_USER']))
534 return $_SERVER['PHP_AUTH_USER'];
536 if ($user = $this->getSessionVar('wiki_user')) {
537 $this->_user = $user;
538 $this->_user->_authhow = 'session';
539 return ENABLE_USER_NEW ? $user->UserName() : $this->_user;
541 if ($userid = $this->getCookieVar('WIKI_ID')) {
542 if (!empty($this->_user))
543 $this->_user->authhow = 'cookie';
549 function _isActionPage ($pagename) {
550 $dbi = $this->getDbh();
551 $page = $dbi->getPage($pagename);
552 $rev = $page->getCurrentRevision();
553 // FIXME: more restrictive check for sane plugin?
554 if (strstr($rev->getPackedContent(), '<?plugin'))
556 if (!$rev->hasDefaultContents())
557 trigger_error("$pagename: Does not appear to be an 'action page'", E_USER_NOTICE);
561 function findActionPage ($action) {
564 // check for translated version, as per users preferred language
565 // (or system default in case it is not en)
566 $translation = gettext($action);
568 if (isset($cache) and isset($cache[$translation]))
569 return $cache[$translation];
571 // check for cached translated version
572 if ($this->_isActionPage($translation))
573 return $cache[$action] = $translation;
575 // Allow for, e.g. action=LikePages
576 global $WikiNameRegexp;
577 if (!preg_match("/$WikiNameRegexp\\Z/A", $action))
578 return $cache[$action] = false;
580 // check for translated version (default language)
582 if ($LANG != DEFAULT_LANGUAGE and $LANG != "en") {
584 //trigger_error("DEBUG: findActionPage() ". DEFAULT_LANGUAGE." calling update_locale()...");
585 update_locale(DEFAULT_LANGUAGE);
586 $default = gettext($action);
587 //trigger_error("DEBUG: findActionPage() ". $save_lang." restoring save_lang, calling update_locale()...");
588 update_locale($save_lang);
589 if ($this->_isActionPage($default))
590 return $cache[$action] = $default;
593 $default = $translation;
596 // check for english version
597 if ($action != $translation and $action != $default) {
598 if ($this->_isActionPage($action))
599 return $cache[$action] = $action;
602 trigger_error("$action: Cannot find action page", E_USER_NOTICE);
603 return $cache[$action] = false;
606 function isActionPage ($pagename) {
607 return $this->findActionPage($pagename);
610 function action_browse () {
611 $this->buffer_output();
612 include_once("lib/display.php");
616 function action_verify () {
617 $this->action_browse();
620 function actionpage ($action) {
621 $this->buffer_output();
622 include_once("lib/display.php");
623 actionPage($this, $action);
626 function action_diff () {
627 $this->buffer_output();
628 include_once "lib/diff.php";
632 function action_search () {
633 // This is obsolete: reformulate URL and redirect.
634 // FIXME: this whole section should probably be deleted.
635 if ($this->getArg('searchtype') == 'full') {
636 $search_page = _("FullTextSearch");
639 $search_page = _("TitleSearch");
641 $this->redirect(WikiURL($search_page,
642 array('s' => $this->getArg('searchterm')),
646 function action_edit () {
647 $this->buffer_output();
648 include "lib/editpage.php";
649 $e = new PageEditor ($this);
653 function action_create () {
654 $this->action_edit();
657 function action_viewsource () {
658 $this->buffer_output();
659 include "lib/editpage.php";
660 $e = new PageEditor ($this);
664 function action_lock () {
665 $page = $this->getPage();
666 $page->set('locked', true);
667 $this->action_browse();
670 function action_unlock () {
671 // FIXME: This check is redundant.
672 //$user->requireAuth(WIKIAUTH_ADMIN);
673 $page = $this->getPage();
674 $page->set('locked', false);
675 $this->action_browse();
678 function action_remove () {
679 // FIXME: This check is redundant.
680 //$user->requireAuth(WIKIAUTH_ADMIN);
681 $pagename = $this->getArg('pagename');
682 if (strstr($pagename,_('PhpWikiAdministration'))) {
683 $this->action_browse();
685 include('lib/removepage.php');
690 function action_xmlrpc () {
691 include_once("lib/XmlRpcServer.php");
692 $xmlrpc = new XmlRpcServer($this);
696 function action_zip () {
697 include_once("lib/loadsave.php");
699 // I don't think it hurts to add cruft at the end of the zip file.
700 echo "\n========================================================\n";
701 echo "PhpWiki " . PHPWIKI_VERSION . " source:\n$GLOBALS[RCS_IDS]\n";
704 function action_ziphtml () {
705 include_once("lib/loadsave.php");
706 MakeWikiZipHtml($this);
707 // I don't think it hurts to add cruft at the end of the zip file.
708 echo "\n========================================================\n";
709 echo "PhpWiki " . PHPWIKI_VERSION . " source:\n$GLOBALS[RCS_IDS]\n";
712 function action_dumpserial () {
713 include_once("lib/loadsave.php");
717 function action_dumphtml () {
718 include_once("lib/loadsave.php");
719 DumpHtmlToDir($this);
722 function action_upload () {
723 include_once("lib/loadsave.php");
727 function action_upgrade () {
728 include_once("lib/upgrade.php");
732 function action_loadfile () {
733 include_once("lib/loadsave.php");
734 LoadFileOrDir($this);
739 function is_safe_action ($action) {
740 return WikiRequest::requiredAuthorityForAction($action) < WIKIAUTH_ADMIN;
743 function validateSessionPath() {
744 // Try to defer any session.save_path PHP errors before any html
745 // is output, which causes some versions of IE to display a blank
746 // page (due to its strict mode while parsing a page?).
747 if (! is_writeable(ini_get('session.save_path'))) {
750 (sprintf(_("%s is not writable."),
751 _("The session.save_path directory"))
753 . sprintf(_("Please ensure that %s is writable, or redefine %s in index.php."),
754 sprintf(_("the directory '%s'"),
755 ini_get('session.save_path')),
758 . sprintf(_("Attempting to use the directory '%s' instead."),
761 if (! is_writeable($tmpdir)) {
763 (sprintf(_("%s is not writable."), $tmpdir)
765 . _("Users will not be able to sign in.")
769 ini_set('session.save_path', $tmpdir);
775 validateSessionPath();
779 $request = new WikiRequest();
782 * Allow for disabling of markup cache.
783 * (Mostly for debugging ... hopefully.)
785 * See also <?plugin WikiAdminUtils action=purge-cache ?>
787 if (!defined('WIKIDB_NOCACHE_MARKUP') and $request->getArg('nocache'))
788 define('WIKIDB_NOCACHE_MARKUP', $request->getArg('nocache'));
790 // Initialize with system defaults in case user not logged in.
791 // Should this go into constructor?
792 $request->initializeTheme();
794 $request->updateAuthAndPrefs();
795 $request->initializeLang();
797 // Enable the output of most of the warning messages.
798 // The warnings will screw up zip files though.
799 global $ErrorManager;
800 if (substr($request->getArg('action'), 0, 3) != 'zip') {
801 $ErrorManager->setPostponedErrorMask(E_NOTICE|E_USER_NOTICE);
802 //$ErrorManager->setPostponedErrorMask(0);
806 //if ($user->is_authenticated())
807 // $LogEntry->user = $user->getId();
809 $request->possiblyDeflowerVirginWiki();
811 if (defined('WIKI_XMLRPC') and WIKI_XMLRPC) return;
812 if (defined('WIKI_SOAP') and WIKI_SOAP) return;
814 $validators = array('wikiname' => WIKI_NAME,
815 'args' => hash($request->getArgs()),
816 'prefs' => hash($request->getPrefs()));
817 if (CACHE_CONTROL == 'STRICT') {
818 $dbi = $request->getDbh();
819 $timestamp = $dbi->getTimestamp();
820 $validators['mtime'] = $timestamp;
821 $validators['%mtime'] = (int)$timestamp;
823 // FIXME: we should try to generate strong validators when possible,
824 // but for now, our validator is weak, since equal validators do not
825 // indicate byte-level equality of content. (Due to DEBUG timing output, etc...)
827 // (If DEBUG if off, this may be a strong validator, but I'm going
828 // to go the paranoid route here pending further study and testing.)
830 $validators['%weak'] = true;
832 $request->setValidators($validators);
834 $request->handleAction();
836 if (defined('DEBUG') and DEBUG & 4) phpinfo(INFO_VARIABLES);
840 $x = error_reporting(); // why is it 1 here? should be E_ALL
841 error_reporting(E_ALL);
845 // $Log: not supported by cvs2svn $
846 // Revision 1.122 2004/03/08 18:17:09 rurban
847 // added more WikiGroup::getMembersOf methods, esp. for special groups
848 // fixed $LDAP_SET_OPTIONS
849 // fixed _AuthInfo group methods
851 // Revision 1.121 2004/03/01 13:48:45 rurban
853 // p[] consistency fix
855 // Revision 1.120 2004/03/01 10:22:41 rurban
856 // initializeTheme optimize
858 // Revision 1.119 2004/02/26 20:45:06 rurban
859 // check for ALLOW_ANON_USER = false
861 // Revision 1.118 2004/02/26 01:32:03 rurban
862 // fixed session login with old WikiUser object. strangely, the errormask gets corruoted to 1, Pear???
864 // Revision 1.117 2004/02/24 17:19:37 rurban
865 // debugging helpers only
867 // Revision 1.116 2004/02/24 15:17:14 rurban
868 // 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
870 // Revision 1.115 2004/02/15 21:34:37 rurban
871 // PageList enhanced and improved.
872 // fixed new WikiAdmin... plugins
873 // editpage, Theme with exp. htmlarea framework
874 // (htmlarea yet committed, this is really questionable)
875 // WikiUser... code with better session handling for prefs
876 // enhanced UserPreferences (again)
877 // RecentChanges for show_deleted: how should pages be deleted then?
879 // Revision 1.114 2004/02/15 17:30:13 rurban
880 // workaround for lost db connnection handle on session restauration (->_auth_dbi)
881 // fixed getPreferences() (esp. from sessions)
882 // fixed setPreferences() (update and set),
883 // fixed AdoDb DB statements,
884 // update prefs only at UserPreferences POST (for testing)
885 // unified db prefs methods (but in external pref classes yet)
887 // Revision 1.113 2004/02/12 13:05:49 rurban
888 // Rename functional for PearDB backend
889 // some other minor changes
890 // SiteMap comes with a not yet functional feature request: includepages (tbd)
892 // Revision 1.112 2004/02/09 03:58:12 rurban
893 // for now default DB_SESSION to false
895 // * not existing perms will now query the parent, and not
896 // return the default perm
897 // * added pagePermissions func which returns the object per page
898 // * added getAccessDescription
900 // * added global ->prepare (not yet used) with smart user/pref/member table prefixing.
901 // * force init of authdbh in the 2 db classes
903 // * fixed session handling (not triple auth request anymore)
904 // * don't store cookie prefs with sessions
905 // stdlib: global obj2hash helper from _AuthInfo, also needed for PagePerm
907 // Revision 1.111 2004/02/07 10:41:25 rurban
908 // fixed auth from session (still double code but works)
910 // fixed DbPassUser upgrade and policy=old
913 // Revision 1.110 2004/02/03 09:45:39 rurban
914 // LDAP cleanup, start of new Pref classes
916 // Revision 1.109 2004/01/30 19:57:58 rurban
917 // fixed DBAuthParams['pref_select']: wrong _auth_dbi object used.
919 // Revision 1.108 2004/01/28 14:34:14 rurban
920 // session table takes the common prefix
921 // + various minor stuff
922 // reallow password changing
924 // Revision 1.107 2004/01/27 23:23:39 rurban
925 // renamed ->Username => _userid for consistency
926 // renamed mayCheckPassword => mayCheckPass
927 // fixed recursion problem in WikiUserNew
928 // fixed bogo login (but not quite 100% ready yet, password storage)
930 // Revision 1.106 2004/01/26 09:17:49 rurban
931 // * changed stored pref representation as before.
932 // the array of objects is 1) bigger and 2)
933 // less portable. If we would import packed pref
934 // objects and the object definition was changed, PHP would fail.
935 // This doesn't happen with an simple array of non-default values.
936 // * use $prefs->retrieve and $prefs->store methods, where retrieve
937 // understands the interim format of array of objects also.
938 // * simplified $prefs->get() and fixed $prefs->set()
939 // * added $user->_userid and class '_WikiUser' portability functions
940 // * fixed $user object ->_level upgrading, mostly using sessions.
941 // this fixes yesterdays problems with loosing authorization level.
942 // * fixed WikiUserNew::checkPass to return the _level
943 // * fixed WikiUserNew::isSignedIn
944 // * added explodePageList to class PageList, support sortby arg
945 // * fixed UserPreferences for WikiUserNew
946 // * fixed WikiPlugin for empty defaults array
947 // * UnfoldSubpages: added pagename arg, renamed pages arg,
948 // removed sort arg, support sortby arg
950 // Revision 1.105 2004/01/25 03:57:15 rurban
951 // WikiUserNew support (temp. ENABLE_USER_NEW constant)
953 // Revision 1.104 2003/12/26 06:41:16 carstenklapp
954 // Bugfix: Try to defer OS errors about session.save_path and ACCESS_LOG,
955 // so they don't prevent IE from partially (or not at all) rendering the
956 // page. This should help a little for the IE user who encounters trouble
957 // when setting up a new PhpWiki for the first time.
959 // Revision 1.103 2003/12/02 00:10:00 carstenklapp
960 // Bugfix: Ongoing work to untangle UserPreferences/WikiUser/request code
961 // mess: UserPreferences should take effect immediately now upon signing
964 // Revision 1.102 2003/11/25 22:55:32 carstenklapp
965 // Localization bugfix: For wikis where English is not the default system
966 // language, make sure that the authority error message (i.e. "You must
967 // sign in to edit pages in this wiki" etc.) is displayed in the wiki's
968 // default language. Previously it would always display in English.
969 // (Added call to update_locale() before displaying any messages prior to
970 // the login prompt.)
972 // Revision 1.101 2003/11/25 21:49:44 carstenklapp
973 // Bugfix: For a non-english wiki or when the user's preference is not
974 // english, the wiki would always use the english ActionPage first if it
975 // was present rather than the appropriate localised variant. (PhpWikis
976 // running only in english or Wikis running ONLY without any english
977 // ActionPages would not notice this bug, only when both english and
978 // localised ActionPages were in the DB.) Now we check for the localised
981 // Revision 1.100 2003/11/18 16:54:18 carstenklapp
982 // Reformatting only: Tabs to spaces, added rcs log.
990 // c-hanging-comment-ender-p: nil
991 // indent-tabs-mode: nil