2 rcs_id('$Id: main.php,v 1.115 2004-02-15 21:34:37 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()) or empty($user->_level)) {
44 $user = UpgradeUser($this->_user,$user);
46 $this->_prefs = $this->_user->_prefs;
48 $user = WikiUser($userid);
49 //Todo: upgrade later at updateAuthAndPrefs()
50 if (isset($this->_user))
51 $user = UpgradeUser($this->_user,$user);
53 $this->_prefs = $this->_user->_prefs;
56 // no upgrade from session
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));
83 // This really maybe should be part of the constructor, but since it
84 // may involve HTML/template output, the global $request really needs
85 // to be initialized before we do this stuff.
86 function updateAuthAndPrefs () {
88 // Handle preference updates, and authentication requests, if any.
89 if ($new_prefs = $this->getArg('pref')) {
90 $this->setArg('pref', false);
91 if ($this->isPost() and !empty($new_prefs['passwd']) and
92 ($new_prefs['passwd2'] != $new_prefs['passwd'])) {
94 $this->_prefs->set('passwd','');
95 // $this->_prefs->set('passwd2',''); // This is not stored anyway
98 foreach ($new_prefs as $key => $val) {
99 if ($key == 'passwd') {
101 $val = crypt('passwd');
103 $this->_prefs->set($key, $val);
108 // FIXME: need to move authentication request processing
109 // up to be before pref request processing, I think,
110 // since logging in may change which preferences
111 // we're talking about...
113 // even we have disallow anon users?
114 // if (! $this->_user ) $this->_user = new _AnonUser();
116 // Handle authentication request, if any.
117 if ($auth_args = $this->getArg('auth')) {
118 $this->setArg('auth', false);
119 $this->_handleAuthRequest($auth_args); // possible NORETURN
121 elseif ( ! $this->_user or ! $this->_user->isSignedIn() ) {
122 // If not auth request, try to sign in as saved user.
123 if (($saved_user = $this->getPref('userid')) != false) {
124 $this->_signIn($saved_user);
128 // Save preferences in session and cookie
129 if (isset($this->_user) and
130 (!isset($this->_user->_authhow) or $this->_user->_authhow != 'session')) {
132 $this->_user->setPreferences($this->_prefs, $id_only);
134 $this->setSessionVar('wiki_user', $this->_user);
135 //$this->setSessionVar('wiki_prefs', $this->_prefs);
138 // Ensure user has permissions for action
139 $require_level = $this->requiredAuthority($this->getArg('action'));
140 if (! $this->_user->hasAuthority($require_level))
141 $this->_notAuthorized($require_level); // NORETURN
144 function getUser () {
148 function getPrefs () {
149 return $this->_prefs;
152 // Convenience function:
153 function getPref ($key) {
154 if (isset($this->_prefs))
155 return $this->_prefs->get($key);
163 * Get requested page from the page database.
164 * By default it will grab the page requested via the URL
166 * This is a convenience function.
167 * @param string $pagename Name of page to get.
168 * @return WikiDB_Page Object with methods to pull data from
169 * database for the page requested.
171 function getPage ($pagename = false) {
172 if (!isset($this->_dbi))
175 $pagename = $this->getArg('pagename');
176 return $this->_dbi->getPage($pagename);
179 /** Get URL for POST actions.
181 * Officially, we should just use SCRIPT_NAME (or some such),
182 * but that causes problems when we try to issue a redirect, e.g.
183 * after saving a page.
185 * Some browsers (at least NS4 and Mozilla 0.97 won't accept
186 * a redirect from a page to itself.)
188 * So, as a HACK, we include pagename and action as query args in
189 * the URL. (These should be ignored when we receive the POST
192 function getPostURL ($pagename=false) {
193 if ($pagename === false)
194 $pagename = $this->getArg('pagename');
195 $action = $this->getArg('action');
196 if (!empty($_GET['start_debug'])) // zend ide support
197 return WikiURL($pagename, array('action' => $action, 'start_debug' => 1));
199 return WikiURL($pagename, array('action' => $action));
202 function _handleAuthRequest ($auth_args) {
203 if (!is_array($auth_args))
206 // Ignore password unless POST'ed.
207 if (!$this->isPost())
208 unset($auth_args['passwd']);
210 $olduser = $this->_user;
211 $user = $this->_user->AuthCheck($auth_args);
212 if (isa($user,WikiUserClassname())) {
213 // Successful login (or logout.)
214 $this->_setUser($user);
216 elseif (is_string($user)) {
217 // Login attempt failed.
218 $fail_message = $user;
219 $auth_args['pass_required'] = true;
220 // If no password was submitted, it's not really
221 // a failure --- just need to prompt for password...
222 if (!isset($auth_args['passwd'])) {
223 //$auth_args['pass_required'] = false;
224 $fail_message = false;
226 $olduser->PrintLoginForm($this, $auth_args, $fail_message);
227 $this->finish(); //NORETURN
230 // Login request cancelled.
235 * Attempt to sign in (bogo-login).
239 * @param $userid string Userid to attempt to sign in as.
242 function _signIn ($userid) {
243 if (ENABLE_USER_NEW) {
245 $this->_user = new _BogoUser($userid);
247 $this->_user = new _PassUser($userid);
249 $user = $this->_user->AuthCheck(array('userid' => $userid));
250 if (isa($user,WikiUserClassname())) {
251 $this->_setUser($user); // success!
255 // login or logout or restore state
256 function _setUser ($user) {
257 $this->_user = $user;
258 $this->setCookieVar('WIKI_ID', $user->getAuthenticatedId(), 365);
259 $this->setSessionVar('wiki_user', $user);
260 if ($user->isSignedIn())
261 $user->_authhow = 'signin';
263 // Save userid to prefs..
264 if (!($this->_prefs = $this->_user->getPreferences()))
265 $this->_prefs = $this->_user->_prefs;
266 $this->_prefs->set('userid',
267 $user->isSignedIn() ? $user->getId() : '');
270 /* Permission system */
272 function _notAuthorized ($require_level) {
273 // Display the authority message in the Wiki's default
274 // language, in case it is not english.
276 // Note that normally a user will not see such an error once
277 // logged in, unless the admin has altered the default
278 // disallowed wikiactions. In that case we should probably
279 // check the user's language prefs too at this point; this
280 // would be a situation which is not really handled with the
282 update_locale(DEFAULT_LANGUAGE);
284 // User does not have required authority. Prompt for login.
285 $what = $this->getActionDescription($this->getArg('action'));
287 if ($require_level == WIKIAUTH_FORBIDDEN) {
288 $this->finish(fmt("%s is disallowed on this wiki.",
289 $this->getDisallowedActionDescription($this->getArg('action'))));
291 elseif ($require_level == WIKIAUTH_BOGO)
292 $msg = fmt("You must sign in to %s.", $what);
293 elseif ($require_level == WIKIAUTH_USER)
294 $msg = fmt("You must log in to %s.", $what);
296 $msg = fmt("You must be an administrator to %s.", $what);
297 $pass_required = ($require_level >= WIKIAUTH_USER);
299 $this->_user->PrintLoginForm($this, compact('require_level','pass_required'), $msg);
300 $this->finish(); // NORETURN
303 // Fixme: for PagePermissions we'll need other strings,
304 // relevant to the requested page, not just for the action on the whole wiki.
305 function getActionDescription($action) {
306 static $actionDescriptions;
307 if (! $actionDescriptions) {
309 = array('browse' => _("browse pages in this wiki"),
310 'diff' => _("diff pages in this wiki"),
311 'dumphtml' => _("dump html pages from this wiki"),
312 'dumpserial' => _("dump serial pages from this wiki"),
313 'edit' => _("edit pages in this wiki"),
314 'create' => _("create pages in this wiki"),
315 'loadfile' => _("load files into this wiki"),
316 'lock' => _("lock pages in this wiki"),
317 'remove' => _("remove pages from this wiki"),
318 'unlock' => _("unlock pages in this wiki"),
319 'upload' => _("upload a zip dump to this wiki"),
320 'verify' => _("verify the current action"),
321 'viewsource' => _("view the source of pages in this wiki"),
322 'xmlrpc' => _("access this wiki via XML-RPC"),
323 'zip' => _("download a zip dump from this wiki"),
324 'ziphtml' => _("download an html zip dump from this wiki")
327 if (in_array($action, array_keys($actionDescriptions)))
328 return $actionDescriptions[$action];
332 function getDisallowedActionDescription($action) {
333 static $disallowedActionDescriptions;
334 if (! $disallowedActionDescriptions) {
335 $disallowedActionDescriptions
336 = array('browse' => _("Browsing pages"),
337 'diff' => _("Diffing pages"),
338 'dumphtml' => _("Dumping html pages"),
339 'dumpserial' => _("Dumping serial pages"),
340 'edit' => _("Editing pages"),
341 'create' => _("Creating pages"),
342 'loadfile' => _("Loading files"),
343 'lock' => _("Locking pages"),
344 'remove' => _("Removing pages"),
345 'unlock' => _("Unlocking pages"),
346 'upload' => _("Uploading zip dumps"),
347 'verify' => _("Verify the current action"),
348 'viewsource' => _("Viewing the source of pages"),
349 'xmlrpc' => _("XML-RPC access"),
350 'zip' => _("Downloading zip dumps"),
351 'ziphtml' => _("Downloading html zip dumps")
354 if (in_array($action, array_keys($disallowedActionDescriptions)))
355 return $disallowedActionDescriptions[$action];
360 function requiredAuthority ($action) {
361 $auth = $this->requiredAuthorityForAction($action);
364 * This is a hook for plugins to require authority
365 * for posting to them.
367 * IMPORTANT: this is not a secure check, so the plugin
368 * may not assume that any POSTs to it are authorized.
369 * All this does is cause PhpWiki to prompt for login
370 * if the user doesn't have the required authority.
372 if ($this->isPost()) {
373 $post_auth = $this->getArg('require_authority_for_post');
374 if ($post_auth !== false)
375 $auth = max($auth, $post_auth);
380 function requiredAuthorityForAction ($action) {
381 if (class_exists("PagePermission")) {
382 return requiredAuthorityForPage($action);
392 return WIKIAUTH_ANON;
396 if (defined('ZIPDUMP_AUTH') && ZIPDUMP_AUTH)
397 return WIKIAUTH_ADMIN;
398 return WIKIAUTH_ANON;
401 if (defined('REQUIRE_SIGNIN_BEFORE_EDIT') && REQUIRE_SIGNIN_BEFORE_EDIT)
402 return WIKIAUTH_BOGO;
403 return WIKIAUTH_ANON;
404 // return WIKIAUTH_BOGO;
407 $page = $this->getPage();
408 $current = $page->getCurrentRevision();
409 if ($current->hasDefaultContents())
410 return $this->requiredAuthorityForAction('edit');
411 return $this->requiredAuthorityForAction('browse');
420 return WIKIAUTH_ADMIN;
422 global $WikiNameRegexp;
423 if (preg_match("/$WikiNameRegexp\Z/A", $action))
424 return WIKIAUTH_ANON; // ActionPage.
426 return WIKIAUTH_ADMIN;
430 /* End of Permission system */
432 function possiblyDeflowerVirginWiki () {
433 if ($this->getArg('action') != 'browse')
435 if ($this->getArg('pagename') != HOME_PAGE)
438 $page = $this->getPage();
439 $current = $page->getCurrentRevision();
440 if ($current->getVersion() > 0)
441 return; // Homepage exists.
443 include('lib/loadsave.php');
445 $this->finish(); // NORETURN
448 function handleAction () {
449 $action = $this->getArg('action');
450 $method = "action_$action";
451 if (method_exists($this, $method)) {
454 elseif ($page = $this->findActionPage($action)) {
455 $this->actionpage($page);
458 $this->finish(fmt("%s: Bad action", $action));
462 function finish ($errormsg = false) {
466 exit(); // just in case CloseDataBase calls us
469 if (!empty($this->_dbi))
470 $this->_dbi->close();
474 global $ErrorManager;
475 $ErrorManager->flushPostponedErrors();
477 if (!empty($errormsg)) {
480 HTML::h2(_("Fatal PhpWiki Error")),
483 echo "\n</body></html>";
490 function _deducePagename () {
491 if ($this->getArg('pagename'))
492 return $this->getArg('pagename');
495 $pathinfo = $this->get('PATH_INFO');
496 $tail = substr($pathinfo, strlen(PATH_INFO_PREFIX));
498 if ($tail && $pathinfo == PATH_INFO_PREFIX . $tail) {
502 elseif ($this->isPost()) {
504 * In general, for security reasons, HTTP_GET_VARS should be ignored
505 * on POST requests, but we make an exception here (only for pagename).
507 * The justifcation for this hack is the following
508 * asymmetry: When POSTing with USE_PATH_INFO set, the
509 * pagename can (and should) be communicated through the
510 * request URL via PATH_INFO. When POSTing with
511 * USE_PATH_INFO off, this cannot be done --- the only way
512 * to communicate the pagename through the URL is via
513 * QUERY_ARGS (HTTP_GET_VARS).
515 global $HTTP_GET_VARS;
516 if (isset($HTTP_GET_VARS['pagename'])) {
517 return $HTTP_GET_VARS['pagename'];
522 * Support for PhpWiki 1.2 style requests.
524 $query_string = $this->get('QUERY_STRING');
525 if (preg_match('/^[^&=]+$/', $query_string)) {
526 return urldecode($query_string);
532 function _deduceAction () {
533 if (!($action = $this->getArg('action'))) {
534 // Detect XML-RPC requests
536 && $this->get('CONTENT_TYPE') == 'text/xml') {
537 global $HTTP_RAW_POST_DATA;
538 if (strstr($HTTP_RAW_POST_DATA, '<methodCall>')) {
543 return 'browse'; // Default if no action specified.
546 if (method_exists($this, "action_$action"))
549 // Allow for, e.g. action=LikePages
550 if ($this->isActionPage($action))
553 trigger_error("$action: Unknown action", E_USER_NOTICE);
557 function _deduceUsername() {
558 if (!empty($this->args['auth']) and !empty($this->args['auth']['userid']))
559 return $this->args['auth']['userid'];
561 if ($user = $this->getSessionVar('wiki_user')) {
562 $this->_user = $user;
563 $this->_user->_authhow = 'session';
564 return $user->UserName();
566 if ($userid = $this->getCookieVar('WIKI_ID')) {
567 if (!empty($this->_user))
568 $this->_user->authhow = 'cookie';
574 function _isActionPage ($pagename) {
575 $dbi = $this->getDbh();
576 $page = $dbi->getPage($pagename);
577 $rev = $page->getCurrentRevision();
578 // FIXME: more restrictive check for sane plugin?
579 if (strstr($rev->getPackedContent(), '<?plugin'))
581 if (!$rev->hasDefaultContents())
582 trigger_error("$pagename: Does not appear to be an 'action page'", E_USER_NOTICE);
586 function findActionPage ($action) {
589 // check for translated version, as per users preferred language
590 // (or system default in case it is not en)
591 $translation = gettext($action);
593 if (isset($cache) and isset($cache[$translation]))
594 return $cache[$translation];
596 // check for cached translated version
597 if ($this->_isActionPage($translation))
598 return $cache[$action] = $translation;
600 // Allow for, e.g. action=LikePages
601 global $WikiNameRegexp;
602 if (!preg_match("/$WikiNameRegexp\\Z/A", $action))
603 return $cache[$action] = false;
605 // check for translated version (default language)
607 if ($LANG != DEFAULT_LANGUAGE and $LANG != "en") {
609 //trigger_error("DEBUG: findActionPage() ". DEFAULT_LANGUAGE." calling update_locale()...");
610 update_locale(DEFAULT_LANGUAGE);
611 $default = gettext($action);
612 //trigger_error("DEBUG: findActionPage() ". $save_lang." restoring save_lang, calling update_locale()...");
613 update_locale($save_lang);
614 if ($this->_isActionPage($default))
615 return $cache[$action] = $default;
618 $default = $translation;
621 // check for english version
622 if ($action != $translation and $action != $default) {
623 if ($this->_isActionPage($action))
624 return $cache[$action] = $action;
627 trigger_error("$action: Cannot find action page", E_USER_NOTICE);
628 return $cache[$action] = false;
631 function isActionPage ($pagename) {
632 return $this->findActionPage($pagename);
635 function action_browse () {
636 $this->buffer_output();
637 include_once("lib/display.php");
641 function action_verify () {
642 $this->action_browse();
645 function actionpage ($action) {
646 $this->buffer_output();
647 include_once("lib/display.php");
648 actionPage($this, $action);
651 function action_diff () {
652 $this->buffer_output();
653 include_once "lib/diff.php";
657 function action_search () {
658 // This is obsolete: reformulate URL and redirect.
659 // FIXME: this whole section should probably be deleted.
660 if ($this->getArg('searchtype') == 'full') {
661 $search_page = _("FullTextSearch");
664 $search_page = _("TitleSearch");
666 $this->redirect(WikiURL($search_page,
667 array('s' => $this->getArg('searchterm')),
671 function action_edit () {
672 $this->buffer_output();
673 include "lib/editpage.php";
674 $e = new PageEditor ($this);
678 function action_create () {
679 $this->action_edit();
682 function action_viewsource () {
683 $this->buffer_output();
684 include "lib/editpage.php";
685 $e = new PageEditor ($this);
689 function action_lock () {
690 $page = $this->getPage();
691 $page->set('locked', true);
692 $this->action_browse();
695 function action_unlock () {
696 // FIXME: This check is redundant.
697 //$user->requireAuth(WIKIAUTH_ADMIN);
698 $page = $this->getPage();
699 $page->set('locked', false);
700 $this->action_browse();
703 function action_remove () {
704 // FIXME: This check is redundant.
705 //$user->requireAuth(WIKIAUTH_ADMIN);
706 $pagename = $this->getArg('pagename');
707 if (strstr($pagename,_('PhpWikiAdministration'))) {
708 $this->action_browse();
710 include('lib/removepage.php');
716 function action_upload () {
717 include_once("lib/loadsave.php");
721 function action_xmlrpc () {
722 include_once("lib/XmlRpcServer.php");
723 $xmlrpc = new XmlRpcServer($this);
727 function action_zip () {
728 include_once("lib/loadsave.php");
730 // I don't think it hurts to add cruft at the end of the zip file.
731 echo "\n========================================================\n";
732 echo "PhpWiki " . PHPWIKI_VERSION . " source:\n$GLOBALS[RCS_IDS]\n";
735 function action_ziphtml () {
736 include_once("lib/loadsave.php");
737 MakeWikiZipHtml($this);
738 // I don't think it hurts to add cruft at the end of the zip file.
739 echo "\n========================================================\n";
740 echo "PhpWiki " . PHPWIKI_VERSION . " source:\n$GLOBALS[RCS_IDS]\n";
743 function action_dumpserial () {
744 include_once("lib/loadsave.php");
748 function action_dumphtml () {
749 include_once("lib/loadsave.php");
750 DumpHtmlToDir($this);
753 function action_loadfile () {
754 include_once("lib/loadsave.php");
755 LoadFileOrDir($this);
760 function is_safe_action ($action) {
761 return WikiRequest::requiredAuthorityForAction($action) < WIKIAUTH_ADMIN;
764 function validateSessionPath() {
765 // Try to defer any session.save_path PHP errors before any html
766 // is output, which causes some versions of IE to display a blank
767 // page (due to its strict mode while parsing a page?).
768 if (! is_writeable(ini_get('session.save_path'))) {
771 (sprintf(_("%s is not writable."),
772 _("The session.save_path directory"))
774 . sprintf(_("Please ensure that %s is writable, or redefine %s in index.php."),
775 sprintf(_("the directory '%s'"),
776 ini_get('session.save_path')),
779 . sprintf(_("Attempting to use the directory '%s' instead."),
782 if (! is_writeable($tmpdir)) {
784 (sprintf(_("%s is not writable."), $tmpdir)
786 . _("Users will not be able to sign in.")
790 ini_set('session.save_path', $tmpdir);
796 validateSessionPath();
800 $request = new WikiRequest();
803 * Allow for disabling of markup cache.
804 * (Mostly for debugging ... hopefully.)
806 * See also <?plugin WikiAdminUtils action=purge-cache ?>
808 if (!defined('WIKIDB_NOCACHE_MARKUP') and $request->getArg('nocache'))
809 define('WIKIDB_NOCACHE_MARKUP', $request->getArg('nocache'));
811 // Initialize with system defaults in case user not logged in.
812 // Should this go into constructor?
813 $request->initializeTheme();
815 $request->updateAuthAndPrefs();
816 // initialize again with user's prefs
817 $request->initializeTheme();
818 $request->initializeLang();
820 // Enable the output of most of the warning messages.
821 // The warnings will screw up zip files though.
822 global $ErrorManager;
823 if (substr($request->getArg('action'), 0, 3) != 'zip') {
824 $ErrorManager->setPostponedErrorMask(E_NOTICE|E_USER_NOTICE);
825 //$ErrorManager->setPostponedErrorMask(0);
829 //if ($user->is_authenticated())
830 // $LogEntry->user = $user->getId();
832 $request->possiblyDeflowerVirginWiki();
834 if(defined('WIKI_XMLRPC')) return;
836 $validators = array('wikiname' => WIKI_NAME,
837 'args' => hash($request->getArgs()),
838 'prefs' => hash($request->getPrefs()));
839 if (CACHE_CONTROL == 'STRICT') {
840 $dbi = $request->getDbh();
841 $timestamp = $dbi->getTimestamp();
842 $validators['mtime'] = $timestamp;
843 $validators['%mtime'] = (int)$timestamp;
845 // FIXME: we should try to generate strong validators when possible,
846 // but for now, our validator is weak, since equal validators do not
847 // indicate byte-level equality of content. (Due to DEBUG timing output, etc...)
849 // (If DEBUG if off, this may be a strong validator, but I'm going
850 // to go the paranoid route here pending further study and testing.)
852 $validators['%weak'] = true;
854 $request->setValidators($validators);
856 $request->handleAction();
858 if (defined('DEBUG') and DEBUG>1) phpinfo(INFO_VARIABLES);
866 // $Log: not supported by cvs2svn $
867 // Revision 1.114 2004/02/15 17:30:13 rurban
868 // workaround for lost db connnection handle on session restauration (->_auth_dbi)
869 // fixed getPreferences() (esp. from sessions)
870 // fixed setPreferences() (update and set),
871 // fixed AdoDb DB statements,
872 // update prefs only at UserPreferences POST (for testing)
873 // unified db prefs methods (but in external pref classes yet)
875 // Revision 1.113 2004/02/12 13:05:49 rurban
876 // Rename functional for PearDB backend
877 // some other minor changes
878 // SiteMap comes with a not yet functional feature request: includepages (tbd)
880 // Revision 1.112 2004/02/09 03:58:12 rurban
881 // for now default DB_SESSION to false
883 // * not existing perms will now query the parent, and not
884 // return the default perm
885 // * added pagePermissions func which returns the object per page
886 // * added getAccessDescription
888 // * added global ->prepare (not yet used) with smart user/pref/member table prefixing.
889 // * force init of authdbh in the 2 db classes
891 // * fixed session handling (not triple auth request anymore)
892 // * don't store cookie prefs with sessions
893 // stdlib: global obj2hash helper from _AuthInfo, also needed for PagePerm
895 // Revision 1.111 2004/02/07 10:41:25 rurban
896 // fixed auth from session (still double code but works)
898 // fixed DbPassUser upgrade and policy=old
901 // Revision 1.110 2004/02/03 09:45:39 rurban
902 // LDAP cleanup, start of new Pref classes
904 // Revision 1.109 2004/01/30 19:57:58 rurban
905 // fixed DBAuthParams['pref_select']: wrong _auth_dbi object used.
907 // Revision 1.108 2004/01/28 14:34:14 rurban
908 // session table takes the common prefix
909 // + various minor stuff
910 // reallow password changing
912 // Revision 1.107 2004/01/27 23:23:39 rurban
913 // renamed ->Username => _userid for consistency
914 // renamed mayCheckPassword => mayCheckPass
915 // fixed recursion problem in WikiUserNew
916 // fixed bogo login (but not quite 100% ready yet, password storage)
918 // Revision 1.106 2004/01/26 09:17:49 rurban
919 // * changed stored pref representation as before.
920 // the array of objects is 1) bigger and 2)
921 // less portable. If we would import packed pref
922 // objects and the object definition was changed, PHP would fail.
923 // This doesn't happen with an simple array of non-default values.
924 // * use $prefs->retrieve and $prefs->store methods, where retrieve
925 // understands the interim format of array of objects also.
926 // * simplified $prefs->get() and fixed $prefs->set()
927 // * added $user->_userid and class '_WikiUser' portability functions
928 // * fixed $user object ->_level upgrading, mostly using sessions.
929 // this fixes yesterdays problems with loosing authorization level.
930 // * fixed WikiUserNew::checkPass to return the _level
931 // * fixed WikiUserNew::isSignedIn
932 // * added explodePageList to class PageList, support sortby arg
933 // * fixed UserPreferences for WikiUserNew
934 // * fixed WikiPlugin for empty defaults array
935 // * UnfoldSubpages: added pagename arg, renamed pages arg,
936 // removed sort arg, support sortby arg
938 // Revision 1.105 2004/01/25 03:57:15 rurban
939 // WikiUserNew support (temp. ENABLE_USER_NEW constant)
941 // Revision 1.104 2003/12/26 06:41:16 carstenklapp
942 // Bugfix: Try to defer OS errors about session.save_path and ACCESS_LOG,
943 // so they don't prevent IE from partially (or not at all) rendering the
944 // page. This should help a little for the IE user who encounters trouble
945 // when setting up a new PhpWiki for the first time.
947 // Revision 1.103 2003/12/02 00:10:00 carstenklapp
948 // Bugfix: Ongoing work to untangle UserPreferences/WikiUser/request code
949 // mess: UserPreferences should take effect immediately now upon signing
952 // Revision 1.102 2003/11/25 22:55:32 carstenklapp
953 // Localization bugfix: For wikis where English is not the default system
954 // language, make sure that the authority error message (i.e. "You must
955 // sign in to edit pages in this wiki" etc.) is displayed in the wiki's
956 // default language. Previously it would always display in English.
957 // (Added call to update_locale() before displaying any messages prior to
958 // the login prompt.)
960 // Revision 1.101 2003/11/25 21:49:44 carstenklapp
961 // Bugfix: For a non-english wiki or when the user's preference is not
962 // english, the wiki would always use the english ActionPage first if it
963 // was present rather than the appropriate localised variant. (PhpWikis
964 // running only in english or Wikis running ONLY without any english
965 // ActionPages would not notice this bug, only when both english and
966 // localised ActionPages were in the DB.) Now we check for the localised
969 // Revision 1.100 2003/11/18 16:54:18 carstenklapp
970 // Reformatting only: Tabs to spaces, added rcs log.
978 // c-hanging-comment-ender-p: nil
979 // indent-tabs-mode: nil