2 rcs_id('$Id: main.php,v 1.124 2004-03-12 15:48:07 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');
394 return WIKIAUTH_ADMIN;
396 global $WikiNameRegexp;
397 if (preg_match("/$WikiNameRegexp\Z/A", $action))
398 return WIKIAUTH_ANON; // ActionPage.
400 return WIKIAUTH_ADMIN;
404 /* End of Permission system */
406 function possiblyDeflowerVirginWiki () {
407 if ($this->getArg('action') != 'browse')
409 if ($this->getArg('pagename') != HOME_PAGE)
412 $page = $this->getPage();
413 $current = $page->getCurrentRevision();
414 if ($current->getVersion() > 0)
415 return; // Homepage exists.
417 include('lib/loadsave.php');
419 $this->finish(); // NORETURN
422 function handleAction () {
423 $action = $this->getArg('action');
424 $method = "action_$action";
425 if (method_exists($this, $method)) {
428 elseif ($page = $this->findActionPage($action)) {
429 $this->actionpage($page);
432 $this->finish(fmt("%s: Bad action", $action));
436 function finish ($errormsg = false) {
440 exit(); // just in case CloseDataBase calls us
443 if (!empty($this->_dbi))
444 $this->_dbi->close();
448 global $ErrorManager;
449 $ErrorManager->flushPostponedErrors();
451 if (!empty($errormsg)) {
454 HTML::h2(_("Fatal PhpWiki Error")),
457 echo "\n</body></html>";
464 function _deducePagename () {
465 if ($this->getArg('pagename'))
466 return $this->getArg('pagename');
469 $pathinfo = $this->get('PATH_INFO');
470 $tail = substr($pathinfo, strlen(PATH_INFO_PREFIX));
472 if ($tail && $pathinfo == PATH_INFO_PREFIX . $tail) {
476 elseif ($this->isPost()) {
478 * In general, for security reasons, HTTP_GET_VARS should be ignored
479 * on POST requests, but we make an exception here (only for pagename).
481 * The justifcation for this hack is the following
482 * asymmetry: When POSTing with USE_PATH_INFO set, the
483 * pagename can (and should) be communicated through the
484 * request URL via PATH_INFO. When POSTing with
485 * USE_PATH_INFO off, this cannot be done --- the only way
486 * to communicate the pagename through the URL is via
487 * QUERY_ARGS (HTTP_GET_VARS).
489 global $HTTP_GET_VARS;
490 if (isset($HTTP_GET_VARS['pagename'])) {
491 return $HTTP_GET_VARS['pagename'];
496 * Support for PhpWiki 1.2 style requests.
498 $query_string = $this->get('QUERY_STRING');
499 if (preg_match('/^[^&=]+$/', $query_string)) {
500 return urldecode($query_string);
506 function _deduceAction () {
507 if (!($action = $this->getArg('action'))) {
508 // Detect XML-RPC requests
510 && $this->get('CONTENT_TYPE') == 'text/xml') {
511 global $HTTP_RAW_POST_DATA;
512 if (strstr($HTTP_RAW_POST_DATA, '<methodCall>')) {
517 return 'browse'; // Default if no action specified.
520 if (method_exists($this, "action_$action"))
523 // Allow for, e.g. action=LikePages
524 if ($this->isActionPage($action))
527 trigger_error("$action: Unknown action", E_USER_NOTICE);
531 function _deduceUsername() {
532 if (!empty($this->args['auth']) and !empty($this->args['auth']['userid']))
533 return $this->args['auth']['userid'];
534 if (!empty($_SERVER['PHP_AUTH_USER']))
535 return $_SERVER['PHP_AUTH_USER'];
537 if ($user = $this->getSessionVar('wiki_user')) {
538 $this->_user = $user;
539 $this->_user->_authhow = 'session';
540 return ENABLE_USER_NEW ? $user->UserName() : $this->_user;
542 if ($userid = $this->getCookieVar('WIKI_ID')) {
543 if (!empty($this->_user))
544 $this->_user->authhow = 'cookie';
550 function _isActionPage ($pagename) {
551 $dbi = $this->getDbh();
552 $page = $dbi->getPage($pagename);
553 $rev = $page->getCurrentRevision();
554 // FIXME: more restrictive check for sane plugin?
555 if (strstr($rev->getPackedContent(), '<?plugin'))
557 if (!$rev->hasDefaultContents())
558 trigger_error("$pagename: Does not appear to be an 'action page'", E_USER_NOTICE);
562 function findActionPage ($action) {
565 // check for translated version, as per users preferred language
566 // (or system default in case it is not en)
567 $translation = gettext($action);
569 if (isset($cache) and isset($cache[$translation]))
570 return $cache[$translation];
572 // check for cached translated version
573 if ($this->_isActionPage($translation))
574 return $cache[$action] = $translation;
576 // Allow for, e.g. action=LikePages
577 global $WikiNameRegexp;
578 if (!preg_match("/$WikiNameRegexp\\Z/A", $action))
579 return $cache[$action] = false;
581 // check for translated version (default language)
583 if ($LANG != DEFAULT_LANGUAGE and $LANG != "en") {
585 //trigger_error("DEBUG: findActionPage() ". DEFAULT_LANGUAGE." calling update_locale()...");
586 update_locale(DEFAULT_LANGUAGE);
587 $default = gettext($action);
588 //trigger_error("DEBUG: findActionPage() ". $save_lang." restoring save_lang, calling update_locale()...");
589 update_locale($save_lang);
590 if ($this->_isActionPage($default))
591 return $cache[$action] = $default;
594 $default = $translation;
597 // check for english version
598 if ($action != $translation and $action != $default) {
599 if ($this->_isActionPage($action))
600 return $cache[$action] = $action;
603 trigger_error("$action: Cannot find action page", E_USER_NOTICE);
604 return $cache[$action] = false;
607 function isActionPage ($pagename) {
608 return $this->findActionPage($pagename);
611 function action_browse () {
612 $this->buffer_output();
613 include_once("lib/display.php");
617 function action_verify () {
618 $this->action_browse();
621 function actionpage ($action) {
622 $this->buffer_output();
623 include_once("lib/display.php");
624 actionPage($this, $action);
627 function action_diff () {
628 $this->buffer_output();
629 include_once "lib/diff.php";
633 function action_search () {
634 // This is obsolete: reformulate URL and redirect.
635 // FIXME: this whole section should probably be deleted.
636 if ($this->getArg('searchtype') == 'full') {
637 $search_page = _("FullTextSearch");
640 $search_page = _("TitleSearch");
642 $this->redirect(WikiURL($search_page,
643 array('s' => $this->getArg('searchterm')),
647 function action_edit () {
648 $this->buffer_output();
649 include "lib/editpage.php";
650 $e = new PageEditor ($this);
654 function action_create () {
655 $this->action_edit();
658 function action_viewsource () {
659 $this->buffer_output();
660 include "lib/editpage.php";
661 $e = new PageEditor ($this);
665 function action_lock () {
666 $page = $this->getPage();
667 $page->set('locked', true);
668 $this->action_browse();
671 function action_unlock () {
672 // FIXME: This check is redundant.
673 //$user->requireAuth(WIKIAUTH_ADMIN);
674 $page = $this->getPage();
675 $page->set('locked', false);
676 $this->action_browse();
679 function action_remove () {
680 // FIXME: This check is redundant.
681 //$user->requireAuth(WIKIAUTH_ADMIN);
682 $pagename = $this->getArg('pagename');
683 if (strstr($pagename,_('PhpWikiAdministration'))) {
684 $this->action_browse();
686 include('lib/removepage.php');
691 function action_xmlrpc () {
692 include_once("lib/XmlRpcServer.php");
693 $xmlrpc = new XmlRpcServer($this);
697 function action_zip () {
698 include_once("lib/loadsave.php");
700 // I don't think it hurts to add cruft at the end of the zip file.
701 echo "\n========================================================\n";
702 echo "PhpWiki " . PHPWIKI_VERSION . " source:\n$GLOBALS[RCS_IDS]\n";
705 function action_ziphtml () {
706 include_once("lib/loadsave.php");
707 MakeWikiZipHtml($this);
708 // I don't think it hurts to add cruft at the end of the zip file.
709 echo "\n========================================================\n";
710 echo "PhpWiki " . PHPWIKI_VERSION . " source:\n$GLOBALS[RCS_IDS]\n";
713 function action_dumpserial () {
714 include_once("lib/loadsave.php");
718 function action_dumphtml () {
719 include_once("lib/loadsave.php");
720 DumpHtmlToDir($this);
723 function action_upload () {
724 include_once("lib/loadsave.php");
728 function action_upgrade () {
729 include_once("lib/loadsave.php");
730 include_once("lib/upgrade.php");
734 function action_loadfile () {
735 include_once("lib/loadsave.php");
736 LoadFileOrDir($this);
741 function is_safe_action ($action) {
742 return WikiRequest::requiredAuthorityForAction($action) < WIKIAUTH_ADMIN;
745 function validateSessionPath() {
746 // Try to defer any session.save_path PHP errors before any html
747 // is output, which causes some versions of IE to display a blank
748 // page (due to its strict mode while parsing a page?).
749 if (! is_writeable(ini_get('session.save_path'))) {
752 (sprintf(_("%s is not writable."),
753 _("The session.save_path directory"))
755 . sprintf(_("Please ensure that %s is writable, or redefine %s in index.php."),
756 sprintf(_("the directory '%s'"),
757 ini_get('session.save_path')),
760 . sprintf(_("Attempting to use the directory '%s' instead."),
763 if (! is_writeable($tmpdir)) {
765 (sprintf(_("%s is not writable."), $tmpdir)
767 . _("Users will not be able to sign in.")
771 ini_set('session.save_path', $tmpdir);
777 validateSessionPath();
781 $request = new WikiRequest();
784 * Allow for disabling of markup cache.
785 * (Mostly for debugging ... hopefully.)
787 * See also <?plugin WikiAdminUtils action=purge-cache ?>
789 if (!defined('WIKIDB_NOCACHE_MARKUP') and $request->getArg('nocache'))
790 define('WIKIDB_NOCACHE_MARKUP', $request->getArg('nocache'));
792 // Initialize with system defaults in case user not logged in.
793 // Should this go into constructor?
794 $request->initializeTheme();
796 $request->updateAuthAndPrefs();
797 $request->initializeLang();
799 // Enable the output of most of the warning messages.
800 // The warnings will screw up zip files though.
801 global $ErrorManager;
802 if (substr($request->getArg('action'), 0, 3) != 'zip') {
803 $ErrorManager->setPostponedErrorMask(E_NOTICE|E_USER_NOTICE);
804 //$ErrorManager->setPostponedErrorMask(0);
808 //if ($user->is_authenticated())
809 // $LogEntry->user = $user->getId();
811 $request->possiblyDeflowerVirginWiki();
813 if (defined('WIKI_XMLRPC') and WIKI_XMLRPC) return;
814 if (defined('WIKI_SOAP') and WIKI_SOAP) return;
816 $validators = array('wikiname' => WIKI_NAME,
817 'args' => hash($request->getArgs()),
818 'prefs' => hash($request->getPrefs()));
819 if (CACHE_CONTROL == 'STRICT') {
820 $dbi = $request->getDbh();
821 $timestamp = $dbi->getTimestamp();
822 $validators['mtime'] = $timestamp;
823 $validators['%mtime'] = (int)$timestamp;
825 // FIXME: we should try to generate strong validators when possible,
826 // but for now, our validator is weak, since equal validators do not
827 // indicate byte-level equality of content. (Due to DEBUG timing output, etc...)
829 // (If DEBUG if off, this may be a strong validator, but I'm going
830 // to go the paranoid route here pending further study and testing.)
832 $validators['%weak'] = true;
834 $request->setValidators($validators);
836 $request->handleAction();
838 if (defined('DEBUG') and DEBUG & 4) phpinfo(INFO_VARIABLES);
842 $x = error_reporting(); // why is it 1 here? should be E_ALL
843 error_reporting(E_ALL);
847 // $Log: not supported by cvs2svn $
848 // Revision 1.123 2004/03/10 15:41:27 rurban
849 // use default pref mysql table
851 // Revision 1.122 2004/03/08 18:17:09 rurban
852 // added more WikiGroup::getMembersOf methods, esp. for special groups
853 // fixed $LDAP_SET_OPTIONS
854 // fixed _AuthInfo group methods
856 // Revision 1.121 2004/03/01 13:48:45 rurban
858 // p[] consistency fix
860 // Revision 1.120 2004/03/01 10:22:41 rurban
861 // initializeTheme optimize
863 // Revision 1.119 2004/02/26 20:45:06 rurban
864 // check for ALLOW_ANON_USER = false
866 // Revision 1.118 2004/02/26 01:32:03 rurban
867 // fixed session login with old WikiUser object. strangely, the errormask gets corruoted to 1, Pear???
869 // Revision 1.117 2004/02/24 17:19:37 rurban
870 // debugging helpers only
872 // Revision 1.116 2004/02/24 15:17:14 rurban
873 // 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
875 // Revision 1.115 2004/02/15 21:34:37 rurban
876 // PageList enhanced and improved.
877 // fixed new WikiAdmin... plugins
878 // editpage, Theme with exp. htmlarea framework
879 // (htmlarea yet committed, this is really questionable)
880 // WikiUser... code with better session handling for prefs
881 // enhanced UserPreferences (again)
882 // RecentChanges for show_deleted: how should pages be deleted then?
884 // Revision 1.114 2004/02/15 17:30:13 rurban
885 // workaround for lost db connnection handle on session restauration (->_auth_dbi)
886 // fixed getPreferences() (esp. from sessions)
887 // fixed setPreferences() (update and set),
888 // fixed AdoDb DB statements,
889 // update prefs only at UserPreferences POST (for testing)
890 // unified db prefs methods (but in external pref classes yet)
892 // Revision 1.113 2004/02/12 13:05:49 rurban
893 // Rename functional for PearDB backend
894 // some other minor changes
895 // SiteMap comes with a not yet functional feature request: includepages (tbd)
897 // Revision 1.112 2004/02/09 03:58:12 rurban
898 // for now default DB_SESSION to false
900 // * not existing perms will now query the parent, and not
901 // return the default perm
902 // * added pagePermissions func which returns the object per page
903 // * added getAccessDescription
905 // * added global ->prepare (not yet used) with smart user/pref/member table prefixing.
906 // * force init of authdbh in the 2 db classes
908 // * fixed session handling (not triple auth request anymore)
909 // * don't store cookie prefs with sessions
910 // stdlib: global obj2hash helper from _AuthInfo, also needed for PagePerm
912 // Revision 1.111 2004/02/07 10:41:25 rurban
913 // fixed auth from session (still double code but works)
915 // fixed DbPassUser upgrade and policy=old
918 // Revision 1.110 2004/02/03 09:45:39 rurban
919 // LDAP cleanup, start of new Pref classes
921 // Revision 1.109 2004/01/30 19:57:58 rurban
922 // fixed DBAuthParams['pref_select']: wrong _auth_dbi object used.
924 // Revision 1.108 2004/01/28 14:34:14 rurban
925 // session table takes the common prefix
926 // + various minor stuff
927 // reallow password changing
929 // Revision 1.107 2004/01/27 23:23:39 rurban
930 // renamed ->Username => _userid for consistency
931 // renamed mayCheckPassword => mayCheckPass
932 // fixed recursion problem in WikiUserNew
933 // fixed bogo login (but not quite 100% ready yet, password storage)
935 // Revision 1.106 2004/01/26 09:17:49 rurban
936 // * changed stored pref representation as before.
937 // the array of objects is 1) bigger and 2)
938 // less portable. If we would import packed pref
939 // objects and the object definition was changed, PHP would fail.
940 // This doesn't happen with an simple array of non-default values.
941 // * use $prefs->retrieve and $prefs->store methods, where retrieve
942 // understands the interim format of array of objects also.
943 // * simplified $prefs->get() and fixed $prefs->set()
944 // * added $user->_userid and class '_WikiUser' portability functions
945 // * fixed $user object ->_level upgrading, mostly using sessions.
946 // this fixes yesterdays problems with loosing authorization level.
947 // * fixed WikiUserNew::checkPass to return the _level
948 // * fixed WikiUserNew::isSignedIn
949 // * added explodePageList to class PageList, support sortby arg
950 // * fixed UserPreferences for WikiUserNew
951 // * fixed WikiPlugin for empty defaults array
952 // * UnfoldSubpages: added pagename arg, renamed pages arg,
953 // removed sort arg, support sortby arg
955 // Revision 1.105 2004/01/25 03:57:15 rurban
956 // WikiUserNew support (temp. ENABLE_USER_NEW constant)
958 // Revision 1.104 2003/12/26 06:41:16 carstenklapp
959 // Bugfix: Try to defer OS errors about session.save_path and ACCESS_LOG,
960 // so they don't prevent IE from partially (or not at all) rendering the
961 // page. This should help a little for the IE user who encounters trouble
962 // when setting up a new PhpWiki for the first time.
964 // Revision 1.103 2003/12/02 00:10:00 carstenklapp
965 // Bugfix: Ongoing work to untangle UserPreferences/WikiUser/request code
966 // mess: UserPreferences should take effect immediately now upon signing
969 // Revision 1.102 2003/11/25 22:55:32 carstenklapp
970 // Localization bugfix: For wikis where English is not the default system
971 // language, make sure that the authority error message (i.e. "You must
972 // sign in to edit pages in this wiki" etc.) is displayed in the wiki's
973 // default language. Previously it would always display in English.
974 // (Added call to update_locale() before displaying any messages prior to
975 // the login prompt.)
977 // Revision 1.101 2003/11/25 21:49:44 carstenklapp
978 // Bugfix: For a non-english wiki or when the user's preference is not
979 // english, the wiki would always use the english ActionPage first if it
980 // was present rather than the appropriate localised variant. (PhpWikis
981 // running only in english or Wikis running ONLY without any english
982 // ActionPages would not notice this bug, only when both english and
983 // localised ActionPages were in the DB.) Now we check for the localised
986 // Revision 1.100 2003/11/18 16:54:18 carstenklapp
987 // Reformatting only: Tabs to spaces, added rcs log.
995 // c-hanging-comment-ender-p: nil
996 // indent-tabs-mode: nil