2 rcs_id('$Id: Request.php,v 1.53 2004-05-03 21:57:47 rurban Exp $');
4 Copyright (C) 2002,2004 $ThePhpWikiProgrammingTeam
6 This file is part of PhpWiki.
8 PhpWiki is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 PhpWiki is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with PhpWiki; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 // backward compatibility for PHP < 4.2.0
24 if (!function_exists('ob_clean')) {
35 $this->_fix_magic_quotes_gpc();
36 $this->_fix_multipart_form_data();
38 switch($this->get('REQUEST_METHOD')) {
41 $this->args = &$GLOBALS['HTTP_GET_VARS'];
44 $this->args = &$GLOBALS['HTTP_POST_VARS'];
47 $this->args = array();
51 $this->session = new Request_SessionVars;
52 $this->cookies = new Request_CookieVars;
55 if (! is_writeable(ACCESS_LOG)) {
57 (sprintf(_("%s is not writable."), _("The PhpWiki access log file"))
59 . sprintf(_("Please ensure that %s is writable, or redefine %s in index.php."),
60 sprintf(_("the file '%s'"), ACCESS_LOG),
65 $this->_log_entry = & new Request_AccessLogEntry($this,
69 $GLOBALS['request'] = $this;
73 if (!empty($GLOBALS['HTTP_SERVER_VARS']))
74 $vars = &$GLOBALS['HTTP_SERVER_VARS'];
75 else // cgi or other servers than Apache
76 $vars = &$GLOBALS['_ENV'];
78 if (isset($vars[$key]))
83 $addr = $vars['REMOTE_ADDR'];
84 if (defined('ENABLE_REVERSE_DNS') && ENABLE_REVERSE_DNS)
85 return $vars[$key] = gethostbyaddr($addr);
93 function getArg($key) {
94 if (isset($this->args[$key]))
95 return $this->args[$key];
103 function setArg($key, $val) {
105 unset($this->args[$key]);
107 $this->args[$key] = $val;
110 // Well oh well. Do we really want to pass POST params back as GET?
111 function getURLtoSelf($args = false, $exclude = array()) {
112 $get_args = $this->args;
114 $get_args = array_merge($get_args, $args);
116 // Err... good point...
118 if ($this->isPost()) {
119 $exclude = array_merge($exclude, array('action','auth'));
120 //$get_args = $args; // or only the provided
122 trigger_error("Request::getURLtoSelf() should probably not be from POST",
127 foreach ($exclude as $ex) {
128 if (!empty($get_args[$ex])) unset($get_args[$ex]);
131 $pagename = $get_args['pagename'];
132 unset ($get_args['pagename']);
133 if (!empty($get_args['action']) and $get_args['action'] == 'browse')
134 unset($get_args['action']);
136 return WikiURL($pagename, $get_args);
140 return $this->get("REQUEST_METHOD") == "POST";
143 function isGetOrHead () {
144 return in_array($this->get('REQUEST_METHOD'),
145 array('GET', 'HEAD'));
148 function httpVersion() {
149 if (!preg_match('@HTTP\s*/\s*(\d+.\d+)@', $this->get('SERVER_PROTOCOL'), $m))
151 return (float) $m[1];
154 function redirect($url, $noreturn=true) {
155 $bogus = defined('DISABLE_HTTP_REDIRECT') and DISABLE_HTTP_REDIRECT;
158 header("Location: $url");
160 * "302 Found" is not really meant to be sent in response
161 * to a POST. Worse still, according to (both HTTP 1.0
162 * and 1.1) spec, the user, if it is sent, the user agent
163 * is supposed to use the same method to fetch the
164 * redirected URI as the original.
166 * That means if we redirect from a POST, the user-agent
167 * supposed to generate another POST. Not what we want.
168 * (We do this after a page save after all.)
170 * Fortunately, most/all browsers don't do that.
172 * "303 See Other" is what we really want. But it only
175 * FIXME: this is still not spec compliant for HTTP
178 $status = $this->httpVersion() >= 1.1 ? 303 : 302;
180 $this->setStatus($status);
184 include_once('lib/Template.php');
185 $this->discardOutput();
186 $tmpl = new Template('redirect', $this, array('REDIRECT_URL' => $url));
192 function redirect(url) {
193 if (typeof location.replace == 'function')
194 location.replace(url);
195 else if (typeof location.assign == 'function')
196 location.assign(url);
198 window.location = url;
200 redirect('" . addslashes($url) . "')");
204 /** Set validators for this response.
206 * This sets a (possibly incomplete) set of validators
209 * The validator set can be extended using appendValidators().
211 * When you're all done setting and appending validators, you
212 * must call checkValidators() to check them and set the
213 * appropriate headers in the HTTP response.
217 * $request->setValidators(array('pagename' => $pagename,
218 * '%mtime' => $rev->get('mtime')));
220 * // Wups... response content depends on $otherpage, too...
221 * $request->appendValidators(array('otherpage' => $otherpagerev->getPageName(),
222 * '%mtime' => $otherpagerev->get('mtime')));
224 * // After all validators have been set:
225 * $request->checkValidators();
227 function setValidators($validator_set) {
228 if (is_array($validator_set))
229 $validator_set = new HTTP_ValidatorSet($validator_set);
230 $this->_validators = $validator_set;
233 /** Append more validators for this response.
234 * i.e dependencies on other pages mtimes
235 * now it may be called in init also to simplify client code.
237 function appendValidators($validator_set) {
238 if (!isset($this->_validators)) {
239 $this->setValidators($validator_set);
242 $this->_validators->append($validator_set);
245 /** Check validators and set headers in HTTP response
247 * This sets the appropriate "Last-Modified" and "ETag"
248 * headers in the HTTP response.
250 * Additionally, if the validators match any(all) conditional
251 * headers in the HTTP request, this method will not return, but
252 * instead will send "304 Not Modified" or "412 Precondition
253 * Failed" (as appropriate) back to the client.
255 function checkValidators() {
256 $validators = &$this->_validators;
258 // Set validator headers
259 if (($etag = $validators->getETag()) !== false)
260 header("ETag: " . $etag->asString());
261 if (($mtime = $validators->getModificationTime()) !== false)
262 header("Last-Modified: " . Rfc1123DateTime($mtime));
264 // Set cache control headers
265 $this->cacheControl();
267 if (CACHE_CONTROL == 'NONE')
268 return; // don't check conditionals...
270 // Check conditional headers in request
271 $status = $validators->checkConditionalRequest($this);
273 // Return short response due to failed conditionals
274 $this->setStatus($status);
276 $this->discardOutput();
282 /** Set the cache control headers in the HTTP response.
284 function cacheControl($strategy=CACHE_CONTROL, $max_age=CACHE_CONTROL_MAX_AGE) {
285 if ($strategy == 'NONE') {
286 $cache_control = "no-cache";
289 elseif ($strategy == 'ALLOW_STALE' && $max_age > 0) {
290 $cache_control = sprintf("max-age=%d", $max_age);
293 $cache_control = "must-revalidate";
296 header("Cache-Control: $cache_control");
297 header("Expires: " . Rfc1123DateTime(time() + $max_age));
298 header("Vary: Cookie"); // FIXME: add more here?
301 function setStatus($status) {
302 if (preg_match('|^HTTP/.*?\s(\d+)|i', $status, $m)) {
307 $status = (integer) $status;
308 $reason = array('200' => 'OK',
310 '303' => 'See Other',
311 '304' => 'Not Modified',
312 '400' => 'Bad Request',
313 '401' => 'Unauthorized',
314 '403' => 'Forbidden',
315 '404' => 'Not Found',
316 '412' => 'Precondition Failed');
317 // FIXME: is it always okay to send HTTP/1.1 here, even for older clients?
318 header(sprintf("HTTP/1.1 %d %s", $status, $reason[$status]));
321 if (isset($this->_log_entry))
322 $this->_log_entry->setStatus($status);
325 function buffer_output($compress = true) {
326 if (defined('COMPRESS_OUTPUT')) {
327 if (!COMPRESS_OUTPUT)
330 elseif (!function_exists('version_compare')
331 || version_compare(phpversion(), '4.2.3', "<")) {
335 // Should we compress even when apache_note is not available?
336 // sf.net bug #933183 and http://bugs.php.net/17557
337 if (!function_exists('ob_gzhandler') or !function_exists('apache_note'))
341 ob_start('ob_gzhandler');
343 * Attempt to prevent Apache from doing the dreaded double-gzip.
345 * It would be better if we could detect when apache was going
346 * to zip for us, and then let it ... but I have yet to figure
347 * out how to do that.
349 if (function_exists('apache_note'))
350 @apache_note('no-gzip', 1);
353 // Now we alway buffer output.
354 // This is so we can set HTTP headers (e.g. for redirect)
356 // FIXME: change the name of this method.
359 $this->_is_buffering_output = true;
362 function discardOutput() {
363 if (!empty($this->_is_buffering_output))
366 trigger_error("Not buffering output", E_USER_NOTICE);
370 if (!empty($this->_is_buffering_output)) {
371 //header(sprintf("Content-Length: %d", ob_get_length()));
377 function getSessionVar($key) {
378 return $this->session->get($key);
380 function setSessionVar($key, $val) {
381 return $this->session->set($key, $val);
383 function deleteSessionVar($key) {
384 return $this->session->delete($key);
387 function getCookieVar($key) {
388 return $this->cookies->get($key);
390 function setCookieVar($key, $val, $lifetime_in_days = false, $path = false) {
391 return $this->cookies->set($key, $val, $lifetime_in_days, $path);
393 function deleteCookieVar($key) {
394 return $this->cookies->delete($key);
397 function getUploadedFile($key) {
398 return Request_UploadedFile::getUploadedFile($key);
402 function _fix_magic_quotes_gpc() {
403 $needs_fix = array('HTTP_POST_VARS',
410 if (get_magic_quotes_gpc()) {
411 foreach ($needs_fix as $vars)
412 $this->_stripslashes($GLOBALS[$vars]);
416 function _stripslashes(&$var) {
417 if (is_array($var)) {
418 foreach ($var as $key => $val)
419 $this->_stripslashes($var[$key]);
421 elseif (is_string($var))
422 $var = stripslashes($var);
425 function _fix_multipart_form_data () {
426 if (preg_match('|^multipart/form-data|', $this->get('CONTENT_TYPE')))
427 $this->_strip_leading_nl($GLOBALS['HTTP_POST_VARS']);
430 function _strip_leading_nl(&$var) {
431 if (is_array($var)) {
432 foreach ($var as $key => $val)
433 $this->_strip_leading_nl($var[$key]);
435 elseif (is_string($var))
436 $var = preg_replace('|^\r?\n?|', '', $var);
440 class Request_SessionVars {
441 function Request_SessionVars() {
442 // Prevent cacheing problems with IE 5
443 session_cache_limiter('none');
449 $vars = &$GLOBALS['HTTP_SESSION_VARS'];
450 if (isset($vars[$key]))
455 function set($key, $val) {
456 $vars = &$GLOBALS['HTTP_SESSION_VARS'];
457 if ($key == 'wiki_user') {
460 trigger_error("delete user session",E_USER_WARNING);
461 } elseif (!$val->_level) {
462 trigger_error("lost level in session",E_USER_WARNING);
465 if (is_object($val)) {
466 $val->page = $GLOBALS['request']->getArg('pagename');
467 $val->action = $GLOBALS['request']->getArg('action');
468 // sessiondata may not exceed a certain size!
469 // otherwise it will get lost.
470 unset($val->_HomePagehandle);
471 unset($val->_auth_dbi);
474 if (!function_usable('get_cfg_var') or get_cfg_var('register_globals')) {
475 // This is funky but necessary, at least in some PHP's
476 $GLOBALS[$key] = $val;
479 if (isset($_SESSION))
480 $_SESSION[$key] = $val;
481 session_register($key);
484 function delete($key) {
485 $vars = &$GLOBALS['HTTP_SESSION_VARS'];
486 if (!function_usable('ini_get') or ini_get('register_globals'))
487 unset($GLOBALS[$key]);
488 if (DEBUG) trigger_error("delete session $key",E_USER_WARNING);
490 session_unregister($key);
494 class Request_CookieVars {
497 $vars = &$GLOBALS['HTTP_COOKIE_VARS'];
498 if (isset($vars[$key])) {
499 @$val = unserialize(base64_decode($vars[$key]));
502 @$val = urldecode($vars[$key]);
509 function get_old($key) {
510 $vars = &$GLOBALS['HTTP_COOKIE_VARS'];
511 if (isset($vars[$key])) {
512 @$val = unserialize(base64_decode($vars[$key]));
515 @$val = unserialize($vars[$key]);
525 function set($key, $val, $persist_days = false, $path = false) {
526 // if already defined, ignore
527 if (defined('MAIN_setUser') and $key = 'WIKI_ID') return;
528 $vars = &$GLOBALS['HTTP_COOKIE_VARS'];
529 if (is_numeric($persist_days)) {
530 $expires = time() + (24 * 3600) * $persist_days;
535 if (is_array($val) or is_object($val))
536 $packedval = base64_encode(serialize($val));
538 $packedval = urlencode($val);
539 $vars[$key] = $packedval;
541 setcookie($key, $packedval, $expires, $path);
543 setcookie($key, $packedval, $expires);
546 function delete($key) {
547 static $deleted = array();
548 if (isset($deleted[$key])) return;
549 $vars = &$GLOBALS['HTTP_COOKIE_VARS'];
550 setcookie($key,'',0);
551 setcookie($key,'',0,defined('COOKIE_DOMAIN') ? COOKIE_DOMAIN : '/');
553 unset($GLOBALS['HTTP_COOKIE_VARS'][$key]);
560 You must set "upload_tmp_dir" = "/tmp/" or "C:/tmp/"
561 Best on the same drive as apache, with forward slashes
562 and with ending slash!
563 Otherwise "\\" => "" and the uploaded file will not be found.
565 class Request_UploadedFile {
566 function getUploadedFile($postname) {
567 global $HTTP_POST_FILES;
569 if (!isset($HTTP_POST_FILES[$postname]))
572 $fileinfo = &$HTTP_POST_FILES[$postname];
573 if ($fileinfo['error']) {
574 trigger_error("Upload error: #" . $fileinfo['error'],
579 // With windows/php 4.2.1 is_uploaded_file() always returns false.
580 if (!is_uploaded_file($fileinfo['tmp_name'])) {
582 if (!$tmp_file = get_cfg_var('upload_tmp_dir')) {
583 $tmp_file = dirname(tempnam('', ''));
585 $tmp_file .= '/' . basename($fileinfo['tmp_name']);
586 /* but ending slash in php.ini upload_tmp_dir is required. */
587 if (ereg_replace('/+', '/', $tmp_file) != $fileinfo['tmp_name']) {
588 trigger_error(sprintf("Uploaded tmpfile illegal: %s != %s",$tmp_file, $fileinfo['tmp_name']),
592 trigger_error(sprintf("Workaround for PHP/Windows is_uploaded_file() problem for %s.",
593 $fileinfo['tmp_name'])."\n".
594 "Probably illegal TEMP environment setting.",E_USER_NOTICE);
597 trigger_error(sprintf("Uploaded tmpfile %s not found.",$fileinfo['tmp_name'])."\n".
598 " Probably illegal TEMP environment setting.",
602 return new Request_UploadedFile($fileinfo);
605 function Request_UploadedFile($fileinfo) {
606 $this->_info = $fileinfo;
610 return $this->_info['size'];
614 return $this->_info['name'];
618 return $this->_info['type'];
621 function getTmpName() {
622 return $this->_info['tmp_name'];
626 if ( ($fd = fopen($this->_info['tmp_name'], "rb")) ) {
627 if ($this->getSize() < filesize($this->_info['tmp_name'])) {
628 // FIXME: Some PHP's (or is it some browsers?) put
629 // HTTP/MIME headers in the file body, some don't.
631 // At least, I think that's the case. I know I used
632 // to need this code, now I don't.
634 // This code is more-or-less untested currently.
636 // Dump HTTP headers.
637 while ( ($header = fgets($fd, 4096)) ) {
638 if (trim($header) == '') {
641 else if (!preg_match('/^content-(length|type):/i', $header)) {
651 function getContents() {
653 $data = fread($fd, $this->getSize());
660 * Create NCSA "combined" log entry for current request.
662 class Request_AccessLogEntry
667 * The log entry will be automatically appended to the log file
668 * when the current request terminates.
670 * If you want to modify a Request_AccessLogEntry before it gets
671 * written (e.g. via the setStatus and setSize methods) you should
672 * use an '&' on the constructor, so that you're working with the
673 * original (rather than a copy) object.
676 * $log_entry = & new Request_AccessLogEntry($req, "/tmp/wiki_access_log");
677 * $log_entry->setStatus(401);
681 * @param $request object Request object for current request.
682 * @param $logfile string Log file name.
684 function Request_AccessLogEntry (&$request, $logfile) {
685 $this->logfile = $logfile;
687 $this->host = $request->get('REMOTE_HOST');
688 $this->ident = $request->get('REMOTE_IDENT');
691 $this->user = '-'; // FIXME: get logged-in user name
692 $this->time = time();
693 $this->request = join(' ', array($request->get('REQUEST_METHOD'),
694 $request->get('REQUEST_URI'),
695 $request->get('SERVER_PROTOCOL')));
698 $this->referer = (string) $request->get('HTTP_REFERER');
699 $this->user_agent = (string) $request->get('HTTP_USER_AGENT');
701 global $Request_AccessLogEntry_entries;
702 if (!isset($Request_AccessLogEntry_entries)) {
703 register_shutdown_function("Request_AccessLogEntry_shutdown_function");
705 $Request_AccessLogEntry_entries[] = &$this;
709 * Set result status code.
711 * @param $status integer HTTP status code.
713 function setStatus ($status) {
714 $this->status = $status;
720 * @param $size integer
722 function setSize ($size) {
727 * Get time zone offset.
729 * This is a static member function.
731 * @param $time integer Unix timestamp (defaults to current time).
732 * @return string Zone offset, e.g. "-0800" for PST.
734 function _zone_offset ($time = false) {
737 $offset = date("Z", $time);
743 $offhours = floor($offset / 3600);
744 $offmins = $offset / 60 - $offhours * 60;
745 return sprintf("%s%02d%02d", $negoffset, $offhours, $offmins);
749 * Format time in NCSA format.
751 * This is a static member function.
753 * @param $time integer Unix timestamp (defaults to current time).
754 * @return string Formatted date & time.
756 function _ncsa_time($time = false) {
760 return date("d/M/Y:H:i:s", $time) .
761 " " . $this->_zone_offset();
765 * Write entry to log file.
768 $entry = sprintf('%s %s %s [%s] "%s" %d %d "%s" "%s"',
769 $this->host, $this->ident, $this->user,
770 $this->_ncsa_time($this->time),
771 $this->request, $this->status, $this->size,
772 $this->referer, $this->user_agent);
774 //Error log doesn't provide locking.
775 //error_log("$entry\n", 3, $this->logfile);
778 if (($fp = fopen($this->logfile, "a"))) {
780 fputs($fp, "$entry\n");
790 * @see Request_AccessLogEntry
792 function Request_AccessLogEntry_shutdown_function ()
794 global $Request_AccessLogEntry_entries;
796 foreach ($Request_AccessLogEntry_entries as $entry) {
799 unset($Request_AccessLogEntry_entries);
804 function HTTP_ETag($val, $is_weak=false) {
805 $this->_val = hash($val);
806 $this->_weak = $is_weak;
811 * Strong comparison: If either (or both) tag is weak, they
814 function equals($that, $strong_match=false) {
815 if ($this->_val != $that->_val)
817 if ($strong_match and ($this->_weak or $that->_weak))
823 function asString() {
824 $quoted = '"' . addslashes($this->_val) . '"';
825 return $this->_weak ? "W/$quoted" : $quoted;
828 /** Parse tag from header.
830 * This is a static member function.
832 function parse($strval) {
833 if (!preg_match(':^(W/)?"(.+)"$:i', trim($strval), $m))
834 return false; // parse failed
835 list(,$weak,$str) = $m;
836 return new HTTP_ETag(stripslashes($str), $weak);
839 function matches($taglist, $strong_match=false) {
840 $taglist = trim($taglist);
842 if ($taglist == '*') {
844 return ! $this->_weak;
849 while (preg_match('@^(W/)?"((?:\\\\.|[^"])*)"\s*,?\s*@i',
851 list($match, $weak, $str) = $m;
852 $taglist = substr($taglist, strlen($match));
853 $tag = new HTTP_ETag(stripslashes($str), $weak);
854 if ($this->equals($tag, $strong_match)) {
862 // Possible results from the HTTP_ValidatorSet::_check*() methods.
863 // (Higher numerical values take precedence.)
864 define ('_HTTP_VAL_PASS', 0); // Test is irrelevant
865 define ('_HTTP_VAL_NOT_MODIFIED', 1); // Test passed, content not changed
866 define ('_HTTP_VAL_MODIFIED', 2); // Test failed, content changed
867 define ('_HTTP_VAL_FAILED', 3); // Precondition failed.
869 class HTTP_ValidatorSet {
870 function HTTP_ValidatorSet($validators) {
871 $this->_mtime = $this->_weak = false;
872 $this->_tag = array();
874 foreach ($validators as $key => $val) {
875 if ($key == '%mtime') {
876 $this->_mtime = $val;
878 elseif ($key == '%weak') {
883 $this->_tag[$key] = $val;
888 function append($that) {
890 $that = new HTTP_ValidatorSet($that);
892 // Pick the most recent mtime
893 if (isset($that->_mtime))
894 if (!isset($this->_mtime) || $that->_mtime > $this->_mtime)
895 $this->_mtime = $that->_mtime;
897 // If either is weak, we're weak
898 if (!empty($that->_weak))
901 $this->_tag = array_merge($this->_tag, $that->_tag);
907 return new HTTP_ETag($this->_tag, $this->_weak);
910 function getModificationTime() {
911 return $this->_mtime;
914 function checkConditionalRequest (&$request) {
915 $result = max($this->_checkIfUnmodifiedSince($request),
916 $this->_checkIfModifiedSince($request),
917 $this->_checkIfMatch($request),
918 $this->_checkIfNoneMatch($request));
920 if ($result == _HTTP_VAL_PASS || $result == _HTTP_VAL_MODIFIED)
921 return false; // "please proceed with normal processing"
922 elseif ($result == _HTTP_VAL_FAILED)
923 return 412; // "412 Precondition Failed"
924 elseif ($result == _HTTP_VAL_NOT_MODIFIED)
925 return 304; // "304 Not Modified"
927 trigger_error("Ack, shouldn't get here", E_USER_ERROR);
931 function _checkIfUnmodifiedSince(&$request) {
932 if ($this->_mtime !== false) {
933 $since = ParseRfc1123DateTime($request->get("HTTP_IF_UNMODIFIED_SINCE"));
934 if ($since !== false && $this->_mtime > $since)
935 return _HTTP_VAL_FAILED;
937 return _HTTP_VAL_PASS;
940 function _checkIfModifiedSince(&$request) {
941 if ($this->_mtime !== false and $request->isGetOrHead()) {
942 $since = ParseRfc1123DateTime($request->get("HTTP_IF_MODIFIED_SINCE"));
943 if ($since !== false) {
944 if ($this->_mtime <= $since)
945 return _HTTP_VAL_NOT_MODIFIED;
946 return _HTTP_VAL_MODIFIED;
949 return _HTTP_VAL_PASS;
952 function _checkIfMatch(&$request) {
953 if ($this->_tag && ($taglist = $request->get("HTTP_IF_MATCH"))) {
954 $tag = $this->getETag();
955 if (!$tag->matches($taglist, 'strong'))
956 return _HTTP_VAL_FAILED;
958 return _HTTP_VAL_PASS;
961 function _checkIfNoneMatch(&$request) {
962 if ($this->_tag && ($taglist = $request->get("HTTP_IF_NONE_MATCH"))) {
963 $tag = $this->getETag();
964 $strong_compare = ! $request->isGetOrHead();
966 if ($tag->matches($taglist, $strong_compare)) {
967 if ($request->isGetOrHead())
968 return _HTTP_VAL_NOT_MODIFIED;
970 return _HTTP_VAL_FAILED;
972 return _HTTP_VAL_MODIFIED;
975 return _HTTP_VAL_PASS;
980 // $Log: not supported by cvs2svn $
981 // Revision 1.52 2004/05/03 13:16:47 rurban
982 // fixed UserPreferences update, esp for boolean and int
984 // Revision 1.51 2004/05/02 21:26:38 rurban
985 // limit user session data (HomePageHandle and auth_dbi have to invalidated anyway)
986 // because they will not survive db sessions, if too large.
987 // extended action=upgrade
988 // some WikiTranslation button work
989 // revert WIKIAUTH_UNOBTAINABLE (need it for main.php)
990 // some temp. session debug statements
992 // Revision 1.50 2004/04/29 19:39:44 rurban
993 // special support for formatted plugins (one-liners)
994 // like <small><plugin BlaBla ></small>
995 // iter->asArray() helper for PopularNearby
996 // db_session for older php's (no &func() allowed)
998 // Revision 1.49 2004/04/26 20:44:34 rurban
999 // locking table specific for better databases
1001 // Revision 1.48 2004/04/13 09:13:50 rurban
1002 // sf.net bug #933183 and http://bugs.php.net/17557
1003 // disable ob_gzhandler if apache_note cannot be used.
1004 // (conservative until we find why)
1006 // Revision 1.47 2004/04/02 15:06:55 rurban
1007 // fixed a nasty ADODB_mysql session update bug
1008 // improved UserPreferences layout (tabled hints)
1009 // fixed UserPreferences auth handling
1010 // improved auth stability
1011 // improved old cookie handling: fixed deletion of old cookies with paths
1013 // Revision 1.46 2004/03/30 02:14:03 rurban
1014 // fixed yet another Prefs bug
1015 // added generic PearDb_iter
1016 // $request->appendValidators no so strict as before
1017 // added some box plugin methods
1018 // PageList commalist for condensed output
1020 // Revision 1.45 2004/03/24 19:39:02 rurban
1021 // php5 workaround code (plus some interim debugging code in XmlElement)
1022 // php5 doesn't work yet with the current XmlElement class constructors,
1023 // WikiUserNew does work better than php4.
1024 // rewrote WikiUserNew user upgrading to ease php5 update
1025 // fixed pref handling in WikiUserNew
1026 // added Email Notification
1027 // added simple Email verification
1028 // removed emailVerify userpref subclass: just a email property
1029 // changed pref binary storage layout: numarray => hash of non default values
1030 // print optimize message only if really done.
1031 // forced new cookie policy: delete pref cookies, use only WIKI_ID as plain string.
1032 // prefs should be stored in db or homepage, besides the current session.
1034 // Revision 1.44 2004/03/14 16:26:22 rurban
1037 // Revision 1.43 2004/03/12 20:59:17 rurban
1038 // important cookie fix by Konstantin Zadorozhny
1039 // new editpage feature: JS_SEARCHREPLACE
1041 // Revision 1.42 2004/03/10 15:38:48 rurban
1042 // store current user->page and ->action in session for WhoIsOnline
1043 // better WhoIsOnline icon
1044 // fixed WhoIsOnline warnings
1046 // Revision 1.41 2004/02/27 01:25:14 rurban
1047 // Workarounds for upload handling
1049 // Revision 1.40 2004/02/26 01:39:51 rurban
1052 // Revision 1.39 2004/02/24 15:14:57 rurban
1053 // fixed action=upload problems on Win32, and remove Merge Edit buttons: file does not exist anymore
1055 // Revision 1.38 2004/01/25 10:26:02 rurban
1056 // fixed bug [ 541193 ] HTTP_SERVER_VARS are Apache specific
1057 // http://sourceforge.net/tracker/index.php?func=detail&aid=541193&group_id=6121&atid=106121
1058 // CGI and other servers than apache populate _ENV and not _SERVER
1060 // Revision 1.37 2003/12/26 06:41:16 carstenklapp
1061 // Bugfix: Try to defer OS errors about session.save_path and ACCESS_LOG,
1062 // so they don't prevent IE from partially (or not at all) rendering the
1063 // page. This should help a little for the IE user who encounters trouble
1064 // when setting up a new PhpWiki for the first time.
1070 // c-basic-offset: 4
1071 // c-hanging-comment-ender-p: nil
1072 // indent-tabs-mode: nil