You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(43) |
Nov
(73) |
Dec
(10) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(34) |
Feb
(110) |
Mar
(24) |
Apr
(44) |
May
(37) |
Jun
(22) |
Jul
(20) |
Aug
(28) |
Sep
(50) |
Oct
(11) |
Nov
(132) |
Dec
(595) |
2002 |
Jan
(1099) |
Feb
(579) |
Mar
(63) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(125) |
Sep
(101) |
Oct
(25) |
Nov
(34) |
Dec
(47) |
2003 |
Jan
(82) |
Feb
(182) |
Mar
(71) |
Apr
(3) |
May
(1) |
Jun
(3) |
Jul
|
Aug
|
Sep
(14) |
Oct
(6) |
Nov
(124) |
Dec
(68) |
2004 |
Jan
(64) |
Feb
(191) |
Mar
(199) |
Apr
(298) |
May
(252) |
Jun
(426) |
Jul
(134) |
Aug
(13) |
Sep
(96) |
Oct
(75) |
Nov
(232) |
Dec
(171) |
2005 |
Jan
(205) |
Feb
(165) |
Mar
(8) |
Apr
(74) |
May
(21) |
Jun
(19) |
Jul
(37) |
Aug
(69) |
Sep
(141) |
Oct
(118) |
Nov
(31) |
Dec
(7) |
2006 |
Jan
(5) |
Feb
(10) |
Mar
(35) |
Apr
(24) |
May
(34) |
Jun
(29) |
Jul
(5) |
Aug
(38) |
Sep
(30) |
Oct
(37) |
Nov
(30) |
Dec
(86) |
2007 |
Jan
(414) |
Feb
(40) |
Mar
(18) |
Apr
(10) |
May
(66) |
Jun
(60) |
Jul
(105) |
Aug
(55) |
Sep
(64) |
Oct
(7) |
Nov
(11) |
Dec
(5) |
2008 |
Jan
(26) |
Feb
(28) |
Mar
(79) |
Apr
(34) |
May
(61) |
Jun
(24) |
Jul
(29) |
Aug
(160) |
Sep
(62) |
Oct
(70) |
Nov
(32) |
Dec
(14) |
2009 |
Jan
(140) |
Feb
(135) |
Mar
(153) |
Apr
(53) |
May
(24) |
Jun
(138) |
Jul
(90) |
Aug
(46) |
Sep
(72) |
Oct
(84) |
Nov
(32) |
Dec
(4) |
2010 |
Jan
(13) |
Feb
(7) |
Mar
(14) |
Apr
(55) |
May
(89) |
Jun
(131) |
Jul
(41) |
Aug
(38) |
Sep
(42) |
Oct
(11) |
Nov
(27) |
Dec
(54) |
2011 |
Jan
(127) |
Feb
(16) |
Mar
(71) |
Apr
(52) |
May
(32) |
Jun
(31) |
Jul
(4) |
Aug
|
Sep
(45) |
Oct
(26) |
Nov
(36) |
Dec
(10) |
2012 |
Jan
(23) |
Feb
(6) |
Mar
(13) |
Apr
(18) |
May
(1) |
Jun
(4) |
Jul
(3) |
Aug
(12) |
Sep
(57) |
Oct
(96) |
Nov
(163) |
Dec
(124) |
2013 |
Jan
(11) |
Feb
(17) |
Mar
(7) |
Apr
(48) |
May
(15) |
Jun
(29) |
Jul
(12) |
Aug
|
Sep
(9) |
Oct
|
Nov
|
Dec
(3) |
2014 |
Jan
(4) |
Feb
(1) |
Mar
(2) |
Apr
(1) |
May
(8) |
Jun
(90) |
Jul
(104) |
Aug
(12) |
Sep
(81) |
Oct
(139) |
Nov
(111) |
Dec
(64) |
2015 |
Jan
(46) |
Feb
(74) |
Mar
(56) |
Apr
(61) |
May
(3) |
Jun
(7) |
Jul
(11) |
Aug
(5) |
Sep
(15) |
Oct
(1) |
Nov
(1) |
Dec
(15) |
2016 |
Jan
(25) |
Feb
(33) |
Mar
(24) |
Apr
(4) |
May
(24) |
Jun
(3) |
Jul
(75) |
Aug
|
Sep
(2) |
Oct
(38) |
Nov
(4) |
Dec
(18) |
2017 |
Jan
(8) |
Feb
(1) |
Mar
(1) |
Apr
|
May
(14) |
Jun
|
Jul
(5) |
Aug
(9) |
Sep
|
Oct
(23) |
Nov
|
Dec
|
2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
|
Feb
|
Mar
(9) |
Apr
(60) |
May
(1) |
Jun
|
Jul
(13) |
Aug
|
Sep
(11) |
Oct
|
Nov
|
Dec
|
2020 |
Jan
|
Feb
|
Mar
(15) |
Apr
(4) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(47) |
2021 |
Jan
(24) |
Feb
(33) |
Mar
(1) |
Apr
|
May
(1) |
Jun
(64) |
Jul
(71) |
Aug
(114) |
Sep
(82) |
Oct
(32) |
Nov
(76) |
Dec
(86) |
2022 |
Jan
(162) |
Feb
(41) |
Mar
(11) |
Apr
(9) |
May
|
Jun
|
Jul
(1) |
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
(7) |
2023 |
Jan
|
Feb
(1) |
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
(25) |
Aug
|
Sep
|
Oct
|
Nov
(7) |
Dec
|
2024 |
Jan
(7) |
Feb
(3) |
Mar
(3) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2025 |
Jan
|
Feb
(90) |
Mar
(19) |
Apr
|
May
(6) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Geoffrey T. D. <da...@us...> - 2001-02-14 05:22:11
|
Update of /cvsroot/phpwiki/phpwiki In directory usw-pr-cvs1:/tmp/cvs-serv4186 Modified Files: HISTORY README index.php Added Files: phpwiki.css Log Message: log --- NEW FILE --- /* Classes: wikitext wikiword - A wiki page name rawurl - A raw url (like http://some.where.com/howdy.jpg) interwiki - An interwiki name linkurl - A link to an external URL interwikilink - A link to an external wiki wikilink = A link to an existing page wikiunknown = A link to a non-existing page wikiaction - A link which to an action (edit, diff, info...) wikiadmin - A link to an admin action (lock, remove ...) wikiunsafe - A link to an admin action which is located on an unlocked page. */ TABLE.outer { background-color: black; } TABLE.inner { background-color: white; } /* * WikiWords in sans-serif */ .wikiword { font-family: avantgarde, helvetica, sans-serif; } PRE .wikiword, TT .wikiword { font-family: monospace; } H1 .wikiword { font-size: large; } SMALL .wikiword { font-size: small; } .interwiki { font-family: zapf chancery, cursive; } /* * Raw URLS in smaller font */ .rawurl { font-family: serif; font-size: smaller; } /* * No underline for wikilinks. */ .wikilink, .wikiunknown, .wikiunknown U, .wikiaction, .wikiadmin, .interwikilink, .footnote A, .footnote-rev { text-decoration: none; color: #600; } /* * Different backgrounds depening on link type. */ /* .wikilink { background-color: #ddc; } */ .wikiaction, .wikiaction INPUT, .wikiaction TABLE { background-color: #ddf; } .wikiadmin, .wikiadmin INPUT, .wikiadmin TABLE { background-color: #fdd; } .wikiunsafe { background-color: #eee; } .wikilink:link { color: #c00; } .wikilink:visited, { color: #600; } /* * Special colors for the '?' after unknown wikiwords. */ A.wikiunknown { color: #fffff0; background-color: #663333; font-family: avantgarde, helvetica, sans-serif; text-decoration: none; } PRE A.wikiunknown, TT A.wikiunknown { font-family: monospace; } /* For emacs users * * Local Variables: * mode: c * c-file-style: cc-mode * End: */ Index: HISTORY =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/HISTORY,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -r1.16 -r1.17 *** HISTORY 2001/02/13 05:54:37 1.16 --- HISTORY 2001/02/14 05:22:49 1.17 *************** *** 1,2 **** --- 1,12 ---- + 02/12/01 More Jeff's hacks: + + * More CSS stuff. I think it's neat. + * Added tables! And modified the footnote stuff a litte. + See TextFormattingRules for details. + * Fixed bugs: including (I hope the two which + Reini Urban <ru...@x-...> just reported.) Also added + Reini's patches to the README. Thanks! + + 02/11/01 Jeff's hacks continue: Index: README =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/README,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** README 2001/02/02 03:03:27 1.9 --- README 2001/02/14 05:22:49 1.10 *************** *** 20,51 **** and waiting for your improvement. All are suitable for production. - NOTE 2: Not all the admin functions are implemented, but the page - locking sure is nice. - MANIFEST: ! index.php: the "main page", really a set of branching instructions ! admin.php: entry page for doing wiki administration ! lib/config.php: configuration options, constants, global variables lib/db_filesystem.php support for flat file Wiki lib/dbmlib.php: database access functions for dbm files lib/display.php: display a page (this calls "lib/transform.php") - lib/editlinks.php: edit the embedded links of a page lib/editpage.php: edit a page lib/fullsearch.php: full page text search lib/mysql.php: database access functions for mySQL lib/pageinfo.php: gives detailed low-level info on the page structure lib/pgsql.php: database access functions for PostgreSQL lib/savepage.php: save a page to db, thank user lib/search.php: page title search - lib/setupwiki.php: load a set of pages from ./pgsrc/ directory lib/stdlib.php: standard library of functions (non-db related) lib/transform.php: convert wiki markup into HTML lib/ziplib.php: support for zip/unzip, used for page dumps admin/: ! admin/dumpserial.php: dump the Wiki out as serialize() pages ! admin/loadserial.php: load Wiki pages that were dumped with dumpserial admin/lockpage.php: lock a page so it cannot be edited admin/shrinkdbm.pl: Perl script to reduce size of DBM files --- 20,54 ---- and waiting for your improvement. All are suitable for production. MANIFEST: ! index.php: just the user-defined configs, calls lib/main.php ! lib/config.php: not user-definable config functions. lib/db_filesystem.php support for flat file Wiki + lib/dbalib.php: database access functions for the dba interface lib/dbmlib.php: database access functions for dbm files + lib/diff.php: request colored diff's lib/display.php: display a page (this calls "lib/transform.php") lib/editpage.php: edit a page lib/fullsearch.php: full page text search + lib/interwiki.map: list of other wiki's linked by trailing : + lib/interwiki.php: do the interwiki linking + lib/loadsave.php: make snapshots or backups + (previously setupwiki.php and dump-/loadserial.php) + lib/main.php: the main loop which was previously in index.php lib/mysql.php: database access functions for mySQL lib/pageinfo.php: gives detailed low-level info on the page structure lib/pgsql.php: database access functions for PostgreSQL + lib/prepend.php: things which must be done before all else lib/savepage.php: save a page to db, thank user lib/search.php: page title search lib/stdlib.php: standard library of functions (non-db related) lib/transform.php: convert wiki markup into HTML + lib/userauth.php: the WikiUser class holding saved state in cookies. lib/ziplib.php: support for zip/unzip, used for page dumps admin/: ! admin/dumpserial.php: replaced by lib/loadsave.php ! admin/loadserial.php: replaced by lib/loadsave.php admin/lockpage.php: lock a page so it cannot be edited admin/shrinkdbm.pl: Perl script to reduce size of DBM files *************** *** 53,57 **** admin/wiki_port1_0.php: import a 1.0 PhpWiki database admin/wiki_rebuilddbms.php: rebuild DBM files to reclaim disk space - admin/zip.php3: create a Zip archive of all Wiki pages templates/: --- 56,59 ---- Index: index.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/index.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** index.php 2001/02/13 05:54:38 1.8 --- index.php 2001/02/14 05:22:49 1.9 *************** *** 93,96 **** --- 93,104 ---- $LANG = "C"; + // If you specify a relative URL for the CSS and images, + // the are interpreted relative to DATA_PATH (see below). + // (The default value of DATA_PATH is the directory in which + // index.php (this file) resides.) + + // CSS location + define("CSS_URL", "phpwiki.css"); + // logo image (path relative to index.php) $logo = "images/wikibase.png"; |
From: Geoffrey T. D. <da...@us...> - 2001-02-13 05:54:03
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory usw-pr-cvs1:/tmp/cvs-serv13838/lib Modified Files: config.php diff.php editpage.php loadsave.php main.php msql.php pageinfo.php pgsql.php savepage.php stdlib.php userauth.php ziplib.php Added Files: prepend.php Log Message: log ***** Error reading new file: [Errno 2] No such file or directory: 'prepend.php' Index: config.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/config.php,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -r1.30 -r1.31 *** config.php 2001/02/12 01:43:10 1.30 --- config.php 2001/02/13 05:54:38 1.31 *************** *** 102,115 **** // Select database // ! if (!defined('DBTYPE')) { if ( floor(phpversion()) == 3) { ! define('DBTYPE', 'dbm'); } else { ! define('DBTYPE', 'dba'); } } ! switch (DBTYPE) { case 'dbm': --- 102,115 ---- // Select database // ! if (empty($DBParams['dbtype'])) { if ( floor(phpversion()) == 3) { ! $DBParams['dbtype'] = 'dbm'; } else { ! $DBParams['dbtype'] = 'dba'; } } ! switch ($DBParams['dbtype']) { case 'dbm': *************** *** 132,136 **** break; default: ! die(DBTYPE . ": unknown DBTYPE"); } --- 132,136 ---- break; default: ! ExitWiki($DBParams['dbtype'] . ": unknown DBTYPE"); } Index: diff.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/diff.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** diff.php 2001/02/12 01:43:10 1.7 --- diff.php 2001/02/13 05:54:38 1.8 *************** *** 1,4 **** - <!-- $Id$ --> <?php // diff.php // --- 1,4 ---- <?php + rcs_id('$Id$'); // diff.php // *************** *** 60,64 **** $xlines = array(); $ylines = array(); ! // Ignore lines which do not exist in both files. for ($x = 0; $x < $n_from; $x++) --- 60,66 ---- $xlines = array(); $ylines = array(); ! $this->xchanged = array(); ! $this->ychanged = array(); ! // Ignore lines which do not exist in both files. for ($x = 0; $x < $n_from; $x++) *************** *** 83,87 **** $this->xind[] = $x; } ! // Find the LCS. $this->_compareseq(0, sizeof($this->xv), 0, sizeof($this->yv)); --- 85,89 ---- $this->xind[] = $x; } ! // Find the LCS. $this->_compareseq(0, sizeof($this->xv), 0, sizeof($this->yv)); *************** *** 129,133 **** // Find adds. ! if ($this->ychanged[$y]) { $adds = array(); --- 131,135 ---- // Find adds. ! if (!empty($this->ychanged[$y])) { $adds = array(); *************** *** 526,530 **** $edit[] = "" . $from_lines[$x++]; } ! else die("assertion error"); $rev->edits[] = $edit; --- 528,533 ---- $edit[] = "" . $from_lines[$x++]; } ! else ! trigger_error("assertion error", E_USER_ERROR); $rev->edits[] = $edit; *************** *** 568,572 **** } else if (!$left || !$right) ! die ("assertion error"); else if (!is_array($left) && $left > 0) { // Left op is a copy. --- 571,575 ---- } else if (!$left || !$right) ! trigger_error("assertion error", E_USER_ERROR); else if (!is_array($left) && $left > 0) { // Left op is a copy. *************** *** 588,592 **** else { // Left op is an add. ! if (!is_array($left)) die('assertion error'); $nleft = sizeof($left); if ($nleft <= abs($right)) --- 591,595 ---- else { // Left op is an add. ! assert('is_array($left)'); $nleft = sizeof($left); if ($nleft <= abs($right)) *************** *** 671,675 **** } else ! die("assertion error"); } echo "</ol>"; --- 674,678 ---- } else ! trigger_error("assertion error", E_USER_ERROR); } echo "</ol>"; *************** *** 925,932 **** { $html = ''; ! $prefix = Element('td', array('bgcolor' => '#cccccc'), $prefix); reset($lines); while (list ($junk, $line) = each($lines)) { $line = empty($line) ? ' ' : htmlspecialchars($line); $html .= Element('tr', --- 928,936 ---- { $html = ''; ! $prefix = Element('td', array('bgcolor' => '#cccccc', 'width' => "1%"), $prefix); reset($lines); while (list ($junk, $line) = each($lines)) { + $line = rtrim($line); $line = empty($line) ? ' ' : htmlspecialchars($line); $html .= Element('tr', Index: editpage.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/editpage.php,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** editpage.php 2001/02/12 01:43:10 1.11 --- editpage.php 2001/02/13 05:54:38 1.12 *************** *** 1,4 **** - <!-- $Id$ --> <?php // editpage relies on $pagename, $version --- 1,4 ---- <?php + rcs_id('$Id$'); // editpage relies on $pagename, $version Index: loadsave.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/loadsave.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** loadsave.php 2001/02/12 01:43:10 1.1 --- loadsave.php 2001/02/13 05:54:38 1.2 *************** *** 168,171 **** --- 168,173 ---- $mesg = array(); $version = $page['version']; + $isnew = true; + if ($version) $mesg[] = sprintf(gettext("version %s"), $version); *************** *** 175,180 **** if (is_array($current = RetrievePage($dbi, $pagename, $WikiPageStore))) { ! // FIXME: should compare author, flags ... as well! ! if (arrays_equal($current['content'], $page['content'])) { $mesg[] = sprintf(gettext("is identical to current version %d"), --- 177,185 ---- if (is_array($current = RetrievePage($dbi, $pagename, $WikiPageStore))) { ! $isnew = false; ! ! if (arrays_equal($current['content'], $page['content']) ! && $current['author'] == $page['author'] ! && $current['flags'] == $page['flags']) { $mesg[] = sprintf(gettext("is identical to current version %d"), *************** *** 202,206 **** { InsertPage($dbi, $pagename, $page); ! $mesg[] = gettext("- saved"); if ($version != $page['version']) --- 207,212 ---- { InsertPage($dbi, $pagename, $page); ! UpdateRecentChanges($dbi, $pagename, $isnew); ! $mesg[] = gettext("- saved"); if ($version != $page['version']) *************** *** 243,247 **** $mtime = time(); // Last resort. ! $defaults = array('author' => 'The PhpWiki programming team', 'pagename' => rawurldecode($basename), 'flags' => 0, --- 249,253 ---- $mtime = time(); // Last resort. ! $defaults = array('author' => $GLOBALS['user']->id(), 'pagename' => rawurldecode($basename), 'flags' => 0, *************** *** 268,278 **** } ! function LoadZip ($dbi, $zipfile, $files = false) { $zip = new ZipReader($zipfile); while (list ($fn, $data, $attrib) = $zip->readFile()) { ! if ($files && !in_array(basename($fn), $files)) continue; LoadFile($dbi, $fn, $data, $attrib['mtime']); --- 274,290 ---- } ! function LoadZip ($dbi, $zipfile, $files = false, $exclude = false) { $zip = new ZipReader($zipfile); while (list ($fn, $data, $attrib) = $zip->readFile()) { ! // FIXME: basename("filewithnoslashes") seems to return garbage sometimes. ! $fn = basename("/dummy/" . $fn); ! if ( ($files && !in_array($fn, $files)) ! || ($exclude && in_array($fn, $exclude)) ) ! { ! print Element('dt', LinkExistingWikiWord($fn)) . QElement('dd', 'Skipping'); continue; + } LoadFile($dbi, $fn, $data, $attrib['mtime']); *************** *** 280,292 **** } ! function LoadDir ($dbi, $dirname, $files = false) { $handle = opendir($dir = $dirname); while ($fn = readdir($handle)) { - if ($files && !in_array($fn, $files)) - continue; if (filetype("$dir/$fn") != 'file') continue; LoadFile($dbi, "$dir/$fn"); } --- 292,310 ---- } ! function LoadDir ($dbi, $dirname, $files = false, $exclude = false) { $handle = opendir($dir = $dirname); while ($fn = readdir($handle)) { if (filetype("$dir/$fn") != 'file') continue; + + if ( ($files && !in_array($fn, $files)) + || ($exclude && in_array($fn, $exclude)) ) + { + print Element('dt', LinkExistingWikiWord($fn)) . QElement('dd', 'Skipping'); + continue; + } + LoadFile($dbi, "$dir/$fn"); } *************** *** 314,318 **** ! function LoadAny ($dbi, $file_or_dir, $files = false) { $type = filetype($file_or_dir); --- 332,336 ---- ! function LoadAny ($dbi, $file_or_dir, $files = false, $exclude = false) { $type = filetype($file_or_dir); *************** *** 320,334 **** if ($type == 'dir') { ! LoadDir($dbi, $file_or_dir, $files); } else if ($type != 'file' && !preg_match('/^(http|ftp):/', $file_or_dir)) { ! die("Bad file type: $type"); } else if (IsZipFile($file_or_dir)) { ! LoadZip($dbi, $file_or_dir, $files); } ! else if (!$files || in_array(basename($file_or_dir), $files)) { LoadFile($dbi, $file_or_dir); --- 338,352 ---- if ($type == 'dir') { ! LoadDir($dbi, $file_or_dir, $files, $exclude); } else if ($type != 'file' && !preg_match('/^(http|ftp):/', $file_or_dir)) { ! ExitWiki("Bad file type: $type"); } else if (IsZipFile($file_or_dir)) { ! LoadZip($dbi, $file_or_dir, $files, $exclude); } ! else /* if (!$files || in_array(basename($file_or_dir), $files)) */ { LoadFile($dbi, $file_or_dir); *************** *** 340,344 **** StartLoadDump("Loading '$source'"); echo "<dl>\n"; ! LoadAny($dbi, $source); echo "</dl>\n"; EndLoadDump(); --- 358,362 ---- StartLoadDump("Loading '$source'"); echo "<dl>\n"; ! LoadAny($dbi, $source, false, array(gettext('RecentChanges'))); echo "</dl>\n"; EndLoadDump(); *************** *** 347,351 **** function SetupWiki ($dbi) { ! global $GenericPages, $LANG; StartLoadDump('Loading up virgin wiki'); --- 365,372 ---- function SetupWiki ($dbi) { ! global $GenericPages, $LANG, $user; ! ! //FIXME: This is a hack ! $user->userid = 'The PhpWiki programming team'; StartLoadDump('Loading up virgin wiki'); *************** *** 369,373 **** if (!is_uploaded_file($tmp_name)) ! die('Bad zipfile'); // Possible malicious attack. // Dump http headers. --- 390,394 ---- if (!is_uploaded_file($tmp_name)) ! ExitWiki('Bad file post'); // Possible malicious attack. // Dump http headers. *************** *** 381,385 **** if (IsZipFile($fd)) ! LoadZip($dbi, $fd); else Loadfile($dbi, $name, fread($fd, MAX_UPLOAD_SIZE)); --- 402,406 ---- if (IsZipFile($fd)) ! LoadZip($dbi, $fd, false, array(gettext('RecentChanges'))); else Loadfile($dbi, $name, fread($fd, MAX_UPLOAD_SIZE)); Index: main.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/main.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** main.php 2001/02/12 01:43:10 1.1 --- main.php 2001/02/13 05:54:38 1.2 *************** *** 1,4 **** ! <?php $RCS_IDS[] = '$Id$'; ! function rcs_id($id) { $GLOBALS['RCS_IDS'][] = $id; } include "lib/config.php"; include "lib/stdlib.php"; --- 1,4 ---- ! <?php ! rcs_id('$Id$'); include "lib/config.php"; include "lib/stdlib.php"; *************** *** 47,51 **** 'info', 'diff', 'search', 'edit', 'save', ! 'login', 'logout') ); } --- 47,52 ---- 'info', 'diff', 'search', 'edit', 'save', ! 'login', 'logout', ! 'setprefs') ); } *************** *** 75,80 **** include_once("lib/loadsave.php"); SetupWiki($dbi); ! CloseDataBase($dbi); ! exit; } --- 76,80 ---- include_once("lib/loadsave.php"); SetupWiki($dbi); ! ExitWiki(); } *************** *** 83,87 **** $user->must_be_admin($action); ! switch ($action) { case 'edit': --- 83,91 ---- $user->must_be_admin($action); ! // Enable the output of most of the warning messages. ! // The warnings will screw up zip files and setpref though. ! if ($action != 'zip' && $action != 'setprefs') ! PostponeErrorMessages(E_NOTICE); ! switch ($action) { case 'edit': *************** *** 111,114 **** --- 115,121 ---- include_once("lib/loadsave.php"); MakeWikiZip($dbi, isset($include) && $include == 'all'); + // I don't think it hurts to add cruft at the end of the zip file. + echo "\n========================================================\n"; + echo "PhpWiki " . PHPWIKI_VERSION . " source:\n$RCS_IDS\n"; break; *************** *** 144,151 **** break; case 'browse': case 'login': case 'logout': ! include "lib/display.php"; // defaults to FrontPage break; --- 151,171 ---- break; + case 'setprefs': + $prefs = $user->getPreferences($GLOBALS); + if (!empty($edit_area_width)) + $prefs['edit_area.width'] = $edit_area_width; + if (!empty($edit_area_height)) + $prefs['edit_area.height'] = $edit_area_height; + $user->setPreferences($prefs); + + PostponeErrorMessages(E_ALL & ~E_NOTICE); + + include "lib/display.php"; + break; + case 'browse': case 'login': case 'logout': ! include "lib/display.php"; break; *************** *** 154,159 **** break; } - CloseDataBase($dbi); // For emacs users // Local Variables: --- 174,180 ---- break; } + + ExitWiki(); // For emacs users // Local Variables: Index: msql.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/msql.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** msql.php 2001/02/12 01:43:10 1.7 --- msql.php 2001/02/13 05:54:38 1.8 *************** *** 1,4 **** - <!-- $Id$ --> <?php /* --- 1,4 ---- <?php + rcs_id('$Id$'); /* Index: pageinfo.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/pageinfo.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** pageinfo.php 2001/02/12 01:43:10 1.7 --- pageinfo.php 2001/02/13 05:54:38 1.8 *************** *** 1,5 **** - <!-- $Id$ --> - <!-- Display the internal structure of a page. Steve Wainstead, June 2000 --> <?php --- 1,5 ---- <?php + rcs_id('$Id$'); + // Display the internal structure of a page. Steve Wainstead, June 2000 Index: pgsql.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/pgsql.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** pgsql.php 2001/02/12 01:43:10 1.5 --- pgsql.php 2001/02/13 05:54:38 1.6 *************** *** 1,4 **** - <!-- $Id$ --> <?php /* --- 1,4 ---- <?php + rcs_id('$Id$'); /* *************** *** 49,54 **** if (!($dbc = pg_pconnect(join(' ', $args)))) { ! echo "Cannot establish connection to database, giving up."; ! exit(); } --- 49,53 ---- if (!($dbc = pg_pconnect(join(' ', $args)))) { ! ExitWiki("Cannot establish connection to database, giving up."); } Index: savepage.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/savepage.php,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** savepage.php 2001/02/12 01:43:10 1.11 --- savepage.php 2001/02/13 05:54:38 1.12 *************** *** 8,80 **** */ - function UpdateRecentChanges($dbi, $pagename, $isnewpage) - { - global $user; - global $dateformat; - global $WikiPageStore; - - $recentchanges = RetrievePage($dbi, gettext ("RecentChanges"), $WikiPageStore); - - // this shouldn't be necessary, since PhpWiki loads - // default pages if this is a new baby Wiki - if ($recentchanges == -1) { - $recentchanges = array(); - } - - $now = time(); - $today = date($dateformat, $now); - - if (date($dateformat, $recentchanges['lastmodified']) != $today) { - $isNewDay = TRUE; - $recentchanges['lastmodified'] = $now; - } else { - $isNewDay = FALSE; - } - - $numlines = sizeof($recentchanges['content']); - $newpage = array(); - $k = 0; - - // scroll through the page to the first date and break - // dates are marked with "____" at the beginning of the line - for ($i = 0; $i < $numlines; $i++) { - if (preg_match("/^____/", - $recentchanges['content'][$i])) { - break; - } else { - $newpage[$k++] = $recentchanges['content'][$i]; - } - } - - // if it's a new date, insert it - $newpage[$k++] = $isNewDay ? "____$today\r" - : $recentchanges['content'][$i++]; - - $userid = $user->id(); - - // add the updated page's name to the array - if($isnewpage) { - $newpage[$k++] = "* [$pagename] (new) ..... $userid\r"; - } else { - $diffurl = "phpwiki:" . rawurlencode($pagename) . "?action=diff"; - $newpage[$k++] = "* [$pagename] ([diff|$diffurl]) ..... $userid\r"; - } - if ($isNewDay) - $newpage[$k++] = "\r"; - - // copy the rest of the page into the new array - // and skip previous entry for $pagename - $pagename = preg_quote($pagename); - for (; $i < $numlines; $i++) { - if (!preg_match("|\[$pagename\]|", $recentchanges['content'][$i])) { - $newpage[$k++] = $recentchanges['content'][$i]; - } - } - - $recentchanges['content'] = $newpage; - - InsertPage($dbi, gettext ("RecentChanges"), $recentchanges); - } - function ConcurrentUpdates($pagename) --- 8,11 ---- *************** *** 104,108 **** echo GeneratePage('MESSAGE', $html, sprintf (gettext ("Problem while updating %s"), $pagename), 0); ! exit; } --- 35,39 ---- echo GeneratePage('MESSAGE', $html, sprintf (gettext ("Problem while updating %s"), $pagename), 0); ! ExitWiki(); } Index: stdlib.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/stdlib.php,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -r1.28 -r1.29 *** stdlib.php 2001/02/12 01:43:10 1.28 --- stdlib.php 2001/02/13 05:54:38 1.29 *************** *** 57,61 **** if ($missing_ok) return false; ! die("$file: file not found"); } --- 57,61 ---- if ($missing_ok) return false; ! ExitWiki("$file: file not found"); } *************** *** 73,95 **** - function ExitWiki($errormsg) - { - static $exitwiki = 0; - global $dbi; - - if($exitwiki) // just in case CloseDataBase calls us - exit(); - $exitwiki = 1; - CloseDataBase($dbi); - - if($errormsg <> '') { - print "<P><hr noshade><h2>" . gettext("WikiFatalError") . "</h2>\n"; - print $errormsg; - print "\n</BODY></HTML>"; - } - exit; - } - function DataURL($url) { if (preg_match('@^(\w+:|/)@', $url)) --- 73,77 ---- *************** *** 175,190 **** } ! function LinkExistingWikiWord($wikiword, $linktext='') { ! return LinkURL(WikiURL($wikiword), $linktext ? $linktext : $wikiword); } ! function LinkUnknownWikiWord($wikiword, $linktext='') { if (empty($linktext)) $linktext = $wikiword; ! return QElement('u', $linktext) ! . QElement('a', array('href' => WikiURL($wikiword, array('action' => 'edit'))), ! '?'); } --- 157,176 ---- } ! function LinkExistingWikiWord($wikiword, $linktext='', $class = 'wikiword') { ! return Element('a', array('href' => WikiURL($wikiword), ! 'class' => $class), $linktext ? $linktext : $wikiword); } ! function LinkUnknownWikiWord($wikiword, $linktext='', $class = 'unknownwikiword') { if (empty($linktext)) $linktext = $wikiword; ! return Element('span', array('class' => 'unknownwikiword'), ! QElement('u', array('class' => 'unknownwikiword'), $linktext) . ! QElement('a', ! array('href' => WikiURL($wikiword, array('action' => 'edit')), ! 'class' => 'unknownwikiword'), ! '?')); } *************** *** 534,540 **** _dotoken('PAGE', htmlspecialchars($name), $page); _dotoken('LOGO', htmlspecialchars(DataURL($logo)), $page); ! global $RCS_IDS; ! _dotoken('RCS_IDS', join("\n", $RCS_IDS), $page); ! // FIXME: Clean up this stuff $browse_page = WikiURL($name); --- 520,530 ---- _dotoken('PAGE', htmlspecialchars($name), $page); _dotoken('LOGO', htmlspecialchars(DataURL($logo)), $page); ! ! _dotoken('RCS_IDS', $GLOBALS['RCS_IDS'], $page); ! ! $prefs = $user->getPreferences(); ! _dotoken('EDIT_AREA_WIDTH', $prefs['edit_area.width'], $page); ! _dotoken('EDIT_AREA_HEIGHT', $prefs['edit_area.height'], $page); ! // FIXME: Clean up this stuff $browse_page = WikiURL($name); *************** *** 571,574 **** --- 561,634 ---- return $page; } + + function UpdateRecentChanges($dbi, $pagename, $isnewpage) + { + global $user; + global $dateformat; + global $WikiPageStore; + + $recentchanges = RetrievePage($dbi, gettext ("RecentChanges"), $WikiPageStore); + + // this shouldn't be necessary, since PhpWiki loads + // default pages if this is a new baby Wiki + if ($recentchanges == -1) { + $recentchanges = array(); + } + + $now = time(); + $today = date($dateformat, $now); + + if (date($dateformat, $recentchanges['lastmodified']) != $today) { + $isNewDay = TRUE; + $recentchanges['lastmodified'] = $now; + } else { + $isNewDay = FALSE; + } + + $numlines = sizeof($recentchanges['content']); + $newpage = array(); + $k = 0; + + // scroll through the page to the first date and break + // dates are marked with "____" at the beginning of the line + for ($i = 0; $i < $numlines; $i++) { + if (preg_match("/^____/", + $recentchanges['content'][$i])) { + break; + } else { + $newpage[$k++] = $recentchanges['content'][$i]; + } + } + + // if it's a new date, insert it + $newpage[$k++] = $isNewDay ? "____$today\r" + : $recentchanges['content'][$i++]; + + $userid = $user->id(); + + // add the updated page's name to the array + if($isnewpage) { + $newpage[$k++] = "* [$pagename] (new) ..... $userid\r"; + } else { + $diffurl = "phpwiki:" . rawurlencode($pagename) . "?action=diff"; + $newpage[$k++] = "* [$pagename] ([diff|$diffurl]) ..... $userid\r"; + } + if ($isNewDay) + $newpage[$k++] = "\r"; + + // copy the rest of the page into the new array + // and skip previous entry for $pagename + $pagename = preg_quote($pagename); + for (; $i < $numlines; $i++) { + if (!preg_match("|\[$pagename\]|", $recentchanges['content'][$i])) { + $newpage[$k++] = $recentchanges['content'][$i]; + } + } + + $recentchanges['content'] = $newpage; + + InsertPage($dbi, gettext ("RecentChanges"), $recentchanges); + } + // For emacs users // Local Variables: Index: userauth.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/userauth.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** userauth.php 2001/02/12 01:43:10 1.2 --- userauth.php 2001/02/13 05:54:38 1.3 *************** *** 1,3 **** ! <?php rcs_id('$Id'); // It is anticipated that when userid support is added to phpwiki, --- 1,3 ---- ! <?php rcs_id('$Id$'); // It is anticipated that when userid support is added to phpwiki, *************** *** 82,85 **** --- 82,111 ---- } + + // This is a bit of a hack: + function setPreferences ($prefs) { + global $WIKI_PREFS; + $WIKI_PREFS = serialize($prefs); + $expires = time() + 365 * 24 * 3600; // expire in a year + setcookie('WIKI_PREFS', $WIKI_PREFS, $expires, '/'); + } + + function getPreferences () { + $prefs = array('edit_area.width' => 80, + 'edit_area.height' => 22); + + $prefcookie = unserialize(fix_magic_quotes_gpc($GLOBALS['WIKI_PREFS'])); + + while (list($k, $v) = each($prefs)) + if (!empty($prefcookie[$k])) + $prefs[$k] = $prefcookie[$k]; + + // Some sanity checks. (FIXME: should move somewhere else) + if (!($prefs['edit_area.width'] >= 30 && $prefs['edit_area.width'] <= 150)) + $prefs['edit_area.width'] = 80; + if (!($prefs['edit_area.height'] >= 5 && $prefs['edit_area.height'] <= 80)) + $prefs['edit_area.height'] = 22; + return $prefs; + } function _get_authenticated_userid () { *************** *** 129,133 **** header("HTTP/1.0 401 Unauthorized"); echo gettext ("You entered an invalid login or password."); ! exit; } } --- 155,159 ---- header("HTTP/1.0 401 Unauthorized"); echo gettext ("You entered an invalid login or password."); ! ExitWiki(); } } Index: ziplib.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/ziplib.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** ziplib.php 2001/02/12 01:43:10 1.6 --- ziplib.php 2001/02/13 05:54:38 1.7 *************** *** 39,55 **** $filename = gzip_tempnam(); if (!($fp = gzopen($filename, "wb"))) ! die("gzopen failed"); gzwrite($fp, $data, strlen($data)); if (!gzclose($fp)) ! die("gzclose failed"); $size = filesize($filename); if (!($fp = fopen($filename, "rb"))) ! die("fopen failed"); if (!($z = fread($fp, $size)) || strlen($z) != $size) ! die("fread failed"); if (!fclose($fp)) ! die("fclose failed"); unlink($filename); --- 39,55 ---- $filename = gzip_tempnam(); if (!($fp = gzopen($filename, "wb"))) ! ExitWiki("gzopen failed"); gzwrite($fp, $data, strlen($data)); if (!gzclose($fp)) ! ExitWiki("gzclose failed"); $size = filesize($filename); if (!($fp = fopen($filename, "rb"))) ! ExitWiki("fopen failed"); if (!($z = fread($fp, $size)) || strlen($z) != $size) ! ExitWiki("fread failed"); if (!fclose($fp)) ! ExitWiki("fclose failed"); unlink($filename); *************** *** 60,75 **** $filename = gzip_tempnam(); if (!($fp = fopen($filename, "wb"))) ! die("fopen failed"); fwrite($fp, $data, strlen($data)); if (!fclose($fp)) ! die("fclose failed"); if (!($fp = gzopen($filename, "rb"))) ! die("gzopen failed"); $unz = ''; while ($buf = gzread($fp, 4096)) $unz .= $buf; if (!gzclose($fp)) ! die("gzclose failed"); unlink($filename); --- 60,75 ---- $filename = gzip_tempnam(); if (!($fp = fopen($filename, "wb"))) ! ExitWiki("fopen failed"); fwrite($fp, $data, strlen($data)); if (!fclose($fp)) ! ExitWiki("fclose failed"); if (!($fp = gzopen($filename, "rb"))) ! ExitWiki("gzopen failed"); $unz = ''; while ($buf = gzread($fp, 4096)) $unz .= $buf; if (!gzclose($fp)) ! ExitWiki("gzclose failed"); unlink($filename); *************** *** 161,174 **** if ($magic != GZIP_MAGIC) ! die("Bad gzip magic"); if ($comp_type != GZIP_DEFLATE) ! die("Bad gzip comp type"); if (($flags & 0x3e) != 0) ! die(sprintf("Bad flags (0x%02x)", $flags)); $gz_header_len = 10; $gz_data_len = strlen($z) - $gz_header_len - 8; if ($gz_data_len < 0) ! die("not enough gzip output?"); extract(unpack("Vcrc32", substr($z, $gz_header_len + $gz_data_len))); --- 161,174 ---- if ($magic != GZIP_MAGIC) ! ExitWiki("Bad gzip magic"); if ($comp_type != GZIP_DEFLATE) ! ExitWiki("Bad gzip comp type"); if (($flags & 0x3e) != 0) ! ExitWiki(sprintf("Bad flags (0x%02x)", $flags)); $gz_header_len = 10; $gz_data_len = strlen($z) - $gz_header_len - 8; if ($gz_data_len < 0) ! ExitWiki("not enough gzip output?"); extract(unpack("Vcrc32", substr($z, $gz_header_len + $gz_data_len))); *************** *** 183,187 **** { if (!function_exists('gzopen')) ! die("Can't inflate data: zlib support not enabled in this PHP"); // Reconstruct gzip header and ungzip the data. --- 183,187 ---- { if (!function_exists('gzopen')) ! ExitWiki("Can't inflate data: zlib support not enabled in this PHP"); // Reconstruct gzip header and ungzip the data. *************** *** 345,349 **** * BUGS: * ! * Many of the die()'s should probably be warn()'s (eg. CRC mismatch). * * Only a subset of zip formats is recognized. (I think that unsupported --- 345,349 ---- * BUGS: * ! * Many of the ExitWiki()'s should probably be warn()'s (eg. CRC mismatch). * * Only a subset of zip formats is recognized. (I think that unsupported *************** *** 361,365 **** $this->fp = $zipfile; // File already open else if (!($this->fp = fopen($zipfile, "rb"))) ! die("Can't open zip file '$zipfile' for reading"); } --- 361,365 ---- $this->fp = $zipfile; // File already open else if (!($this->fp = fopen($zipfile, "rb"))) ! ExitWiki("Can't open zip file '$zipfile' for reading"); } *************** *** 367,371 **** $chunk = fread($this->fp, $nbytes); if (strlen($chunk) != $nbytes) ! die("Unexpected EOF in zip file"); return $chunk; } --- 367,371 ---- $chunk = fread($this->fp, $nbytes); if (strlen($chunk) != $nbytes) ! ExitWiki("Unexpected EOF in zip file"); return $chunk; } *************** *** 391,401 **** { if ($magic != ZIP_CENTHEAD_MAGIC) ! die("Bad header type: " . htmlspecialchars($magic)); // FIXME: better message? return $this->done(); } if (($flags & 0x21) != 0) ! die("Encryption and/or zip patches not supported."); if (($flags & 0x08) != 0) ! die("Postponed CRC not yet supported."); // FIXME: ??? $filename = $this->_read($filename_len); --- 391,401 ---- { if ($magic != ZIP_CENTHEAD_MAGIC) ! ExitWiki("Bad header type: " . htmlspecialchars($magic)); // FIXME: better message? return $this->done(); } if (($flags & 0x21) != 0) ! ExitWiki("Encryption and/or zip patches not supported."); if (($flags & 0x08) != 0) ! ExitWiki("Postponed CRC not yet supported."); // FIXME: ??? $filename = $this->_read($filename_len); *************** *** 413,423 **** $crc = zip_crc32($data); if ($crc32 != $crc) ! die(sprintf("CRC mismatch %x != %x", $crc, $crc32)); } else ! die("Compression method $comp_method unsupported"); if (strlen($data) != $uncomp_size) ! die(sprintf("Uncompressed size mismatch %d != %d", strlen($data), $uncomp_size)); --- 413,423 ---- $crc = zip_crc32($data); if ($crc32 != $crc) ! ExitWiki(sprintf("CRC mismatch %x != %x", $crc, $crc32)); } else ! ExitWiki("Compression method $comp_method unsupported"); if (strlen($data) != $uncomp_size) ! ExitWiki(sprintf("Uncompressed size mismatch %d != %d", strlen($data), $uncomp_size)); *************** *** 597,601 **** . '\s*(' . MIME_TOKEN_REGEXP . ')\s*:x', $string, $match)) ! die ("Bad MIME content-type"); $type = strtolower($match[1]); --- 597,601 ---- . '\s*(' . MIME_TOKEN_REGEXP . ')\s*:x', $string, $match)) ! ExitWiki ("Bad MIME content-type"); $type = strtolower($match[1]); *************** *** 625,629 **** { if (!$boundary) ! die("No boundary?"); $boundary = preg_quote($boundary); --- 625,629 ---- { if (!$boundary) ! ExitWiki("No boundary?"); $boundary = preg_quote($boundary); *************** *** 645,649 **** return $parts; // End boundary found. } ! die("No end boundary?"); } --- 645,649 ---- return $parts; // End boundary found. } ! ExitWiki("No end boundary?"); } *************** *** 677,685 **** { if (!($headers = ParseRFC822Headers($data)) ! || !($typeheader = $headers['content-type'])) { //warn("Can't find content-type header"); return false; } if (!(list ($type, $subtype, $params) = ParseMimeContentType($typeheader))) --- 677,686 ---- { if (!($headers = ParseRFC822Headers($data)) ! || empty($headers['content-type'])) { //warn("Can't find content-type header"); return false; } + $typeheader = $headers['content-type']; if (!(list ($type, $subtype, $params) = ParseMimeContentType($typeheader))) *************** *** 718,722 **** $data = QuotedPrintableDecode($data); else if ($encoding && $encoding != 'binary') ! die("Unknown encoding type: $encoding"); $data .= GenerateFootnotesFromRefs($params); --- 719,723 ---- $data = QuotedPrintableDecode($data); else if ($encoding && $encoding != 'binary') ! ExitWiki("Unknown encoding type: $encoding"); $data .= GenerateFootnotesFromRefs($params); |
From: Geoffrey T. D. <da...@us...> - 2001-02-13 05:54:03
|
Update of /cvsroot/phpwiki/phpwiki/templates In directory usw-pr-cvs1:/tmp/cvs-serv13838/templates Modified Files: browse.html editpage.html message.html Log Message: log Index: browse.html =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/templates/browse.html,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** browse.html 2001/02/10 22:15:08 1.10 --- browse.html 2001/02/13 05:54:38 1.11 *************** *** 6,13 **** --> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> ! <base href="###BASE_URL###"> <title>###PAGE###</title> ! </head> <body bgcolor=ivory text=black alink=red link=darkblue vlink=darkmagenta> <h1><a href="###BROWSE###FrontPage"><img src="###LOGO###" border=0 alt="[phpwiki]" align=middle width=50 height=50></a> --- 6,33 ---- --> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> ! <!-- <base href="###BASE_URL###"> --> <title>###PAGE###</title> ! <!-- <link rel="stylesheet" title="phpwiki" href="" type="text/css"> --> ! <style type="text/css"> ! <!-- ! .wikiword, .unknownwikiword { ! font-family: sans-serif; ! font-size: 12pt; ! text-decoration: none; ! /* background-color: #e8e8d8 */ ! } ! ! .wikiword:link { ! color: #c00 ; ! } ! .wikiword:visited { ! color: #600; ! } ! .unknownwikiword { color: #000; background-color: #ddc } ! A.unknownwikiword { color: ivory; background-color: #663333 } + --> + </style> + </head> <body bgcolor=ivory text=black alink=red link=darkblue vlink=darkmagenta> <h1><a href="###BROWSE###FrontPage"><img src="###LOGO###" border=0 alt="[phpwiki]" align=middle width=50 height=50></a> Index: editpage.html =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/templates/editpage.html,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** editpage.html 2001/02/12 01:43:10 1.10 --- editpage.html 2001/02/13 05:54:38 1.11 *************** *** 6,10 **** --> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> ! <base href="###BASE_URL###"> <title>###PAGE###</title> </head> --- 6,10 ---- --> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> ! <!-- <base href="###BASE_URL###"> --> <title>###PAGE###</title> </head> *************** *** 18,22 **** <input type="submit" value=" Save "></h1> ! <textarea name="content" ROWS="22" COLS="80" wrap="virtual">###CONTENT###</textarea> <br> ###IF:MINOR_EDIT_CHECKBOX### --- 18,25 ---- <input type="submit" value=" Save "></h1> ! <textarea name="content" ! rows="###EDIT_AREA_HEIGHT###" ! cols="###EDIT_AREA_WIDTH###" ! wrap="virtual">###CONTENT###</textarea> <br> ###IF:MINOR_EDIT_CHECKBOX### Index: message.html =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/templates/message.html,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** message.html 2001/02/10 22:15:08 1.5 --- message.html 2001/02/13 05:54:38 1.6 *************** *** 6,10 **** --> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> ! <base href="###BASE_URL###"> <title>###PAGE###</title> </head> --- 6,10 ---- --> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> ! <!-- <base href="###BASE_URL###"> --> <title>###PAGE###</title> </head> |
From: Geoffrey T. D. <da...@us...> - 2001-02-13 05:54:03
|
Update of /cvsroot/phpwiki/phpwiki/pgsrc In directory usw-pr-cvs1:/tmp/cvs-serv13838/pgsrc Modified Files: FrontPage HowToUseWiki MagicPhpWikiURLs PhpWikiAdministration ReleaseNotes Added Files: UserPreferences Log Message: log --- NEW FILE --- Mime-Version: 1.0 Content-Type: application/x-phpwiki; pagename=UserPreferences; flags=PAGE_LOCKED Content-Transfer-Encoding: binary You can now set some user preferences. The values of these preferences are currently stored in a cookie (so you must have cookies enables to use this feature.) ! !EditArea Dimensions. [Set Width | phpwiki:?action=setprefs&edit_area_width=3()] [Set Height | phpwiki:?action=setprefs&edit_area_height=3()] Index: FrontPage =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/pgsrc/FrontPage,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** FrontPage 2000/11/06 16:14:43 1.5 --- FrontPage 2001/02/13 05:54:38 1.6 *************** *** 6,9 **** * Find out which pages are MostPopular. * Read the ReleaseNotes - - --- 6,7 ---- Index: HowToUseWiki =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/pgsrc/HowToUseWiki,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** HowToUseWiki 2001/02/08 01:28:16 1.5 --- HowToUseWiki 2001/02/13 05:54:38 1.6 *************** *** 31,32 **** --- 31,35 ---- ---- A WikiWikiWeb is meant to be fast and easy to edit. It has very simple markup that you can read about in TextFormattingRules. + ---- + If you don't like the size of the text editing window you get, you can change it. + See UserPreferences. Index: MagicPhpWikiURLs =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/pgsrc/MagicPhpWikiURLs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** MagicPhpWikiURLs 2001/02/10 22:15:08 1.1 --- MagicPhpWikiURLs 2001/02/13 05:54:38 1.2 *************** *** 1,2 **** --- 1,8 ---- + Mime-Version: 1.0 (Produced by PhpWiki 1.1.x) + Content-Type: application/x-phpwiki; + pagename=MagicPhpWikiURLs; + flags=PAGE_LOCKED + Content-Transfer-Encoding: binary + !!! About phpwiki: URLs *************** *** 17,21 **** __zip__, __dumpserial__, __loadserial__, __remove__, __lock__, __unlock__, ! __login__, __logout__, or __save__. The default action is __browse__. --- 23,27 ---- __zip__, __dumpserial__, __loadserial__, __remove__, __lock__, __unlock__, ! __login__, __logout__, __setprefs__ or __save__. The default action is __browse__. *************** *** 27,30 **** --- 33,37 ---- ;__remove__: Accepts __verify__. ;__save__: Accepts __editversion__, __minor_edit__, and __content__. + ;__setprefs__: Accepts __edit_area_width__, __edit_area_height__. Index: PhpWikiAdministration =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/pgsrc/PhpWikiAdministration,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** PhpWikiAdministration 2001/02/12 01:43:10 1.6 --- PhpWikiAdministration 2001/02/13 05:54:38 1.7 *************** *** 64,68 **** your (client) machine. ! [ Upload | phpwiki:?action=upload&file=()upload ] ! Load File --- 64,68 ---- your (client) machine. ! [ Upload | phpwiki:?action=upload&file=50()upload ] ! Load File *************** *** 72,76 **** You can also use this form to load from an http: or ftp: URL. ! [ Load | phpwiki:?action=loadfile&source=(/tmp/wikidump) ] ----------- --- 72,76 ---- You can also use this form to load from an http: or ftp: URL. ! [ Load | phpwiki:?action=loadfile&source=50(/tmp/wikidump) ] ----------- Index: ReleaseNotes =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/pgsrc/ReleaseNotes,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** ReleaseNotes 2001/02/02 03:18:44 1.7 --- ReleaseNotes 2001/02/13 05:54:38 1.8 *************** *** 1,2 **** --- 1,9 ---- + PhpWiki 1.3.x development branch. + + * Pagenames in PATH_INFO. + * File uploads: see PhpWikiAdministration. + * UserPreferences. + * Ugly [MagicPhpWikiURLs] for administrative links. + PhpWiki 1.2 is a huge advance over version 1.0: |
From: Geoffrey T. D. <da...@us...> - 2001-02-13 05:54:03
|
Update of /cvsroot/phpwiki/phpwiki In directory usw-pr-cvs1:/tmp/cvs-serv13838 Modified Files: HISTORY index.php Log Message: log Index: HISTORY =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/HISTORY,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -r1.15 -r1.16 *** HISTORY 2001/02/12 01:43:09 1.15 --- HISTORY 2001/02/13 05:54:37 1.16 *************** *** 1,4 **** --- 1,21 ---- 02/11/01 Jeff's hacks continue: + * User preferences can be stored in a cookie. Currently the only user preference + is the size of the textarea on the edit page. See the UserPreferences wiki page. + + * When a zip/file is uploaded, set the author to the user who does the upload + (ie. the administrator). Also enter the upload in RecentChanges. + * Don't load RecentChanges from zip or dir. Only from file. + + * Clean up error reporting. Warning messages screw up header() and setcookie() + operations, and also corrupt the zip dumps. New function + PostponeErrorMessages() allows one to postpone the reporting of selected warnings. + + * Beginnings of CSS support. Still in the ugly stage. + + * More bug fixes. + + 02/11/01 Jeff's hacks continue: + * Moved user configuration stuff into index.php. What was index.php is now in lib/main.php. Index: index.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/index.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** index.php 2001/02/12 01:43:09 1.7 --- index.php 2001/02/13 05:54:38 1.8 *************** *** 1,8 **** <?php define ('PHPWIKI_VERSION', '1.3.0pre'); ! error_reporting(E_ALL /* ^ E_NOTICE */); ! ! $RCS_IDS = array("SCRIPT_NAME='$SCRIPT_NAME'", ! '$Id$'); ///////////////////////////////////////////////////////////////////// --- 1,9 ---- <?php + ///////////////////////////////////////////////////////////////////// + // Part Zero: Don't touch this! + ///////////////////////////////////////////////////////////////////// define ('PHPWIKI_VERSION', '1.3.0pre'); ! require "lib/prepend.php"; ! rcs_id('$Id$'); ///////////////////////////////////////////////////////////////////// *************** *** 41,54 **** ///////////////////////////////////////////////////////////////////// - // Pick one of 'dbm', 'dba', 'mysql', 'pgsql', 'msql', or 'file'. - // (Or leaven DBTYPE undefined for default behavior (which is 'dba' - // if supported, else 'dbm'). - - //define("DBTYPE", 'mysql'); - - // 'dbm' and 'dba create files named "$directory/${database}{$prefix}*". - // 'file' creates files named "$directory/${database}/{$prefix}*/*". - // The sql types use tables named "{$prefix}*" - // // This array holds the parameters which select the database to use. --- 42,45 ---- *************** *** 57,60 **** --- 48,61 ---- // $DBParams = array( + // Select the database type: + // Uncomment one of these, or leave all commented for the default + // data base type ('dba' if supported, else 'dbm'.) + //'dbtype' => 'dba', + //'dbtype' => 'dbm', + //'dbtype' => 'mysql', + //'dbtype' => 'pgsql', + //'dbtype' => 'msql', + //'dbtype' => 'file', + // Used by all DB types: 'database' => 'wiki', *************** *** 64,67 **** --- 65,72 ---- 'directory' => "/tmp", + // 'dbm' and 'dba create files named "$directory/${database}{$prefix}*". + // 'file' creates files named "$directory/${database}/{$prefix}*/*". + // The sql types use tables named "{$prefix}*" + // Used by 'dbm', 'dba' 'timeout' => 20, *************** *** 187,192 **** * PhpWiki resides. */ ! //define('PHPWIKI_SERVER_NAME', 'some.host.com'); ! //define('PHPWIKI_SERVER_PORT', 80); /* --- 192,197 ---- * PhpWiki resides. */ ! //define('SERVER_NAME', 'some.host.com'); ! //define('SERVER_PORT', 80); /* *************** *** 194,198 **** * script. */ ! //define('PHPWIKI_SCRIPT_NAME', '/some/where/index.php'); /* --- 199,203 ---- * script. */ ! //define('SCRIPT_NAME', '/some/where/index.php'); /* *************** *** 201,205 **** * are interpreted. */ ! //define('PHPWIKI_DATA_PATH', '/some/where'); /* --- 206,210 ---- * are interpreted. */ ! //define('DATA_PATH', '/some/where'); /* *************** *** 212,219 **** /* ! * FIXME: add docs ! * (Only used if USE_PATH_INFO is true.) */ ! //define('PHPWIKI_VIRTUAL_PATH', '/SomeWiki'); --- 217,243 ---- /* ! * VIRTUAL_PATH is the canonical URL path under which your ! * your wiki appears. Normally this is the same as ! * dirname(SCRIPT_NAME), however using, e.g. apaches mod_actions ! * (or mod_rewrite), you can make it something different. ! * ! * If you do this, you should set VIRTUAL_PATH here. ! * ! * E.g. your phpwiki might be installed at at /scripts/phpwiki/index.php, ! * but * you've made it accessible through eg. /wiki/FrontPage. ! * ! * One way to do this is to create a directory named 'wiki' in your ! * server root. The directory contains only one file: an .htaccess ! * file which reads something like: ! * ! * Action x-phpwiki-page /scripts/phpwiki/index.php ! * SetHandler x-phpwiki-page ! * DirectoryIndex /scripts/phpwiki/index.php ! * ! * In that case you should set VIRTUAL_PATH to '/wiki'. ! * ! * (VIRTUAL_PATH is only used if USE_PATH_INFO is true.) */ ! //define('VIRTUAL_PATH', '/SomeWiki'); |
From: Geoffrey T. D. <da...@us...> - 2001-02-13 05:54:03
|
Update of /cvsroot/phpwiki/phpwiki/admin In directory usw-pr-cvs1:/tmp/cvs-serv13838/admin Modified Files: lockpage.php removepage.php Log Message: log Index: lockpage.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/admin/lockpage.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** lockpage.php 2001/02/10 22:15:07 1.2 --- lockpage.php 2001/02/13 05:54:38 1.3 *************** *** 1,4 **** - <!-- $Id$ --> <?php $user->must_be_admin("lock or unlock pages"); --- 1,5 ---- <?php + rcs_id('$Id$'); + $user->must_be_admin("lock or unlock pages"); Index: removepage.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/admin/removepage.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** removepage.php 2001/02/10 22:15:07 1.1 --- removepage.php 2001/02/13 05:54:38 1.2 *************** *** 1,3 **** --- 1,4 ---- <?php + rcs_id('$Id$'); if (!function_exists('RemovePage')) *************** *** 23,26 **** } ! GeneratePage('MESSAGE', $html, gettext ("Remove page"), 0); ?> --- 24,27 ---- } ! echo GeneratePage('MESSAGE', $html, gettext ("Remove page"), 0); ?> |
From: Geoffrey T. D. <da...@us...> - 2001-02-12 01:42:38
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory usw-pr-cvs1:/tmp/cvs-serv13525/lib Modified Files: config.php db_filesystem.php dbalib.php dbmlib.php diff.php display.php editpage.php fullsearch.php interwiki.php msql.php mysql.php pageinfo.php pgsql.php savepage.php search.php stdlib.php transform.php userauth.php ziplib.php Added Files: loadsave.php main.php Removed Files: setupwiki.php Log Message: log ***** Error reading new file: [Errno 2] No such file or directory: 'loadsave.php' ***** Error reading new file: [Errno 2] No such file or directory: 'main.php' Index: config.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/config.php,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -r1.29 -r1.30 *** config.php 2001/02/10 22:15:08 1.29 --- config.php 2001/02/12 01:43:10 1.30 *************** *** 1,269 **** <?php ! rcs_id('$Id$'); ! ! // essential internal stuff -- skip it. Go down to Part One. There ! // are four parts to this file that interest you, all labeled Part ! // One, Two, Three and Four. ! ! set_magic_quotes_runtime(0); ! error_reporting(E_ALL ^ E_NOTICE); ! ! ///////////////////////////////////////////////////////////////////// ! // Part One: ! // Constants and settings. Edit the values below for your site. ! ///////////////////////////////////////////////////////////////////// ! ! ! // URL of index.php e.g. http://yoursite.com/phpwiki/index.php ! // you can leave this empty - it will be calculated automatically ! $ScriptUrl = ""; ! ! // Select your language - default language "C": English ! // other languages available: Dutch "nl", Spanish "es", German "de", ! // and Swedish "sv" ! $LANG="C"; ! ! // Define to 'true' to use PATH_INFO to pass the pagename's. ! // e.g. http://www.some.where/index.php/FrontPage instead ! // of http://www.some.where/index.php?pagename=FrontPage ! define('USE_PATH_INFO', true); ! ! // Username and password of administrator. ! // Set these to your preferences. For heaven's sake ! // pick a good password! ! define('ADMIN_USER', ""); ! define('ADMIN_PASSWD', ""); ! ! // If true, only the admin user can make zip dumps, else ! // zip dumps require no authentication. ! define('ZIPDUMP_AUTH', false); ! ! // If set, we will perform reverse dns lookups to try to convert the users ! // IP number to a host name, even if the http server didn't do it for us. ! define('ENABLE_REVERSE_DNS', true); ! ! ///////////////////////////////////////////////////////////////////// ! // Part Two: ! // Database section ! // set your database here and edit the according section below. ! // For PHP 4.0.4 and later you must use "dba" if you are using ! // DBM files for storage. "dbm" uses the older deprecated interface. ! // The option 'default' will choose either dbm or dba, depending on ! // the version of PHP you are running. ! ///////////////////////////////////////////////////////////////////// ! ! $WhichDatabase = 'default'; // use one of "dbm", "dba", "mysql", ! // "pgsql", "msql", or "file" ! ! // DBM and DBA settings (default) ! if ($WhichDatabase == 'dbm' or $WhichDatabase == 'dba' or ! $WhichDatabase == 'default') { ! $DBMdir = "/tmp"; ! $WikiPageStore = "wiki"; ! $ArchivePageStore = "archive"; ! $WikiDB['wiki'] = "$DBMdir/wikipagesdb"; ! $WikiDB['archive'] = "$DBMdir/wikiarchivedb"; ! $WikiDB['wikilinks'] = "$DBMdir/wikilinksdb"; ! $WikiDB['hottopics'] = "$DBMdir/wikihottopicsdb"; ! $WikiDB['hitcount'] = "$DBMdir/wikihitcountdb"; ! // try this many times if the dbm is unavailable ! define("MAX_DBM_ATTEMPTS", 20); ! ! // for PHP3 use dbmlib, else use dbalib for PHP4 ! if ($WhichDatabase == 'default') { ! if ( floor(phpversion()) == 3) { ! $WhichDatabase = 'dbm'; ! } else { ! $WhichDatabase = 'dba'; ! } ! } ! ! if ($WhichDatabase == 'dbm') { ! include "lib/dbmlib.php"; ! } else { ! include "lib/dbalib.php"; ! } ! ! // MySQL settings -- see INSTALL.mysql for details on using MySQL ! } elseif ($WhichDatabase == 'mysql') { ! $WikiPageStore = "wiki"; ! $ArchivePageStore = "archive"; ! $WikiLinksStore = "wikilinks"; ! $WikiScoreStore = "wikiscore"; ! $HitCountStore = "hitcount"; ! $mysql_server = 'localhost'; ! $mysql_user = 'root'; ! $mysql_pwd = ''; ! $mysql_db = 'wiki'; ! include "lib/mysql.php"; ! ! // PostgreSQL settings -- see INSTALL.pgsql for more details ! } elseif ($WhichDatabase == 'pgsql') { ! $pg_dbhost = "localhost"; ! $pg_dbport = "5432"; ! $WikiDataBase = "wiki"; // name of the database in Postgresql ! $WikiPageStore = "wiki"; ! $ArchivePageStore = "archive"; ! $WikiLinksPageStore = "wikilinks"; ! $HotTopicsPageStore = "hottopics"; ! $HitCountPageStore = "hitcount"; ! include "lib/pgsql.php"; ! ! // MiniSQL (mSQL) settings -- see INSTALL.msql for details on using mSQL ! } elseif ($WhichDatabase == 'msql') { ! $msql_db = "wiki"; ! $WikiPageStore = array(); ! $ArchivePageStore = array(); ! $WikiPageStore['table'] = "wiki"; ! $WikiPageStore['page_table'] = "wikipages"; ! $ArchivePageStore['table'] = "archive"; ! $ArchivePageStore['page_table'] = "archivepages"; ! // should be the same as wikipages.line ! define("MSQL_MAX_LINE_LENGTH", 128); ! include "lib/msql.php"; ! ! // Filesystem DB settings ! } elseif ($WhichDatabase == 'file') { ! $DBdir = "/tmp/wiki"; ! $WikiPageStore = "wiki"; ! $ArchivePageStore = "archive"; ! $WikiDB['wiki'] = "$DBdir/pages"; ! $WikiDB['archive'] = "$DBdir/archive"; ! $WikiDB['wikilinks'] = "$DBdir/links"; ! $WikiDB['hottopics'] = "$DBdir/hottopics"; ! $WikiDB['hitcount'] = "$DBdir/hitcount"; ! include "lib/db_filesystem.php"; ! ! } else die("Invalid '\$WhichDatabase' in lib/config.php"); ! ! ! ///////////////////////////////////////////////////////////////////// ! // Part Three: ! // Miscellaneous ! ///////////////////////////////////////////////////////////////////// ! ! // logo image (path relative to index.php) ! $logo = "images/wikibase.png"; ! ! // Signature image which is shown after saving an edited page ! // If this is left blank (or unset), the signature will be omitted. ! //$SignatureImg = "images/signature.png"; ! ! // date & time formats used to display modification times, etc. ! // formats are given as format strings to PHP date() function ! $datetimeformat = "F j, Y"; // may contain time of day ! $dateformat = "F j, Y"; // must not contain time ! ! // this defines how many page names to list when displaying ! // the MostPopular pages; the default is to show the 20 most popular pages ! define("MOST_POPULAR_LIST_LENGTH", 20); ! ! // this defines how many page names to list when displaying related pages ! define("NUM_RELATED_PAGES", 5); ! ! // allowed protocols for links - be careful not to allow "javascript:" ! // within a named link [name|uri] one more protocol is defined: phpwiki ! $AllowedProtocols = "http|https|mailto|ftp|news|gopher"; ! ! // URLs ending with the following extension should be inlined as images ! $InlineImages = "png|jpg|gif"; ! ! // If the last edit is older than MINOR_EDIT_TIMEOUT seconds, the default ! // state for the "minor edit" checkbox on the edit page form will be off ! // (even if the page author hasn't changed.) ! define("MINOR_EDIT_TIMEOUT", 7 * 24 * 3600); ! ! // Perl regexp for WikiNames ! // (?<!..) & (?!...) used instead of '\b' because \b matches '_' as well ! $WikiNameRegexp = "(?<![A-Za-z0-9])([A-Z][a-z]+){2,}(?![A-Za-z0-9])"; ! ! ! // InterWiki linking -- wiki-style links to other wikis on the web ! // Set InterWikiLinking to 1 if you would like to enable this feature ! $InterWikiLinking = 0; ! ! if ($InterWikiLinking) { ! // Intermap file for InterWikiLinks -- define other wikis there ! $interwikimap_file = "lib/interwiki.map"; ! ! include ('lib/interwiki.php'); ! // sets also $InterWikiLinkRegexp } ! ! ///////////////////////////////////////////////////////////////////// ! // Part Four: ! // Original pages and layout ! ///////////////////////////////////////////////////////////////////// ! ! // need to define localization function first -- skip this ! if (!function_exists ('gettext')) { ! $lcfile = "locale/$LANG/LC_MESSAGES/phpwiki.php"; ! if (file_exists($lcfile)) { include($lcfile); } ! else { $locale = array(); } ! ! function gettext ($text) { ! global $locale; ! if (!empty ($locale[$text])) ! return $locale[$text]; ! return $text; ! } ! } else { ! putenv ("LANG=$LANG"); ! bindtextdomain ("phpwiki", "./locale"); ! textdomain ("phpwiki"); } ! // end of localization function ! ! // Template files (filenames are relative to script position) ! $templates = array( ! "BROWSE" => gettext("templates/browse.html"), ! "EDITPAGE" => gettext("templates/editpage.html"), ! "MESSAGE" => gettext("templates/message.html") ! ); ! ! /* WIKI_PGSRC -- specifies the source for the initial page contents ! * of the Wiki. The setting of WIKI_PGSRC only has effect when ! * the wiki is accessed for the first time (or after clearing the ! * database.) WIKI_PGSRC can either name a directory or a zip file. ! * In either case WIKI_PGSRC is scanned for files --- one file per page. ! * ! * If the files appear to be MIME formatted messages, they are ! * scanned for application/x-phpwiki content-types. Any suitable ! * content is added to the wiki. ! * The files can also be plain text files, in which case the page name ! * is taken from the file name. */ ! ! define('WIKI_PGSRC', gettext("./pgsrc")); // Default (old) behavior. ! //define('WIKI_PGSRC', './wiki.zip'); // New style. ! ! // DEFAULT_WIKI_PGSRC is only used when the language is *not* ! // the default (English) and when reading from a directory: ! // in that case some English pages are inserted into the wiki as well ! // DEFAULT_WIKI_PGSRC defines where the English pages reside ! define('DEFAULT_WIKI_PGSRC', "./pgsrc"); ! ! ! ////////////////////////////////////////////////////////////////////// ! // you shouldn't have to edit anyting below this line ! ! if (empty($ScriptUrl)) { ! $port = ($SERVER_PORT == 80) ? '' : ":$SERVER_PORT"; ! $ScriptUrl = "http://$SERVER_NAME$port$SCRIPT_NAME"; } ! $ScriptName = preg_replace('@^.*/@', '', $ScriptUrl); ! ! // "\x80"-"\x9f" (and "\x00" - "\x1f") are non-printing control ! // chars in iso-8859-* ! // $FieldSeparator = "\263"; //this is a superscript 3 in ISO-8859-1. ! $FieldSeparator = "\x81"; ! ! // constants used for HTML output. HTML tags may allow nesting ! // other tags always start at level 0 ! define("ZERO_LEVEL", 0); ! define("NESTED_LEVEL", 1); ! // constants for flags in $pagehash ! define("FLAG_PAGE_LOCKED", 1); ?> --- 1,149 ---- <?php ! rcs_id('$Id$'); ! /* ! * NOTE: the settings here should probably not need to be changed. ! * ! * ! * (The user-configurable settings have been moved to index.php.) ! */ ! ! // essential internal stuff ! ! set_magic_quotes_runtime(0); ! ! // Some constants. ! ! // "\x80"-"\x9f" (and "\x00" - "\x1f") are non-printing control ! // chars in iso-8859-* ! // $FieldSeparator = "\263"; //this is a superscript 3 in ISO-8859-1. ! $FieldSeparator = "\x81"; ! ! ! // constants for flags in $pagehash ! define("FLAG_PAGE_LOCKED", 1); ! ! ////////////////////////////////////////////////////////////////// ! // ! // Set up localization ! // ! if (!function_exists ('gettext')) ! { ! $locale = array(); ! ! function gettext ($text) { ! global $locale; ! if (!empty ($locale[$text])) ! return $locale[$text]; ! return $text; } ! if ( ($lcfile = SearchPath("LC_MESSAGES/phpwiki.php", 'missing_ok')) ) ! { ! include($lcfile); } ! } ! else ! { ! putenv ("LANG=$LANG"); ! bindtextdomain ("phpwiki", "./locale"); ! textdomain ("phpwiki"); ! } ! ! ////////////////////////////////////////////////////////////////// ! // Autodetect URL settings: ! // ! if (!defined('SERVER_NAME')) define('SERVER_NAME', $SERVER_NAME); ! if (!defined('SERVER_PORT')) define('SERVER_PORT', $SERVER_PORT); ! if (!defined('SCRIPT_NAME')) define('SCRIPT_NAME', $SCRIPT_NAME); ! if (!defined('DATA_PATH')) ! define('DATA_PATH', dirname(SCRIPT_NAME)); ! if (!defined('USE_PATH_INFO')) ! { ! /* ! * If SCRIPT_NAME does not look like php source file, ! * or user cgi we assume that php is getting run by an ! * action handler in /cgi-bin. In this case, ! * I think there is no way to get Apache to pass ! * useful PATH_INFO to the php script (PATH_INFO ! * is used to the the php interpreter where the ! * php script is...) */ ! define('USE_PATH_INFO', ereg('\.(php3?|cgi)$', $SCRIPT_NAME)); ! } ! if (!defined('VIRTUAL_PATH')) ! { ! if (USE_PATH_INFO and isset($REDIRECT_URL)) ! { ! // FIXME: This is a hack, and won't work if the requested ! // pagename has a slash in it. ! define('VIRTUAL_PATH', dirname($REDIRECT_URL . 'x')); } ! else ! define('VIRTUAL_PATH', SCRIPT_NAME); ! } ! ! if (SERVER_PORT && SERVER_PORT != 80) ! define('SERVER_URL', ! "http://" . SERVER_NAME . ':' . SERVER_PORT); ! else ! define('SERVER_URL', ! "http://" . SERVER_NAME); ! ! if (VIRTUAL_PATH != SCRIPT_NAME) ! { ! // Apache action handlers are used. ! define('PATH_INFO_PREFIX', VIRTUAL_PATH . "/"); ! } ! else ! define("PATH_INFO_PREFIX", '/'); ! ! ! ////////////////////////////////////////////////////////////////// ! // Select database ! // ! if (!defined('DBTYPE')) ! { ! if ( floor(phpversion()) == 3) { ! define('DBTYPE', 'dbm'); ! } else { ! define('DBTYPE', 'dba'); ! } ! } ! switch (DBTYPE) ! { ! case 'dbm': ! include 'lib/dbmlib.php'; ! break; ! case 'dba': ! include 'lib/dbalib.php'; ! break; ! case 'mysql': ! include 'lib/mysql.php'; ! break; ! case 'pgsql': ! include 'lib/pgsql.php'; ! break; ! case 'msql': ! include 'lib/msql.php'; ! break; ! case 'file': ! include "lib/db_filesystem.php"; ! break; ! default: ! die(DBTYPE . ": unknown DBTYPE"); ! } ! ! // InterWiki linking -- wiki-style links to other wikis on the web ! // ! if (defined('INTERWIKI_MAP_FILE')) ! { ! include ('lib/interwiki.php'); ! } ! ! // For emacs users ! // Local Variables: ! // mode: php ! // c-file-style: "ellemtel" ! // End: ?> Index: db_filesystem.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/db_filesystem.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** db_filesystem.php 2001/01/01 23:18:46 1.4 --- db_filesystem.php 2001/02/12 01:43:10 1.5 *************** *** 19,23 **** --- 19,41 ---- */ + $WikiPageStore = "wiki"; + $ArchivePageStore = "archive"; + // Initialize our globals: + function _dbname($base) + { + extract($GLOBALS['DBParams']); + return "$directory/$database/${prefix}${base}"; + } + + $WikiDB['wiki'] = _dbname('pages'); + $WikiDB['archive'] = _dbname('archive'); + $WikiDB['wikilinks'] = _dbname('links'); + $WikiDB['hottopics'] = _dbname('hottopics'); + $WikiDB['hitcount'] = _dbname('hitcount'); + + if (preg_match('@%/tmp\b@', $DBParams['directory'])) + $DBWarning = "Filesystem DB directory is in the /tmp directory."; + // open a database and return the handle // loop until we get a handle; php has its own *************** *** 25,28 **** --- 43,47 ---- // Suppress ugly error message with @. + function OpenDataBase($dbname) { global $WikiDB; *************** *** 234,236 **** --- 253,260 ---- return $namelist; } + // For emacs users + // Local Variables: + // mode: php + // c-file-style: "ellemtel" + // End: ?> Index: dbalib.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/dbalib.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** dbalib.php 2001/01/31 02:01:27 1.2 --- dbalib.php 2001/02/12 01:43:10 1.3 *************** *** 27,30 **** --- 27,50 ---- + // Initialize our globals: + function _dbname($base) + { + extract($GLOBALS['DBParams']); + return "$directory/${database}${prefix}${base}"; + } + + $WikiPageStore = "wiki"; + $ArchivePageStore = "archive"; + $WikiDB = array('wiki' => _dbname('pagesdb'), + 'archive' => _dbname('archivedb'), + 'wikilinks' => _dbname('linksdb'), + 'hottopics' => _dbname('hottopicsdb'), + 'hitcount' => _dbname('hitcountdb')); + + if (preg_match('@%/tmp\b@', $DBParams['directory'])) + $DBWarning = "DBA files are in the /tmp directory."; + + define('MAX_DBM_ATTEMPTS', $DBParams['timeout']); + // open a database and return the handle // loop until we get a handle; php has its own *************** *** 76,81 **** } - - // Return hash of page + attributes or default function RetrievePage($dbi, $pagename, $pagestore) { --- 96,99 ---- *************** *** 89,93 **** } - // Either insert or replace a key/value (a page) function InsertPage($dbi, $pagename, $pagehash) { --- 107,110 ---- *************** *** 255,257 **** } ! ?> \ No newline at end of file --- 272,279 ---- } ! // For emacs users ! // Local Variables: ! // mode: php ! // c-file-style: "ellemtel" ! // End: ! ?> Index: dbmlib.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/dbmlib.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** dbmlib.php 2001/01/31 03:11:25 1.7 --- dbmlib.php 2001/02/12 01:43:10 1.8 *************** *** 22,26 **** --- 22,46 ---- */ + // Initialize our globals: + function _dbname($base) + { + extract($GLOBALS['DBParams']); + return "$directory/${database}${prefix}${base}"; + } + + $WikiPageStore = "wiki"; + $ArchivePageStore = "archive"; + $WikiDB = array('wiki' => _dbname('pagesdb'), + 'archive' => _dbname('archivedb'), + 'wikilinks' => _dbname('linksdb'), + 'hottopics' => _dbname('hottopicsdb'), + 'hitcount' => _dbname('hitcountdb')); + if (preg_match('@%/tmp\b@', $DBParams['directory'])) + $DBWarning = "DBM files are in the /tmp directory."; + + define('MAX_DBM_ATTEMPTS', $DBParams['timeout']); + + // open a database and return the handle // loop until we get a handle; php has its own *************** *** 481,483 **** --- 501,508 ---- } + // For emacs users + // Local Variables: + // mode: php + // c-file-style: "ellemtel" + // End: ?> Index: diff.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/diff.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** diff.php 2001/02/10 22:15:08 1.6 --- diff.php 2001/02/12 01:43:10 1.7 *************** *** 1067,1072 **** } ! GeneratePage('MESSAGE', $html, sprintf(gettext ("Diff of %s."), ! htmlspecialchars($pagename)), 0); } ?> --- 1067,1073 ---- } ! echo GeneratePage('MESSAGE', $html, ! sprintf(gettext ("Diff of %s."), ! htmlspecialchars($pagename)), 0); } ?> Index: display.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/display.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** display.php 2001/02/10 22:15:08 1.7 --- display.php 2001/02/12 01:43:10 1.8 *************** *** 17,23 **** } ! GeneratePage('BROWSE', $html, $pagename, $pagehash); flush(); IncreaseHitCount($dbi, $pagename); ?> --- 17,28 ---- } ! echo GeneratePage('BROWSE', $html, $pagename, $pagehash); flush(); IncreaseHitCount($dbi, $pagename); + // For emacs users + // Local Variables: + // mode: php + // c-file-style: "ellemtel" + // End: ?> Index: editpage.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/editpage.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** editpage.php 2001/02/10 22:15:08 1.10 --- editpage.php 2001/02/12 01:43:10 1.11 *************** *** 2,6 **** <?php ! // editpage relies on $pagename and $ScriptUrl $currentpage = RetrievePage($dbi, $pagename, $WikiPageStore); --- 2,6 ---- <?php ! // editpage relies on $pagename, $version $currentpage = RetrievePage($dbi, $pagename, $WikiPageStore); *************** *** 17,21 **** if (is_array($pagehash)) { ! if (($pagehash['flags'] & FLAG_PAGE_LOCKED) && $user->is_admin()) { $html = "<p>"; $html .= gettext ("This page has been locked by the administrator and cannot be edited."); --- 17,21 ---- if (is_array($pagehash)) { ! if (($pagehash['flags'] & FLAG_PAGE_LOCKED) && !$user->is_admin()) { $html = "<p>"; $html .= gettext ("This page has been locked by the administrator and cannot be edited."); *************** *** 23,27 **** $html .= gettext ("Sorry for the inconvenience."); $html .= "\n"; ! GeneratePage('MESSAGE', $html, sprintf (gettext ("Problem while editing %s"), $pagename), 0); ExitWiki (""); } --- 23,28 ---- $html .= gettext ("Sorry for the inconvenience."); $html .= "\n"; ! echo GeneratePage('MESSAGE', $html, ! sprintf (gettext ("Problem while editing %s"), $pagename), 0); ExitWiki (""); } *************** *** 46,60 **** } ! ! if ($user->id() == $currentpage['author'] || $user->is_admin()) { ! $ckbox = element('input', array('type' => 'checkbox', ! 'name' => 'minor_edit', ! 'value' => 'yes')); $page_age = time() - $currentpage['lastmodified']; ! if ($user->id() == $currentpage['author'] && $page_age < MINOR_EDIT_TIMEOUT) ! $ckbox .= " checked"; ! $pagehash['minor_edit_checkbox'] = $ckbox . '>'; } ! GeneratePage('EDITPAGE', $textarea, $pagename, $pagehash); ?> --- 47,80 ---- } ! if (empty($pagehash['copy'])) ! $do_archive = false; ! else if ( $user->is_admin() ) ! $do_archive = 'probably'; ! else if ( $user->id() == $currentpage['author'] ) ! { $page_age = time() - $currentpage['lastmodified']; ! if ($page_age < MINOR_EDIT_TIMEOUT) ! $do_archive = 'maybe'; ! else ! $do_archive = 'probably'; ! } ! else ! $do_archive = 'force'; ! ! if ($do_archive == 'probably' || $do_archive == 'maybe') ! { ! $pagehash['minor_edit_checkbox'] ! = Element('input', array('type' => 'checkbox', ! 'name' => 'minor_edit', ! 'value' => 'yes', ! 'checked' => ($do_archive == 'probably'))); } + + echo GeneratePage('EDITPAGE', $textarea, $pagename, $pagehash); ! // For emacs users ! // Local Variables: ! // mode: php ! // c-file-style: "ellemtel" ! // End: ?> Index: fullsearch.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/fullsearch.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** fullsearch.php 2001/02/10 22:15:08 1.5 --- fullsearch.php 2001/02/12 01:43:10 1.6 *************** *** 45,48 **** . "\n"; ! GeneratePage('MESSAGE', $html, gettext ("Full Text Search Results"), 0); ?> --- 45,48 ---- . "\n"; ! echo GeneratePage('MESSAGE', $html, gettext ("Full Text Search Results"), 0); ?> Index: interwiki.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/interwiki.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** interwiki.php 2001/02/08 10:39:41 1.1 --- interwiki.php 2001/02/12 01:43:10 1.2 *************** *** 1,22 **** ! <?php rcs_id("$Id$"); ! function generate_interwikimap_and_regexp() { ! global $interwikimap_file, $InterWikiLinkRegexp, $interwikimap; ! $intermap_data = file($interwikimap_file); ! $wikiname_regexp = ""; ! for ($i=0; $i<count($intermap_data); $i++) ! { ! list( $wiki, $inter_url ) = split(' ', chop($intermap_data[$i])); ! $interwikimap[$wiki] = $inter_url; ! if ($wikiname_regexp) ! $wikiname_regexp .= "|"; ! $wikiname_regexp .= $wiki; ! } ! $InterWikiLinkRegexp = "($wikiname_regexp)"; } ! generate_interwikimap_and_regexp(); ?> --- 1,63 ---- ! <?php rcs_id('$Id$'); ! function generate_interwikimap_and_regexp() ! { ! global $interwikimap_file, $InterWikiLinkRegexp, $interwikimap; ! ! $intermap_data = file(INTERWIKI_MAP_FILE); ! $wikiname_regexp = ""; ! for ($i=0; $i<count($intermap_data); $i++) { ! list( $wiki, $inter_url ) = split(' ', chop($intermap_data[$i])); ! $interwikimap[$wiki] = $inter_url; ! if ($wikiname_regexp) ! $wikiname_regexp .= "|"; ! $wikiname_regexp .= $wiki; ! } ! $InterWikiLinkRegexp = "($wikiname_regexp)"; ! } ! ! generate_interwikimap_and_regexp(); ! ! function LinkInterWikiLink($link, $linktext='') ! { ! global $interwikimap; ! list( $wiki, $page ) = split( ":", $link ); ! ! $url = $interwikimap[$wiki] . urlencode($page); ! return LinkURL($url, $linktext ? $linktext : $link); ! } ! ! // Link InterWiki links ! // These can be protected by a '!' like Wiki words. ! function wtt_interwikilinks($line, &$trfrm) ! { ! global $InterWikiLinkRegexp, $WikiNameRegexp; ! ! $n = $ntok = $trfrm->tokencounter; ! ! // FIXME: perhaps WikiNameRegexp is a bit too restrictive? ! $line = wt_tokenize($line, "!?(?<![A-Za-z0-9])$InterWikiLinkRegexp:$WikiNameRegexp", ! $trfrm->replacements, $ntok); ! while ($n < $ntok) { ! $old = $trfrm->replacements[$n]; ! if ($old[0] == '!') { ! $trfrm->replacements[$n] = substr($old,1); ! } else { ! $trfrm->replacements[$n] = LinkInterWikiLink($old); ! } ! $n++; } + + $trfrm->tokencounter = $ntok; + return $line; + } ! // For emacs users ! // Local Variables: ! // mode: php ! // c-file-style: "ellemtel" ! // End: ?> Index: msql.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/msql.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** msql.php 2001/02/01 04:24:26 1.6 --- msql.php 2001/02/12 01:43:10 1.7 *************** *** 20,29 **** // open a database and return the handle // ignores MAX_DBM_ATTEMPTS function OpenDataBase($dbinfo) { ! global $msql_db; ! if (! ($dbc = msql_connect())) { $msg = gettext ("Cannot establish connection to database, giving up."); --- 20,38 ---- + // Get rid of these globals! + $WikiPageStore['table'] = $DBParams['prefix'] . "wiki"; + $WikiPageStore['page_table'] = $DBParams['prefix'] . "wikipages"; + $ArchivePageStore['table'] = $DBParams['prefix'] . "archive"; + $ArchivePageStore['page_table'] = $DBParams['prefix'] . "archivepages"; + + // should be the same as wikipages.line + define("MSQL_MAX_LINE_LENGTH", 128); + // open a database and return the handle // ignores MAX_DBM_ATTEMPTS function OpenDataBase($dbinfo) { ! extract($GLOBALS['DBParams']); ! // FIXME: use $host, $port, $user, $password if (! ($dbc = msql_connect())) { $msg = gettext ("Cannot establish connection to database, giving up."); *************** *** 32,37 **** ExitWiki($msg); } ! if (!msql_select_db($msql_db, $dbc)) { ! $msg = gettext ("Cannot open database %s, giving up."); $msg .= "<BR>"; $msg .= sprintf(gettext ("Error message: %s"), msql_error()); --- 41,47 ---- ExitWiki($msg); } ! if (!msql_select_db($database, $dbc)) { ! $msg = sprintf(gettext ("Cannot open database %s, giving up."), ! $database); $msg .= "<BR>"; $msg .= sprintf(gettext ("Error message: %s"), msql_error()); *************** *** 514,516 **** --- 524,531 ---- */ + // For emacs users + // Local Variables: + // mode: php + // c-file-style: "ellemtel" + // End: ?> Index: mysql.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/mysql.php,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** mysql.php 2001/02/10 22:15:08 1.11 --- mysql.php 2001/02/12 01:43:10 1.12 *************** *** 27,37 **** */ // open a database and return the handle // ignores MAX_DBM_ATTEMPTS function OpenDataBase($dbname) { ! global $mysql_server, $mysql_user, $mysql_pwd, $mysql_db; ! if (!($dbc = mysql_pconnect($mysql_server, $mysql_user, $mysql_pwd))) { $msg = gettext ("Cannot establish connection to database, giving up."); $msg .= "<BR>"; --- 27,48 ---- */ + $WikiPageStore = $DBParams['prefix'] . "wiki"; + $ArchivePageStore = $DBParams['prefix'] . "archive"; + $WikiLinksStore = $DBParams['prefix'] . "wikilinks"; + $WikiScoreStore = $DBParams['prefix'] . "wikiscore"; + $HitCountStore = $DBParams['prefix'] . "hitcount"; + // open a database and return the handle // ignores MAX_DBM_ATTEMPTS function OpenDataBase($dbname) { ! extract($GLOBALS['DBParams']); ! if (empty($server)) ! $server = $socket; ! else if (!empty($port)) ! $server .= ":$port"; ! ! if (!($dbc = mysql_pconnect($server, $user, $password))) { $msg = gettext ("Cannot establish connection to database, giving up."); $msg .= "<BR>"; *************** *** 39,44 **** ExitWiki($msg); } ! if (!mysql_select_db($mysql_db, $dbc)) { ! $msg = sprintf(gettext ("Cannot open database %s, giving up."), $mysql_db); $msg .= "<BR>"; $msg .= sprintf(gettext ("MySQL error: %s"), mysql_error()); --- 50,55 ---- ExitWiki($msg); } ! if (!mysql_select_db($database, $dbc)) { ! $msg = sprintf(gettext ("Cannot open database %s, giving up."), $database); $msg .= "<BR>"; $msg .= sprintf(gettext ("MySQL error: %s"), mysql_error()); *************** *** 355,357 **** --- 366,374 ---- select pagename from wiki left join wikilinks on pagename=topage where topage is NULL; */ + + // For emacs users + // Local Variables: + // mode: php + // c-file-style: "ellemtel" + // End: ?> Index: pageinfo.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/pageinfo.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** pageinfo.php 2001/02/10 22:15:08 1.6 --- pageinfo.php 2001/02/12 01:43:10 1.7 *************** *** 58,61 **** $html .= ViewPageProps($pagename, $ArchivePageStore); ! GeneratePage('MESSAGE', $html, gettext("PageInfo").": '$pagename'", 0); ?> --- 58,62 ---- $html .= ViewPageProps($pagename, $ArchivePageStore); ! echo GeneratePage('MESSAGE', $html, ! gettext("PageInfo").": '$pagename'", 0); ?> Index: pgsql.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/pgsql.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** pgsql.php 2000/11/02 04:23:59 1.4 --- pgsql.php 2001/02/12 01:43:10 1.5 *************** *** 25,39 **** */ // open a database and return a hash function OpenDataBase($table) { ! global $WikiDataBase, $pg_dbhost, $pg_dbport; ! $connectstring = $pg_dbhost?"host=$pg_dbhost ":""; ! $connectstring .= $pg_dbport?"port=$pg_dbport ":""; ! $connectstring .= $WikiDataBase?"dbname=$WikiDataBase":""; ! ! if (!($dbc = pg_pconnect($connectstring))) { echo "Cannot establish connection to database, giving up."; exit(); --- 25,52 ---- */ + $WikiPageStore = $DBParams['prefix'] . "wiki"; + $ArchivePageStore = $DBParams['prefix'] . "archive"; + $WikiLinksPageStore = $DBParams['prefix'] . "wikilinks"; + $HotTopicsPageStore = $DBParams['prefix'] . "hottopics"; + $HitCountPageStore = $DBParams['prefix'] . "hitcount"; // open a database and return a hash function OpenDataBase($table) { ! extract($GLOBALS['DBParams']); ! ! $args = array(); ! if (!empty($server)) ! $args[] = "host=$server"; ! if (!empty($port)) ! $args[] = "port=$port"; ! if (!empty($database)) ! $args[] = "dbname=$database"; ! if (!empty($user)) ! $args[] = "user=$user"; ! if (!empty($password)) ! $args[] = "password=$password"; ! if (!($dbc = pg_pconnect(join(' ', $args)))) { echo "Cannot establish connection to database, giving up."; exit(); *************** *** 418,422 **** } - ?> --- 431,439 ---- } + // For emacs users + // Local Variables: + // mode: php + // c-file-style: "ellemtel" + // End: ?> Index: savepage.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/savepage.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** savepage.php 2001/02/10 22:15:08 1.10 --- savepage.php 2001/02/12 01:43:10 1.11 *************** *** 102,107 **** $html .= "</P>"; ! GeneratePage('MESSAGE', $html, ! sprintf (gettext ("Problem while updating %s"), $pagename), 0); exit; } --- 102,107 ---- $html .= "</P>"; ! echo GeneratePage('MESSAGE', $html, ! sprintf (gettext ("Problem while updating %s"), $pagename), 0); exit; } *************** *** 121,125 **** $html = "<p>" . gettext ("This page has been locked by the administrator and cannot be edited."); $html .= "\n<p>" . gettext ("Sorry for the inconvenience."); ! GeneratePage('MESSAGE', $html, sprintf (gettext ("Problem while editing %s"), $pagename), 0); ExitWiki (""); } --- 121,126 ---- $html = "<p>" . gettext ("This page has been locked by the administrator and cannot be edited."); $html .= "\n<p>" . gettext ("Sorry for the inconvenience."); ! echo GeneratePage('MESSAGE', $html, ! sprintf (gettext ("Problem while editing %s"), $pagename), 0); ExitWiki (""); } *************** *** 167,183 **** // fixme: no test for flat file db system ! if (isset($DBMdir) && preg_match('@^/tmp\b@', $DBMdir)) { ! $html .= "<P><B>Warning: the Wiki DB files still live in the " . ! "/tmp directory. Please read the INSTALL file and move " . ! "the DBM file to a permanent location or risk losing " . "all the pages!</B>\n"; } if (!empty($SignatureImg)) ! $html .= sprintf("<P><img src=\"%s\"></P>\n", MakeURLAbsolute($SignatureImg)); $html .= "<hr noshade><P>"; include('lib/transform.php'); ! GeneratePage('BROWSE', $html, $pagename, $pagehash); ?> --- 168,184 ---- // fixme: no test for flat file db system ! if (!empty($DBWarning)) { ! $html .= "<P><B>Warning: $DBWarning" . ! "Please read the INSTALL file and move " . ! "the DB file to a permanent location or risk losing " . "all the pages!</B>\n"; } if (!empty($SignatureImg)) ! $html .= sprintf("<P><img src=\"%s\"></P>\n", DataURL($SignatureImg)); $html .= "<hr noshade><P>"; include('lib/transform.php'); ! echo GeneratePage('BROWSE', $html, $pagename, $pagehash); ?> Index: search.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/search.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** search.php 2001/02/10 22:15:08 1.4 --- search.php 2001/02/12 01:43:10 1.5 *************** *** 28,31 **** . "\n"; ! GeneratePage('MESSAGE', $html, gettext ("Title Search Results"), 0); ?> --- 28,31 ---- . "\n"; ! echo GeneratePage('MESSAGE', $html, gettext ("Title Search Results"), 0); ?> Index: stdlib.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/stdlib.php,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -r1.27 -r1.28 *** stdlib.php 2001/02/10 22:15:08 1.27 --- stdlib.php 2001/02/12 01:43:10 1.28 *************** *** 5,9 **** Standard functions for Wiki functionality ExitWiki($errormsg) - MakeURLAbsolute($url, $base = false) WikiURL($pagename, $args, $abs) --- 5,8 ---- *************** *** 43,47 **** --- 42,76 ---- } + function SearchPath ($file, $missing_ok = false, $path = false) + { + if (ereg('^/', $file)) + return $file; // absolute path. + + if (!$path) + $path = $GLOBALS['DataPath']; + + while (list($i, $dir) = each($path)) + { + if (file_exists("$dir/$file")) + return "$dir/$file"; + } + if ($missing_ok) + return false; + die("$file: file not found"); + } + + function arrays_equal ($a, $b) + { + if (sizeof($a) != sizeof($b)) + return false; + for ($i = 0; $i < sizeof($a); $i++) + if ($a[$i] != $b[$i]) + return false; + return true; + } + + + function ExitWiki($errormsg) { *************** *** 63,79 **** } ! function MakeURLAbsolute($url, $base = false) { ! global $ScriptUrl; ! if (preg_match('@^(\w+:|/)@', $url)) return $url; ! ! return preg_replace('@[^/]*$@', '', empty($base) ? $ScriptUrl : $base) . $url; } ! ! function WikiURL($pagename, $args = '', $make_abs_url = false) { ! global $ScriptName, $ScriptUrl; ! if (is_array($args)) { --- 92,102 ---- } ! function DataURL($url) { if (preg_match('@^(\w+:|/)@', $url)) return $url; ! return SERVER_URL . DATA_PATH . "/$url"; } ! function WikiURL($pagename, $args = '') { if (is_array($args)) { *************** *** 87,101 **** if (USE_PATH_INFO) { ! $url = $make_abs_url ? "$ScriptUrl/" : ''; ! $url .= rawurlencode($pagename); if ($args) $url .= "?$args"; } else { ! $url = $make_abs_url ? $ScriptUrl : $ScriptName; ! $url .= "?pagename=" . rawurlencode($pagename); if ($args) $url .= "&$args"; } return $url; } --- 110,124 ---- if (USE_PATH_INFO) { ! $url = rawurlencode($pagename); if ($args) $url .= "?$args"; } else { ! $url = basename(SCRIPT_NAME) . ! "?pagename=" . rawurlencode($pagename); if ($args) $url .= "&$args"; } + return $url; } *************** *** 113,118 **** if (is_array($args)) { ! while (list($key, $val) = each($args)) ! $html .= sprintf(' %s="%s"', $key, htmlspecialchars($val)); } else --- 136,146 ---- if (is_array($args)) { ! while (list($key, $val) = each($args)) ! { ! if (is_string($val) || is_numeric($val)) ! $html .= sprintf(' %s="%s"', $key, htmlspecialchars($val)); ! else if ($val) ! $html .= " $key"; ! } } else *************** *** 123,127 **** { $html .= $content; ! $html .= "</$tag>"; } return $html; --- 151,155 ---- { $html .= $content; ! $html .= "</$tag>\n";//FIXME: newline might not always be desired. } return $html; *************** *** 171,183 **** } - function LinkInterWikiLink($link, $linktext='') { - global $interwikimap; - - list( $wiki, $page ) = split( ":", $link ); - - $url = $interwikimap[$wiki] . urlencode($page); - return LinkURL($url, $linktext ? $linktext : $link); - } - // converts spaces to tabs --- 199,202 ---- *************** *** 220,227 **** ! function MakeWikiForm ($pagename, $args, $button_text = '') { ! global $ScriptUrl; ! ! $formargs['action'] = USE_PATH_INFO ? WikiURL($pagename) : $ScriptUrl; $formargs['method'] = 'post'; $contents = ''; --- 239,245 ---- ! function MakeWikiForm ($pagename, $args, $button_text = '') ! { ! $formargs['action'] = USE_PATH_INFO ? WikiURL($pagename) : SCRIPT_NAME; $formargs['method'] = 'post'; $contents = ''; *************** *** 232,236 **** $a = array('name' => $key, 'value' => $val, 'type' => 'hidden'); ! if (preg_match('/^ (\d*) \( (.*) \) $/x', $val, $m)) { $input_seen++; --- 250,254 ---- $a = array('name' => $key, 'value' => $val, 'type' => 'hidden'); ! if (preg_match('/^ (\d*) \( (.*) \) ((upload)?) $/xi', $val, $m)) { $input_seen++; *************** *** 238,241 **** --- 256,268 ---- $a['size'] = $m[1] ? $m[1] : 30; $a['value'] = $m[2]; + if ($m[3]) + { + $a['type'] = 'file'; + $formargs['enctype'] = 'multipart/form-data'; + $contents .= Element('input', + array('name' => 'MAX_FILE_SIZE', + 'value' => MAX_UPLOAD_SIZE, + 'type' => 'hidden')); + } } *************** *** 243,254 **** } if (!empty($button_text)) { ! if ($input_seen) ! $contents .= ' '; ! $contents .= Element('input', array('type' => 'submit', ! 'value' => $button_text)); } ! return Element('form', $formargs, $contents); } --- 270,283 ---- } + $row = Element('td', $contents); + if (!empty($button_text)) { ! $row .= Element('td', Element('input', array('type' => 'submit', ! 'value' => $button_text))); } ! return Element('form', $formargs, ! Element('table', ! Element('tr', $row))); } *************** *** 286,289 **** --- 315,329 ---- } + + // FIXME: ug, don't like this + + if (!empty($args['action']) && !IsSafeAction($args['action'])) + { + // Don't allow administrative links on unlocked pages. + global $pagehash; + if (($pagehash['flags'] & FLAG_PAGE_LOCKED) == 0) + return QElement('u', gettext('Lock page to enable link')); + } + // FIXME: ug, don't like this if (preg_match('/=\d*\(/', $qargs)) *************** *** 294,299 **** function ParseAndLink($bracketlink) { ! global $dbi, $ScriptUrl, $AllowedProtocols, $InlineImages; ! global $InterWikiLinking, $InterWikiLinkRegexp; // $bracketlink will start and end with brackets; in between --- 334,339 ---- function ParseAndLink($bracketlink) { ! global $dbi, $AllowedProtocols, $InlineImages; ! global $InterWikiLinkRegexp; // $bracketlink will start and end with brackets; in between *************** *** 335,339 **** $link['type'] = "footnote-$linktype"; $link['link'] = $URL; ! } elseif ($InterWikiLinking && preg_match("#^$InterWikiLinkRegexp:#", $URL)) { $link['type'] = "interwiki-$linktype"; --- 375,379 ---- $link['type'] = "footnote-$linktype"; $link['link'] = $URL; ! } elseif (function_exists('LinkInterWikiLink') && preg_match("#^$InterWikiLinkRegexp:#", $URL)) { $link['type'] = "interwiki-$linktype"; *************** *** 381,385 **** } - function LinkRelatedPages($dbi, $pagename) { --- 421,424 ---- *************** *** 436,442 **** function GeneratePage($template, $content, $name, $hash) { ! global $ScriptUrl, $AllowedProtocols, $templates; global $datetimeformat, $dbi, $logo, $FieldSeparator; ! global $user; if (!is_array($hash)) --- 475,481 ---- function GeneratePage($template, $content, $name, $hash) { ! global $templates; global $datetimeformat, $dbi, $logo, $FieldSeparator; ! global $user, $pagename; if (!is_array($hash)) *************** *** 476,480 **** } ! $page = join('', file($templates[$template])); $page = str_replace('###', "$FieldSeparator#", $page); --- 515,519 ---- } ! $page = join('', file(SearchPath($templates[$template]))); $page = str_replace('###', "$FieldSeparator#", $page); *************** *** 493,499 **** _dotoken('USERID', htmlspecialchars($user->id()), $page); - _dotoken('SCRIPTURL', htmlspecialchars($ScriptUrl), $page); _dotoken('PAGE', htmlspecialchars($name), $page); ! _dotoken('LOGO', htmlspecialchars(MakeURLAbsolute($logo)), $page); global $RCS_IDS; _dotoken('RCS_IDS', join("\n", $RCS_IDS), $page); --- 532,537 ---- _dotoken('USERID', htmlspecialchars($user->id()), $page); _dotoken('PAGE', htmlspecialchars($name), $page); ! _dotoken('LOGO', htmlspecialchars(DataURL($logo)), $page); global $RCS_IDS; _dotoken('RCS_IDS', join("\n", $RCS_IDS), $page); *************** *** 506,511 **** _dotoken('BROWSE', WikiURL(''), $page); ! // FIXME: this is possibly broken. ! _dotoken('BASE_URL', WikiURL($name, '', 'absolute_url'), $page); // invalid for messages (search results, error messages) --- 544,552 ---- _dotoken('BROWSE', WikiURL(''), $page); ! if (USE_PATH_INFO) ! _dotoken('BASE_URL', ! SERVER_URL . VIRTUAL_PATH . "/" . WikiURL($pagename), $page); ! else ! _dotoken('BASE_URL', SERVER_URL . SCRIPT_NAME, $page); // invalid for messages (search results, error messages) *************** *** 528,532 **** _dotoken('CONTENT', $content, $page); ! print $page; } ?> --- 569,578 ---- _dotoken('CONTENT', $content, $page); ! return $page; } + // For emacs users + // Local Variables: + // mode: php + // c-file-style: "ellemtel" + // End: ?> Index: transform.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/transform.php,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -r1.14 -r1.15 *** transform.php 2001/02/10 22:15:08 1.14 --- transform.php 2001/02/12 01:43:10 1.15 *************** *** 5,8 **** --- 5,11 ---- define('WT_MODE_MARKUP', 3); + define("ZERO_LEVEL", 0); + define("NESTED_LEVEL", 1); + class WikiTransform { *************** *** 199,203 **** $transform->register(WT_TOKENIZER, 'wtt_bracketlinks'); $transform->register(WT_TOKENIZER, 'wtt_urls'); ! if ($InterWikiLinking) { $transform->register(WT_TOKENIZER, 'wtt_interwikilinks'); } --- 202,206 ---- $transform->register(WT_TOKENIZER, 'wtt_bracketlinks'); $transform->register(WT_TOKENIZER, 'wtt_urls'); ! if (function_exists('wtt_interwikilinks')) { $transform->register(WT_TOKENIZER, 'wtt_interwikilinks'); } *************** *** 324,350 **** - // Link InterWiki links - // These can be protected by a '!' like Wiki words. - function wtt_interwikilinks($line, &$trfrm) - { - global $InterWikiLinkRegexp, $WikiNameRegexp; - - $n = $ntok = $trfrm->tokencounter; - $line = wt_tokenize($line, "!?(?<![A-Za-z0-9])$InterWikiLinkRegexp:$WikiNameRegexp", $trfrm->replacements, $ntok); - while ($n < $ntok) { - $old = $trfrm->replacements[$n]; - if ($old[0] == '!') { - $trfrm->replacements[$n] = substr($old,1); - } else { - $trfrm->replacements[$n] = LinkInterWikiLink($old); - } - $n++; - } - $trfrm->tokencounter = $ntok; - return $line; - } - - // Link Wiki words (BumpyText) // Wikiwords preceeded by a '!' are not linked --- 327,331 ---- *************** *** 528,530 **** --- 509,517 ---- return $line; } + + // For emacs users + // Local Variables: + // mode: php + // c-file-style: "ellemtel" + // End: ?> Index: userauth.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/userauth.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** userauth.php 2001/02/10 22:15:08 1.1 --- userauth.php 2001/02/12 01:43:10 1.2 *************** *** 13,18 **** // Arg $login_mode: // default: Anonymous users okay. // 'LOGOUT': Force logout. ! // 'REQUIRE_AUTH': Force authenticated login. function WikiUser ($auth_mode = '') { // Restore from cookie. --- 13,20 ---- // Arg $login_mode: // default: Anonymous users okay. + // 'ANON_OK': Anonymous access is fine. + // 'REQUIRE_AUTH': User must be authenticated. // 'LOGOUT': Force logout. ! // 'LOGIN': Force authenticated login. function WikiUser ($auth_mode = '') { // Restore from cookie. *************** *** 27,36 **** $this = unserialize(fix_magic_quotes_gpc($WIKI_AUTH)); ! if ($auth_mode != 'LOGOUT') { $user = $this->_get_authenticated_userid(); ! if (!$user && $auth_mode == 'REQUIRE_AUTH') $warning = $this->_demand_http_authentication(); //NORETURN } --- 29,44 ---- $this = unserialize(fix_magic_quotes_gpc($WIKI_AUTH)); ! if ($this->state == 'authorized' && $auth_mode == 'LOGIN') ! { ! // ...logout ! $this->realm++; ! $this->state = 'loggedout'; ! } ! if ($auth_mode != 'LOGOUT') { $user = $this->_get_authenticated_userid(); ! if (!$user && $auth_mode != 'ANON_OK') $warning = $this->_demand_http_authentication(); //NORETURN } *************** *** 125,127 **** --- 133,140 ---- } + // For emacs users + // Local Variables: + // mode: php + // c-file-style: "ellemtel" + // End: ?> Index: ziplib.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/ziplib.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** ziplib.php 2001/02/10 22:15:08 1.5 --- ziplib.php 2001/02/12 01:43:10 1.6 *************** *** 358,362 **** { function ZipReader ($zipfile) { ! if (!($this->fp = fopen($zipfile, "rb"))) die("Can't open zip file '$zipfile' for reading"); } --- 358,364 ---- { function ZipReader ($zipfile) { ! if (!is_string($zipfile)) ! $this->fp = $zipfile; // File already open ! else if (!($this->fp = fopen($zipfile, "rb"))) die("Can't open zip file '$zipfile' for reading"); } *************** *** 524,528 **** $params['flags'] = 'PAGE_LOCKED'; ! if (is_array($refs)) { // phpwiki's with versions > 1.2.x shouldn't have references. --- 526,530 ---- $params['flags'] = 'PAGE_LOCKED'; ! if (isset($refs) && is_array($refs)) { // phpwiki's with versions > 1.2.x shouldn't have references. *************** *** 696,707 **** // FIXME: more sanity checking? ! $pagehash = array('pagename' => rawurldecode($params['pagename']), ! 'author' => rawurldecode($params['author']), ! 'version' => $params['version'], ! 'lastmodified' => $params['lastmodified'], ! 'created' => $params['created']); $pagehash['flags'] = 0; ! if (preg_match('/PAGE_LOCKED/', $params['flags'])) ! $pagehash['flags'] |= FLAG_PAGE_LOCKED; $encoding = strtolower($headers['content-transfer-encoding']); --- 698,716 ---- // FIXME: more sanity checking? ! $pagehash = array('pagename' => '', ! 'author' => '', ! 'version' => 0, ! 'lastmodified' => '', ! 'created' => ''); ! while(list($key, $val) = each ($pagehash)) ! if (!empty($params[$key])) ! $pagehash[$key] = rawurldecode($params[$key]); ! $pagehash['flags'] = 0; ! if (!empty($params['flags'])) ! { ! if (preg_match('/PAGE_LOCKED/', $params['flags'])) ! $pagehash['flags'] |= FLAG_PAGE_LOCKED; ! } $encoding = strtolower($headers['content-transfer-encoding']); --- setupwiki.php DELETED --- |
From: Geoffrey T. D. <da...@us...> - 2001-02-12 01:42:38
|
Update of /cvsroot/phpwiki/phpwiki/templates In directory usw-pr-cvs1:/tmp/cvs-serv13525/templates Modified Files: editpage.html Log Message: log Index: editpage.html =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/templates/editpage.html,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** editpage.html 2001/02/10 22:15:08 1.9 --- editpage.html 2001/02/12 01:43:10 1.10 *************** *** 41,45 **** "%%%" makes a linebreak, "- - - -" makes a horizontal rule, escape "[" with "[[" <br>more on ! <a href="###SCRIPTURL###?TextFormattingRules"><b>TextFormattingRules</b></a> </small> --- 41,45 ---- "%%%" makes a linebreak, "- - - -" makes a horizontal rule, escape "[" with "[[" <br>more on ! <a href="###BROWSE###?TextFormattingRules"><b>TextFormattingRules</b></a> </small> |
From: Geoffrey T. D. <da...@us...> - 2001-02-12 01:42:38
|
Update of /cvsroot/phpwiki/phpwiki/pgsrc In directory usw-pr-cvs1:/tmp/cvs-serv13525/pgsrc Modified Files: PhpWikiAdministration Log Message: log Index: PhpWikiAdministration =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/pgsrc/PhpWikiAdministration,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** PhpWikiAdministration 2001/02/10 22:41:29 1.5 --- PhpWikiAdministration 2001/02/12 01:43:10 1.6 *************** *** 1,3 **** ! __Note__: The actions on this page require administrative privileges. They won't work unless you have set an admin username and password in the PhpWiki config file. --- 1,13 ---- ! From hos...@da... Sat Feb 10 21:28:19 2001 ! Subject: PhpWikiAdministration ! From: hos...@da... (PhpWiki) ! Date: Sat, 10 Feb 2001 20:11:14 -0800 ! Mime-Version: 1.0 (Produced by PhpWiki 1.1.x) ! Content-Type: application/x-phpwiki; ! pagename=PhpWikiAdministration; ! flags=PAGE_LOCKED ! Content-Transfer-Encoding: binary ! ! __Note__: Most of the actions on this page require administrative privileges. They won't work unless you have set an admin username and password in the PhpWiki config file. *************** *** 13,51 **** ---------- ! ! ZIP files of database ! __[ZIP Snapshot | phpwiki:?action=zip]__ : contains only the latest versions ! __[ZIP Dump | phpwiki:?action=zip&include=all]__ : contains all archived versions ! These links lead to zip files, generated on the fly, which contain the most ! recent versions of all pages in the PhpWiki. The pages are stored, one per ! file, as MIME (RFC2045) e-mail (RFC822) messages, with the content type ! application/x-phpwiki for the snapshot and content type multipart/mixed for ! the dump. In the latter case, there is one subpart (with type ! application/x-phpwiki) for each version of the ! page (in chronological order). The message body contains the page text, ! while the page meta-data is included as parameters in the ! Content-Type: header field. ! ----------- ! ! Load / Dump Serialized Pages ! Here you can load or dump pages of your Wiki into a directory of your ! choice. ! __Dump__ ! [ Dump Serialized Pages | phpwiki:?action=dumpserial&directory=(/tmp/wikidump) ] ! Pages will be written out as "serialized" strings of a PHP ! associative array, meaning they will not be human readable. If ! the directory does not exist PhpWiki will try to create one for you. ! Ensure that your server has write permissions to the directory! ! __Load__ ! [ Load Serialized Pages | phpwiki:?action=loadserial&directory=(/tmp/wikidump) ] If you have dumped a set of pages from PhpWiki, you can reload them here. --- 23,55 ---- ---------- ! !! Making Snapshots or Backups ! ! ZIP files of database ! These links lead to zip files, generated on the fly, which contain all ! the pages in your Wiki. The zip file will be downloaded to your local computer. ! This __[ZIP Snapshot | phpwiki:?action=zip]__ contains only the latest versions ! of each page, while this __[ZIP Dump | phpwiki:?action=zip&include=all]__ contains all ! archived versions. ! (If the PhpWiki is configured to allow it,) anyone can download a zip file. ! If your php has ''zlib'' support, the files in the archive will be compressed, ! otherwise they will just be stored. ! ! Dump to directory ! Here you can dump pages of your Wiki into a directory of your choice. ! [ Dump Pages | phpwiki:?action=dumpserial&directory=(/tmp/wikidump) ] ! The most recent version of each page will written out to the ! directory, one page per file. ! Your server must have write permissions to the directory! ! ----------- ! !! Restoring If you have dumped a set of pages from PhpWiki, you can reload them here. *************** *** 53,57 **** your FrontPage when you load it from this form it will overwrite the one in your database now. If you want to be selective just delete ! the pages from the directory you don't want to load. ----------- --- 57,107 ---- your FrontPage when you load it from this form it will overwrite the one in your database now. If you want to be selective just delete ! the pages from the directory (or zip file) which you don't want to load. ! ! ! Upload File ! ! Here you can upload ZIP archives, or individual files from ! your (client) machine. + [ Upload | phpwiki:?action=upload&file=()upload ] + + ! Load File + + Here you can load ZIP archives, individual files or entire directories. + The file or directory must be local to the http server. + You can also use this form to load from an http: or ftp: URL. + + [ Load | phpwiki:?action=loadfile&source=(/tmp/wikidump) ] + ----------- + + !! Format of the files + + Currently the pages are stored, one per + file, as MIME ([ RFC2045 | http://www.faqs.org/rfcs/rfc2045.html ]) e-mail + ([ RFC822 | http://www.faqs.org/rfcs/rfc822.html ]) messages. + The content-type ''application/x-phpwiki'' is used, and page meta-data + is encoded in the content-type parameters. + (If the file contains several versions of a page, it will have + type ''multipart/mixed'', and contain several sub-parts, each + with type ''application/x-phpwiki''.) + The message body contains the page text. + + ! Old Formats + + __Serialized Files__ + + The dump to directory command used to dump the pages as + php ''serialized()'' strings. For humans, this made the files very hard + to read, and nearly impossible to edit. + + __Plain Files__ + + Before that the page text was just dumped to a file --- this means + that all page meta-data was lost. + + The upload and load functions will automatically recognize each of these + three types of files, and handle them accordingly. + Note that when loading ''plain files'', the page name is deduced from the + file name. + |
From: Geoffrey T. D. <da...@us...> - 2001-02-12 01:42:38
|
Update of /cvsroot/phpwiki/phpwiki In directory usw-pr-cvs1:/tmp/cvs-serv13525 Modified Files: HISTORY index.php Log Message: log Index: HISTORY =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/HISTORY,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -r1.14 -r1.15 *** HISTORY 2001/02/10 22:15:07 1.14 --- HISTORY 2001/02/12 01:43:09 1.15 *************** *** 1,2 **** --- 1,23 ---- + 02/11/01 Jeff's hacks continue: + + * Moved user configuration stuff into index.php. What was index.php is + now in lib/main.php. + + * Refactored the DB configuration variables. There's one define() constant + which specifies type database type, and one hash (used by all the + databases) which holds database, file, and server selection. + The actual file/table names are now "hard-coded" into the individual + database modules --- I have added the hook for setting a prefix + to be applied to all file/table names. + I think it's much cleaner, but let me know if you think otherwise. + (I've only tested the dba and mysql backends.) + + * Refactored the dump/load zip/directory stuff. You can now upload zip-dumps + or individual files from your local (client) machine. + See PhpWikiAdministration. + + * Fixed a bunch of bugs --- mostly the one's I introduced in my last big + commit. + 02/09/01 Jeff hack's again: Index: index.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/index.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** index.php 2001/02/10 22:15:07 1.6 --- index.php 2001/02/12 01:43:09 1.7 *************** *** 1,127 **** <?php ! $RCS_IDS = array('$Id$'); ! function rcs_id($id) ! { ! global $RCS_IDS; ! $RCS_IDS[] = $id; ! } ! ! include "lib/config.php"; ! include "lib/stdlib.php"; ! include "lib/userauth.php"; ! ! ! if (isset($pagename)) ! $pagename = fix_magic_quotes_gpc($pagename); ! else if (USE_PATH_INFO && !empty($PATH_INFO)) ! $pagename = substr($PATH_INFO, 1); ! else ! $pagename = gettext("FrontPage"); ! ! if (empty($action)) ! $action = 'browse'; ! else ! fix_magic_quotes_gpc($action); ! ! // Fix for compatibility with very old diff links in RecentChanges. ! // (The [phpwiki:?diff=PageName] style links are fixed elsewhere.) ! if (isset($diff)) ! { ! $action = 'diff'; ! $pagename = fix_magic_quotes_gpc($diff); ! unset($diff); ! } ! ! function get_auth_mode ($action) ! { ! switch ($action) { ! ! case 'logout': ! return 'LOGOUT'; ! ! case 'login': ! return 'REQUIRE_AUTH'; ! ! case 'lock': ! case 'unlock': ! case 'remove': ! case 'dumpserial': ! case 'loadserial': ! // Auto-login if user attempts one of these ! return 'REQUIRE_AUTH'; ! ! case 'zip': ! // Auto-loing if necessary ! return ZIPDUMP_AUTH ? 'REQUIRE_AUTH' : 'NORMAL'; ! ! default: ! return 'NORMAL'; ! } ! } ! ! $user = new WikiUser(get_auth_mode($action)); ! ! // All requests require the database ! $dbi = OpenDataBase($WikiPageStore); ! ! // if there is no FrontPage, create a basic set of Wiki pages ! if ( ! IsWikiPage($dbi, gettext("FrontPage")) ) ! { ! include "lib/setupwiki.php"; ! } ! ! switch ($action) { ! case 'edit': ! include "lib/editpage.php"; ! break; ! case 'search': ! if (isset($searchtype) && ($searchtype == 'full')) { ! include "lib/fullsearch.php"; ! } ! else { ! include "lib/search.php"; ! } ! break; ! ! case 'save': ! include "lib/savepage.php"; ! break; ! case 'info': ! include "lib/pageinfo.php"; ! break; ! case 'diff': ! include "lib/diff.php"; ! break; ! ! case 'zip': ! include "admin/zip.php"; ! break; ! ! case 'dumpserial': ! include "admin/dumpserial.php"; ! break; ! ! case 'loadserial': ! include "admin/loadserial.php"; ! break; ! ! case 'remove': ! include 'admin/removepage.php'; ! break; ! ! case 'lock': ! case 'unlock': ! include "admin/lockpage.php"; ! include "lib/display.php"; ! break; ! ! case 'browse': ! case 'login': ! case 'logout': ! default: ! include "lib/display.php"; // defaults to FrontPage ! break; ! } ! CloseDataBase($dbi); ?> --- 1,231 ---- <?php ! define ('PHPWIKI_VERSION', '1.3.0pre'); ! error_reporting(E_ALL /* ^ E_NOTICE */); ! $RCS_IDS = array("SCRIPT_NAME='$SCRIPT_NAME'", ! '$Id$'); ! ! ///////////////////////////////////////////////////////////////////// ! // ! // Part One: ! // Authentication and security settings: ! // ! ///////////////////////////////////////////////////////////////////// ! ! // If set, we will perform reverse dns lookups to try to convert the users ! // IP number to a host name, even if the http server didn't do it for us. ! define('ENABLE_REVERSE_DNS', true); ! ! // Username and password of administrator. ! // Set these to your preferences. For heaven's sake ! // pick a good password! ! define('ADMIN_USER', ""); ! define('ADMIN_PASSWD', ""); ! ! // If true, only the admin user can make zip dumps, else ! // zip dumps require no authentication. ! define('ZIPDUMP_AUTH', false); ! ! // The maximum file upload size. ! define('MAX_UPLOAD_SIZE', 16 * 1024 * 1024); ! ! // If the last edit is older than MINOR_EDIT_TIMEOUT seconds, the default ! // state for the "minor edit" checkbox on the edit page form will be off. ! define("MINOR_EDIT_TIMEOUT", 7 * 24 * 3600); ! ! ///////////////////////////////////////////////////////////////////// ! // ! // Part Two: ! // Database Selection ! // ! ///////////////////////////////////////////////////////////////////// ! ! // Pick one of 'dbm', 'dba', 'mysql', 'pgsql', 'msql', or 'file'. ! // (Or leaven DBTYPE undefined for default behavior (which is 'dba' ! // if supported, else 'dbm'). ! ! //define("DBTYPE", 'mysql'); ! ! // 'dbm' and 'dba create files named "$directory/${database}{$prefix}*". ! // 'file' creates files named "$directory/${database}/{$prefix}*/*". ! // The sql types use tables named "{$prefix}*" ! ! // ! // This array holds the parameters which select the database to use. ! // ! // Not all of these parameters are used by any particular DB backend. ! // ! $DBParams = array( ! // Used by all DB types: ! 'database' => 'wiki', ! 'prefix' => '', // prefix for filenames or table names ! ! // Used by 'dbm', 'dba', 'file' ! 'directory' => "/tmp", ! ! // Used by 'dbm', 'dba' ! 'timeout' => 20, ! ! // Used by *sql as neccesary to log in to server: ! 'server' => 'localhost', ! 'port' => '', ! 'socket' => '', ! 'user' => 'guest', ! 'password' => '' ! ); ! ! ! ///////////////////////////////////////////////////////////////////// ! // ! // Part Three: ! // Page appearance and layout ! // ! ///////////////////////////////////////////////////////////////////// ! ! // Select your language - default language "C": English ! // other languages available: Dutch "nl", Spanish "es", German "de", ! // and Swedish "sv" ! $LANG = "C"; ! ! // logo image (path relative to index.php) ! $logo = "images/wikibase.png"; ! ! // Signature image which is shown after saving an edited page ! // If this is left blank (or unset), the signature will be omitted. ! //$SignatureImg = "images/signature.png"; ! ! // date & time formats used to display modification times, etc. ! // formats are given as format strings to PHP date() function ! // FIXME: these should have different defaults depending on locale. ! $datetimeformat = "F j, Y"; // may contain time of day ! $dateformat = "F j, Y"; // must not contain time ! ! // this defines how many page names to list when displaying ! // the MostPopular pages; the default is to show the 20 most popular pages ! define("MOST_POPULAR_LIST_LENGTH", 20); ! ! // this defines how many page names to list when displaying related pages ! define("NUM_RELATED_PAGES", 5); ! ! // This path is searched when trying to read WIKI_PGSRC ! // or template files. ! $DataPath = array(".", "locale/$LANG"); ! ! // Template files (filenames are relative to script position) ! // (These filenames will be passed through gettext() before use.) ! $templates = array("BROWSE" => "templates/browse.html", ! "EDITPAGE" => "templates/editpage.html", ! "MESSAGE" => "templates/message.html"); ! ! ! /* WIKI_PGSRC -- specifies the source for the initial page contents ! * of the Wiki. The setting of WIKI_PGSRC only has effect when ! * the wiki is accessed for the first time (or after clearing the ! * database.) WIKI_PGSRC can either name a directory or a zip file. ! * In either case WIKI_PGSRC is scanned for files --- one file per page. ! */ ! define('WIKI_PGSRC', "pgsrc"); // Default (old) behavior. ! //define('WIKI_PGSRC', 'wiki.zip'); // New style. ! ! // DEFAULT_WIKI_PGSRC is only used when the language is *not* ! // the default (English) and when reading from a directory: ! // in that case some English pages are inserted into the wiki as well ! // DEFAULT_WIKI_PGSRC defines where the English pages reside ! // FIXME: is this really needed? Can't we just copy ! // these pages into the localized pgsrc? ! define('DEFAULT_WIKI_PGSRC', "pgsrc"); ! // These are the pages which will get loaded from DEFAULT_WIKI_PGSRC. ! $GenericPages = array("ReleaseNotes", "SteveWainstead", "TestPage"); ! ! ///////////////////////////////////////////////////////////////////// ! // ! // Part four: ! // Mark-up options. ! // ! ///////////////////////////////////////////////////////////////////// ! ! // allowed protocols for links - be careful not to allow "javascript:" ! // URL of these types will be automatically linked. ! // within a named link [name|uri] one more protocol is defined: phpwiki ! $AllowedProtocols = "http|https|mailto|ftp|news|gopher"; ! ! // URLs ending with the following extension should be inlined as images ! $InlineImages = "png|jpg|gif"; ! ! // Perl regexp for WikiNames ("bumpy words") ! // (?<!..) & (?!...) used instead of '\b' because \b matches '_' as well ! $WikiNameRegexp = "(?<![A-Za-z0-9])([A-Z][a-z]+){2,}(?![A-Za-z0-9])"; ! ! // InterWiki linking -- wiki-style links to other wikis on the web ! // ! // Intermap file for InterWikiLinks -- define other wikis there ! // Leave this undefined to disable InterWiki linking. ! define('INTERWIKI_MAP_FILE', "lib/interwiki.map"); ! ! ///////////////////////////////////////////////////////////////////// ! // ! // Part five: ! // URL options -- you can probably skip this section. ! // ! ///////////////////////////////////////////////////////////////////// ! /****************************************************************** ! * ! * The following section contains settings which you can use to tailor ! * the URLs which PhpWiki generates. ! * ! * Any of these parameters which are left undefined will be ! * deduced automatically. You need only set them explicitly ! * if the auto-detected values prove to be incorrect. ! * ! * In most cases the auto-detected values should work fine, ! * so hopefully you don't need to mess with this section. ! * ! ******************************************************************/ ! ! /* ! * Canonical name and httpd port of the server on which this ! * PhpWiki resides. ! */ ! //define('PHPWIKI_SERVER_NAME', 'some.host.com'); ! //define('PHPWIKI_SERVER_PORT', 80); ! ! /* ! * Absolute URL (from the server root) of the PhpWiki ! * script. ! */ ! //define('PHPWIKI_SCRIPT_NAME', '/some/where/index.php'); ! ! /* ! * Absolute URL (from the server root) of the directory ! * in which relative URL's for images and other support files ! * are interpreted. ! */ ! //define('PHPWIKI_DATA_PATH', '/some/where'); ! ! /* ! * Define to 'true' to use PATH_INFO to pass the pagename's. ! * e.g. http://www.some.where/index.php/FrontPage instead ! * of http://www.some.where/index.php?pagename=FrontPage ! * FIXME: more docs (maybe in README). ! */ ! //define('USE_PATH_INFO', false); ! ! /* ! * FIXME: add docs ! * (Only used if USE_PATH_INFO is true.) ! */ ! //define('PHPWIKI_VIRTUAL_PATH', '/SomeWiki'); ! ! ! //////////////////////////////////////////////////////////////// ! // Okay... fire up the code: ! //////////////////////////////////////////////////////////////// ! ! include "lib/main.php"; ! ! // For emacs users ! // Local Variables: ! // mode: php ! // c-file-style: "ellemtel" ! // End: ?> |
From: Geoffrey T. D. <da...@us...> - 2001-02-12 01:42:38
|
Update of /cvsroot/phpwiki/phpwiki/admin In directory usw-pr-cvs1:/tmp/cvs-serv13525/admin Removed Files: dumpserial.php loadserial.php zip.php Log Message: log --- dumpserial.php DELETED --- --- loadserial.php DELETED --- --- zip.php DELETED --- |
From: Steve W. <wai...@us...> - 2001-02-11 20:18:27
|
Update of /cvsroot/phpwiki/phpwiki In directory usw-pr-cvs1:/tmp/cvs-serv18372 Added Files: UPGRADING Log Message: Started new file to help users upgrade from previous versions of PhpWiki. ***** Error reading new file: [Errno 2] No such file or directory: 'UPGRADING' |
From: Geoffrey T. D. <da...@us...> - 2001-02-10 22:41:01
|
Update of /cvsroot/phpwiki/phpwiki/pgsrc In directory usw-pr-cvs1:/tmp/cvs-serv23610/pgsrc Modified Files: PhpWikiAdministration Log Message: Fix 'dump serialized pages' link Index: PhpWikiAdministration =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/pgsrc/PhpWikiAdministration,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** PhpWikiAdministration 2001/02/10 22:15:08 1.4 --- PhpWikiAdministration 2001/02/10 22:41:29 1.5 *************** *** 38,42 **** __Dump__ ! [ Dump Serialized Pages | phpwiki:?action=dumpserial&directory=%/tmp/wikidump ] Pages will be written out as "serialized" strings of a PHP --- 38,42 ---- __Dump__ ! [ Dump Serialized Pages | phpwiki:?action=dumpserial&directory=(/tmp/wikidump) ] Pages will be written out as "serialized" strings of a PHP *************** *** 47,51 **** __Load__ ! [ Load Serialized Pages | phpwiki:?action=loadserial&directory=%/tmp/wikidump ] If you have dumped a set of pages from PhpWiki, you can reload them here. --- 47,51 ---- __Load__ ! [ Load Serialized Pages | phpwiki:?action=loadserial&directory=(/tmp/wikidump) ] If you have dumped a set of pages from PhpWiki, you can reload them here. |
From: Geoffrey T. D. <da...@us...> - 2001-02-10 22:14:40
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory usw-pr-cvs1:/tmp/cvs-serv20420/lib Modified Files: config.php diff.php display.php editpage.php fullsearch.php mysql.php pageinfo.php savepage.php search.php stdlib.php transform.php ziplib.php Added Files: userauth.php Removed Files: editlinks.php Log Message: Jeff hacks again: LOT's of changes. Highlights: * Pagename in PATH_INFO support added. * Redid the user (admin) authentication stuff. All access now through index.php. See HISTORY for (a few) more details. --- NEW FILE --- <?php rcs_id('$Id'); // It is anticipated that when userid support is added to phpwiki, // this object will hold much more information (e-mail, home(wiki)page, // etc.) about the user. // There seems to be no clean way to "log out" a user when using // HTTP authentication. // So we'll hack around this by storing the currently logged // in username and other state information in a cookie. class WikiUser { // Arg $login_mode: // default: Anonymous users okay. // 'LOGOUT': Force logout. // 'REQUIRE_AUTH': Force authenticated login. function WikiUser ($auth_mode = '') { // Restore from cookie. global $WIKI_AUTH; if (empty($WIKI_AUTH)) { $this->userid = ''; $this->state = 'login'; $this->realm = 'PhpWiki0000'; } else $this = unserialize(fix_magic_quotes_gpc($WIKI_AUTH)); if ($auth_mode != 'LOGOUT') { $user = $this->_get_authenticated_userid(); if (!$user && $auth_mode == 'REQUIRE_AUTH') $warning = $this->_demand_http_authentication(); //NORETURN } if (empty($user)) { // Authentication failed if ($this->state == 'authorized') $this->realm++; $this->state = 'loggedout'; $this->userid = get_remote_host(); // Anonymous user id is hostname. } else { // Successful authentication $this->state = 'authorized'; $this->userid = $user; } // Save state to cookie. setcookie('WIKI_AUTH', serialize($this), 0, '/'); if (isset($warning)) echo $warning; } function id () { return $this->userid; } function is_authenticated () { return $this->state == 'authorized'; } function is_admin () { return $this->is_authenticated() && $this->userid == ADMIN_USER; } function must_be_admin ($action = "do that") { if (! $this->is_admin()) ExitWiki("You must be logged in as an administrator to $action."); } function _get_authenticated_userid () { if ( ! ($user = $this->_get_http_authenticated_userid()) ) return false; switch ($this->state) { case 'login': // Either we just asked for a password, or cookies are not enabled. // In either case, proceed with successful login. return $user; case 'loggedout': // We're logged out. Ignore http authed user. return false; default: // Else, as long as the user hasn't changed, fine. if ($user && $user != $this->userid) return false; return $user; } } function _get_http_authenticated_userid () { global $PHP_AUTH_USER, $PHP_AUTH_PW; if (empty($PHP_AUTH_USER) || empty($PHP_AUTH_PW)) return false; if (($PHP_AUTH_USER != ADMIN_USER) || ($PHP_AUTH_PW != ADMIN_PASSWD)) return false; return $PHP_AUTH_USER; } function _demand_http_authentication () { if (!defined('ADMIN_USER') || !defined('ADMIN_PASSWD') || ADMIN_USER == '' || ADMIN_PASSWD =='') { return "<p><b>You must set the administrator account and password" . "before you can log in.</b></p>\n"; } // Request password $this->userid = ''; $this->state = 'login'; setcookie('WIKI_AUTH', serialize($this), 0, '/'); header('WWW-Authenticate: Basic realm="' . $this->realm . '"'); header("HTTP/1.0 401 Unauthorized"); echo gettext ("You entered an invalid login or password."); exit; } } ?> Index: config.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/config.php,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -r1.28 -r1.29 *** config.php 2001/02/08 18:19:16 1.28 --- config.php 2001/02/10 22:15:08 1.29 *************** *** 1,3 **** --- 1,4 ---- <?php + rcs_id('$Id$'); // essential internal stuff -- skip it. Go down to Part One. There *************** *** 8,18 **** error_reporting(E_ALL ^ E_NOTICE); - if (!function_exists('rcs_id')) { - function rcs_id($id) { echo "<!-- $id -->\n"; }; - } - rcs_id('$Id$'); - // end essential internal stuff - - ///////////////////////////////////////////////////////////////////// // Part One: --- 9,12 ---- *************** *** 24,31 **** // you can leave this empty - it will be calculated automatically $ScriptUrl = ""; - // URL of admin.php e.g. http://yoursite.com/phpwiki/admin.php - // you can leave this empty - it will be calculated automatically - // if you fill in $ScriptUrl you *MUST* fill in $AdminUrl as well! - $AdminUrl = ""; // Select your language - default language "C": English --- 18,21 ---- *************** *** 34,37 **** --- 24,46 ---- $LANG="C"; + // Define to 'true' to use PATH_INFO to pass the pagename's. + // e.g. http://www.some.where/index.php/FrontPage instead + // of http://www.some.where/index.php?pagename=FrontPage + define('USE_PATH_INFO', true); + + // Username and password of administrator. + // Set these to your preferences. For heaven's sake + // pick a good password! + define('ADMIN_USER', ""); + define('ADMIN_PASSWD', ""); + + // If true, only the admin user can make zip dumps, else + // zip dumps require no authentication. + define('ZIPDUMP_AUTH', false); + + // If set, we will perform reverse dns lookups to try to convert the users + // IP number to a host name, even if the http server didn't do it for us. + define('ENABLE_REVERSE_DNS', true); + ///////////////////////////////////////////////////////////////////// // Part Two: *************** *** 153,159 **** define("NUM_RELATED_PAGES", 5); - // number of user-defined external references, i.e. "[1]" - define("NUM_LINKS", 12); - // allowed protocols for links - be careful not to allow "javascript:" // within a named link [name|uri] one more protocol is defined: phpwiki --- 162,165 ---- *************** *** 163,167 **** $InlineImages = "png|jpg|gif"; - // If the last edit is older than MINOR_EDIT_TIMEOUT seconds, the default // state for the "minor edit" checkbox on the edit page form will be off --- 169,172 ---- *************** *** 169,173 **** define("MINOR_EDIT_TIMEOUT", 7 * 24 * 3600); - // Perl regexp for WikiNames // (?<!..) & (?!...) used instead of '\b' because \b matches '_' as well --- 174,177 ---- *************** *** 216,220 **** "BROWSE" => gettext("templates/browse.html"), "EDITPAGE" => gettext("templates/editpage.html"), - "EDITLINKS" => gettext("templates/editlinks.html"), "MESSAGE" => gettext("templates/message.html") ); --- 220,223 ---- *************** *** 243,247 **** - ////////////////////////////////////////////////////////////////////// // you shouldn't have to edit anyting below this line --- 246,249 ---- *************** *** 251,269 **** $ScriptUrl = "http://$SERVER_NAME$port$SCRIPT_NAME"; } ! if (defined('WIKI_ADMIN') && !empty($AdminUrl)) ! $ScriptUrl = $AdminUrl; ! $FieldSeparator = "\263"; ! ! if (isset($PHP_AUTH_USER)) { ! $remoteuser = $PHP_AUTH_USER; ! } else { ! ! // Apache won't show REMOTE_HOST unless the admin configured it ! // properly. We'll be nice and see if it's there. ! ! getenv('REMOTE_HOST') ? ($remoteuser = getenv('REMOTE_HOST')) ! : ($remoteuser = getenv('REMOTE_ADDR')); ! } // constants used for HTML output. HTML tags may allow nesting --- 253,262 ---- $ScriptUrl = "http://$SERVER_NAME$port$SCRIPT_NAME"; } ! $ScriptName = preg_replace('@^.*/@', '', $ScriptUrl); ! // "\x80"-"\x9f" (and "\x00" - "\x1f") are non-printing control ! // chars in iso-8859-* ! // $FieldSeparator = "\263"; //this is a superscript 3 in ISO-8859-1. ! $FieldSeparator = "\x81"; // constants used for HTML output. HTML tags may allow nesting Index: diff.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/diff.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** diff.php 2001/02/07 18:35:09 1.5 --- diff.php 2001/02/10 22:15:08 1.6 *************** *** 159,162 **** --- 159,164 ---- function _diag ($xoff, $xlim, $yoff, $ylim, $nchunks) { + $flip = false; + if ($xlim - $xoff > $ylim - $yoff) { *************** *** 196,200 **** reset($matches); while (list ($junk, $y) = each($matches)) ! if (! $this->in_seq[$y]) { $k = $this->_lcs_pos($y); --- 198,202 ---- reset($matches); while (list ($junk, $y) = each($matches)) ! if (empty($this->in_seq[$y])) { $k = $this->_lcs_pos($y); *************** *** 214,218 **** $this->in_seq[$y] = 1; } ! else if (! $this->in_seq[$y]) { $k = $this->_lcs_pos($y); --- 216,220 ---- $this->in_seq[$y] = 1; } ! else if (empty($this->in_seq[$y])) { $k = $this->_lcs_pos($y); *************** *** 818,832 **** function format ($diff, $from_lines) { ! $html = '<table width="100%" bgcolor="black"' . ! "cellspacing=2 cellpadding=2 border=0>\n"; ! $html .= $this->_format($diff->edits, $from_lines); ! $html .= "</table>\n"; ! ! return $html; } function _format ($edits, $from_lines) { ! $html = ''; $x = 0; $y = 0; $xlim = sizeof($from_lines); --- 820,835 ---- function format ($diff, $from_lines) { ! return Element('table', ! array('width' => '100%', ! 'bgcolor' => 'black', ! 'cellspacing' => 2, ! 'cellpadding' => 2, ! 'border' => 0), ! $this->_format($diff->edits, $from_lines)); } function _format ($edits, $from_lines) { ! $rows = ''; $x = 0; $y = 0; $xlim = sizeof($from_lines); *************** *** 898,903 **** = array($ybeg, $ylen, $xbeg, $xlen); ! $html .= $this->_emit_diff($xbeg,$xlen,$ybeg,$ylen, ! $hunks); unset($hunks); } --- 901,905 ---- = array($ybeg, $ylen, $xbeg, $xlen); ! $rows .= $this->_emit_diff($xbeg,$xlen,$ybeg,$ylen, $hunks); unset($hunks); } *************** *** 917,921 **** $y += $ncopy; } ! return $html; } --- 919,923 ---- $y += $ncopy; } ! return $rows; } *************** *** 923,931 **** { $html = ''; reset($lines); while (list ($junk, $line) = each($lines)) { ! $html .= "<tr bgcolor=\"$color\"><td><tt>$prefix</tt>"; ! $html .= "<tt>" . htmlspecialchars($line) . "</tt></td></tr>\n"; } return $html; --- 925,936 ---- { $html = ''; + $prefix = Element('td', array('bgcolor' => '#cccccc'), $prefix); reset($lines); while (list ($junk, $line) = each($lines)) { ! $line = empty($line) ? ' ' : htmlspecialchars($line); ! $html .= Element('tr', ! $prefix . Element('td', array('bgcolor' => $color), ! Element('tt', $line))); } return $html; *************** *** 934,944 **** function _emit_diff ($xbeg,$xlen,$ybeg,$ylen,$hunks) { ! $html = '<tr><td><table width="100%" bgcolor="white"' ! . " cellspacing=0 border=0 cellpadding=4>\n" ! . '<tr bgcolor="#cccccc"><td><tt>' ! . $this->_diff_header($xbeg, $xlen, $ybeg, $ylen) ! . "</tt></td></tr>\n<tr><td>\n" ! . "<table width=\"100%\" cellspacing=0 border=0 cellpadding=2>\n"; ! $prefix = array('c' => $this->context_prefix, 'a' => $this->adds_prefix, --- 939,947 ---- function _emit_diff ($xbeg,$xlen,$ybeg,$ylen,$hunks) { ! $header = Element('tr', array('bgcolor' => '#cccccc'), ! Element('td', array('colspan' => 2), ! QElement('tt', ! $this->_diff_header($xbeg, $xlen, $ybeg, $ylen)))); ! $prefix = array('c' => $this->context_prefix, 'a' => $this->adds_prefix, *************** *** 948,966 **** 'd' => '#ccffcc'); for (reset($hunks); $hunk = current($hunks); next($hunks)) { if (!empty($hunk['c'])) ! $html .= $this->_emit_lines($hunk['c'], $this->context_prefix, '#ffffff'); if (!empty($hunk['d'])) ! $html .= $this->_emit_lines($hunk['d'], $this->deletes_prefix, '#ccffcc'); if (!empty($hunk['a'])) ! $html .= $this->_emit_lines($hunk['a'], $this->adds_prefix, '#ffcccc'); } ! $html .= "</table></td></tr></table></td></tr>\n"; ! return $html; } --- 951,978 ---- 'd' => '#ccffcc'); + $diff = ''; for (reset($hunks); $hunk = current($hunks); next($hunks)) { if (!empty($hunk['c'])) ! $diff .= $this->_emit_lines($hunk['c'], $this->context_prefix, '#ffffff'); if (!empty($hunk['d'])) ! $diff .= $this->_emit_lines($hunk['d'], $this->deletes_prefix, '#ccffcc'); if (!empty($hunk['a'])) ! $diff .= $this->_emit_lines($hunk['a'], $this->adds_prefix, '#ffcccc'); } ! ! return Element('tr', Element('td', ! Element('table', ! array('width' => '100%', ! 'bgcolor' => 'white', ! 'cellspacing' => 0, ! 'cellpadding' => 4, ! 'border' => 0), ! $header. $diff))); ! } *************** *** 1009,1061 **** ///////////////////////////////////////////////////////////////// ! if ($diff) { ! if (get_magic_quotes_gpc()) { ! $diff = stripslashes($diff); ! } ! ! $pagename = $diff; $wiki = RetrievePage($dbi, $pagename, $WikiPageStore); - // $dba = OpenDataBase($ArchivePageStore); $archive= RetrievePage($dbi, $pagename, $ArchivePageStore); - - $html = '<table><tr><td align="right">'; - $html .= gettext ("Current page:"); - $html .= '</td>'; - if (is_array($wiki)) { - $html .= "<td>"; - $html .= sprintf(gettext ("version %s"), $wiki['version']); - $html .= "</td><td>"; - $html .= sprintf(gettext ("last modified on %s"), - date($datetimeformat, $wiki['lastmodified'])); - $html .= "</td><td>"; - $html .= sprintf (gettext ("by %s"), $wiki['author']); - $html .= "</td>"; - } else { - $html .= "<td colspan=3><em>"; - $html .= gettext ("None"); - $html .= "</em></td>"; - } - $html .= "</tr>\n"; - $html .= '<tr><td align="right">'; - $html .= gettext ("Archived page:"); - $html .= '</td>'; - if (is_array($archive)) { - $html .= "<td>"; - $html .= sprintf(gettext ("version %s"), $archive['version']); - $html .= "</td><td>"; - $html .= sprintf(gettext ("last modified on %s"), - date($datetimeformat, $archive['lastmodified'])); - $html .= "</td><td>"; - $html .= sprintf(gettext ("by %s"), $archive['author']); - $html .= "</td>"; - } else { - $html .= "<td colspan=3><em>"; - $html .= gettext ("None"); - $html .= "</em></td>"; - } - $html .= "</tr></table><p>\n"; if (is_array($wiki) && is_array($archive)) { --- 1021,1058 ---- ///////////////////////////////////////////////////////////////// ! function PageInfoRow ($label, $hash) { ! global $datetimeformat; ! ! $cols = QElement('td', array('align' => 'right'), $label); ! ! ! if (is_array($hash)) { ! extract($hash); ! $cols .= QElement('td', ! sprintf(gettext ("version %s"), $version)); ! $cols .= QElement('td', ! sprintf(gettext ("last modified on %s"), ! date($datetimeformat, $lastmodified))); ! $cols .= QElement('td', ! sprintf(gettext ("by %s"), $author)); ! } else { ! $cols .= QElement('td', array('colspan' => '3'), ! gettext ("None")); ! } ! return Element('tr', $cols); ! } + if (isset($pagename)) + { $wiki = RetrievePage($dbi, $pagename, $WikiPageStore); $archive= RetrievePage($dbi, $pagename, $ArchivePageStore); + $html = Element('table', + PageInfoRow(gettext ("Current page:"), $wiki) + . PageInfoRow(gettext ("Archived page:"), $archive)); + + $html .= "<p>\n"; + if (is_array($wiki) && is_array($archive)) { Index: display.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/display.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** display.php 2001/02/07 21:11:46 1.6 --- display.php 2001/02/10 22:15:08 1.7 *************** *** 4,26 **** rcs_id('$Id$'); - // if we got GET data, the first item is always a page name - // if it wasn't this file would not have been included - - if (empty($QUERY_STRING) && isset($argv[0])) - $QUERY_STRING = $argv[0]; - - if (isset($QUERY_STRING) && preg_match('/^[-+%\w]+$/', $QUERY_STRING)) { - $pagename = urldecode($QUERY_STRING); - } else { - $pagename = gettext("FrontPage"); - - // if there is no FrontPage, create a basic set of Wiki pages - if (! IsWikiPage($dbi, $pagename)) { - include "lib/setupwiki.php"; - } - } - $html = ""; ! $enc_name = rawurlencode($pagename); $pagehash = RetrievePage($dbi, $pagename, $WikiPageStore); --- 4,9 ---- rcs_id('$Id$'); $html = ""; ! $pagehash = RetrievePage($dbi, $pagename, $WikiPageStore); *************** *** 31,35 **** } else { $html .= sprintf(gettext("Describe %s here."), ! "$pagename<a href='$ScriptUrl?edit=$enc_name'>?</a>"); } --- 14,18 ---- } else { $html .= sprintf(gettext("Describe %s here."), ! LinkUnknownWikiWord($pagename)); } Index: editpage.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/editpage.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** editpage.php 2001/02/07 22:14:35 1.9 --- editpage.php 2001/02/10 22:15:08 1.10 *************** *** 4,31 **** // editpage relies on $pagename and $ScriptUrl ! if ($edit) { ! $pagename = rawurldecode($edit); ! if (get_magic_quotes_gpc()) { ! $pagename = stripslashes($pagename); ! } ! $banner = htmlspecialchars($pagename); ! $pagehash = RetrievePage($dbi, $pagename, $WikiPageStore); ! } elseif ($copy) { ! $pagename = rawurldecode($copy); ! if (get_magic_quotes_gpc()) { ! $pagename = stripslashes($pagename); ! } $banner = htmlspecialchars (sprintf (gettext ("Copy of %s"), $pagename)); $pagehash = RetrievePage($dbi, $pagename, $ArchivePageStore); - } else { ! ExitWiki(gettext ("No page name passed into editpage!")); } - if (is_array($pagehash)) { ! if (($pagehash['flags'] & FLAG_PAGE_LOCKED) && !defined('WIKI_ADMIN')) { $html = "<p>"; $html .= gettext ("This page has been locked by the administrator and cannot be edited."); --- 4,21 ---- // editpage relies on $pagename and $ScriptUrl ! $currentpage = RetrievePage($dbi, $pagename, $WikiPageStore); ! $editing_copy = isset($version) && $version == 'archive'; ! if ($editing_copy) { $banner = htmlspecialchars (sprintf (gettext ("Copy of %s"), $pagename)); $pagehash = RetrievePage($dbi, $pagename, $ArchivePageStore); } else { ! $banner = htmlspecialchars($pagename); ! $pagehash = $currentpage; } if (is_array($pagehash)) { ! if (($pagehash['flags'] & FLAG_PAGE_LOCKED) && $user->is_admin()) { $html = "<p>"; $html .= gettext ("This page has been locked by the administrator and cannot be edited."); *************** *** 38,44 **** $textarea = implode("\n", $pagehash["content"]); ! if (isset($copy)) { ! // $cdbi = OpenDataBase($WikiPageStore); ! $currentpage = RetrievePage($dbi, $pagename, $WikiPageStore); $pagehash["version"] = $currentpage["version"]; } --- 28,32 ---- $textarea = implode("\n", $pagehash["content"]); ! if ($editing_copy) { $pagehash["version"] = $currentpage["version"]; } *************** *** 47,51 **** $pagehash["copy"] = 1; } - $currentpage = $pagehash; } } else { --- 35,38 ---- *************** *** 59,67 **** } ! if ($currentpage['author'] == $remoteuser) { $page_age = time() - $currentpage['lastmodified']; ! if ($page_age < MINOR_EDIT_TIMEOUT) { ! $pagehash['minor_edit'] = 1; ! } } --- 46,58 ---- } ! ! if ($user->id() == $currentpage['author'] || $user->is_admin()) { ! $ckbox = element('input', array('type' => 'checkbox', ! 'name' => 'minor_edit', ! 'value' => 'yes')); $page_age = time() - $currentpage['lastmodified']; ! if ($user->id() == $currentpage['author'] && $page_age < MINOR_EDIT_TIMEOUT) ! $ckbox .= " checked"; ! $pagehash['minor_edit_checkbox'] = $ckbox . '>'; } Index: fullsearch.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/fullsearch.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** fullsearch.php 2000/12/30 21:09:13 1.4 --- fullsearch.php 2001/02/10 22:15:08 1.5 *************** *** 3,19 **** rcs_id('$Id$'); ! if(get_magic_quotes_gpc()) ! $full = stripslashes($full); $html = "<P><B>" . sprintf(gettext ("Searching for \"%s\" ....."), ! htmlspecialchars($full)) . "</B></P>\n<DL>\n"; // search matching pages ! $query = InitFullSearch($dbi, $full); // quote regexp chars (space are treated as "or" operator) ! $full = preg_replace("/\s+/", "|", preg_quote($full)); $found = 0; --- 3,21 ---- rcs_id('$Id$'); ! if (empty($searchterm)) ! $searchterm = ''; // FIXME: do something better here? + fix_magic_quotes_gpc($searchterm); + $html = "<P><B>" . sprintf(gettext ("Searching for \"%s\" ....."), ! htmlspecialchars($searchterm)) . "</B></P>\n<DL>\n"; // search matching pages ! $query = InitFullSearch($dbi, $searchterm); // quote regexp chars (space are treated as "or" operator) ! $qterm = preg_replace("/\s+/", "|", preg_quote($searchterm)); $found = 0; *************** *** 25,30 **** // print out all matching lines, highlighting the match for ($j = 0; $j < (count($pagehash["content"])); $j++) { ! if ($hits = preg_match_all("/$full/i", $pagehash["content"][$j], $dummy)) { ! $matched = preg_replace("/$full/i", "${FieldSeparator}OT\\0${FieldSeparator}CT", $pagehash["content"][$j]); --- 27,32 ---- // print out all matching lines, highlighting the match for ($j = 0; $j < (count($pagehash["content"])); $j++) { ! if ($hits = preg_match_all("/$qterm/i", $pagehash["content"][$j], $dummy)) { ! $matched = preg_replace("/$qterm/i", "${FieldSeparator}OT\\0${FieldSeparator}CT", $pagehash["content"][$j]); Index: mysql.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/mysql.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** mysql.php 2001/01/04 18:37:56 1.10 --- mysql.php 2001/02/10 22:15:08 1.11 *************** *** 119,125 **** if (!mysql_query("replace into $dbi[table] ($COLUMNS) values ($VALUES)", $dbi['dbc'])) { ! $msg = sprintf(gettext ("Error writing page '%s'"), $pagename); $msg .= "<BR>"; ! $msg .= sprintf(gettext ("MySQL error: %s"), mysql_error()); ExitWiki($msg); } --- 119,125 ---- if (!mysql_query("replace into $dbi[table] ($COLUMNS) values ($VALUES)", $dbi['dbc'])) { ! $msg = htmlspecialchars(sprintf(gettext ("Error writing page '%s'"), $pagename)); $msg .= "<BR>"; ! $msg .= htmlspecialchars(sprintf(gettext ("MySQL error: %s"), mysql_error())); ExitWiki($msg); } *************** *** 294,298 **** function GetWikiPageLinks($dbi, $pagename) { global $WikiLinksStore, $WikiScoreStore, $HitCountStore; ! $pagename = addslashes($pagename); $res = mysql_query("select topage, score from $WikiLinksStore, $WikiScoreStore where topage=pagename and frompage='$pagename' order by score desc, topage"); --- 294,299 ---- function GetWikiPageLinks($dbi, $pagename) { global $WikiLinksStore, $WikiScoreStore, $HitCountStore; ! $links = array(); ! $pagename = addslashes($pagename); $res = mysql_query("select topage, score from $WikiLinksStore, $WikiScoreStore where topage=pagename and frompage='$pagename' order by score desc, topage"); Index: pageinfo.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/pageinfo.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** pageinfo.php 2000/11/01 11:31:41 1.5 --- pageinfo.php 2001/02/10 22:15:08 1.6 *************** *** 2,76 **** <!-- Display the internal structure of a page. Steve Wainstead, June 2000 --> <?php - if (get_magic_quotes_gpc()) { - $info = stripslashes($info); - } - $encname = htmlspecialchars($info); - $enter = gettext ("Enter a page name"); - $go = gettext ("Go"); - $html = "<form action=\"$ScriptUrl\" METHOD=GET>\n" . - "<input name=\"info\" value=\"$encname\">" . - " $enter\n" . - "<input type=submit value=$go><br>\n" . - "<input type=checkbox name=showpagesource"; ! if (isset($showpagesource) && ($showpagesource == "on")) { ! $html .= " checked"; ! } ! $html .= "> "; ! $html .= gettext ("Show the page source and references"); ! $html .= "\n</form>\n"; ! ! // don't bother unless we were asked ! if (! $info) { ! GeneratePage('MESSAGE', $html, gettext("PageInfo"), 0); ! exit; } ! function ViewpageProps($name, $pagestore) ! { ! global $dbi, $showpagesource, $datetimeformat, $FieldSeparator; ! ! $pagehash = RetrievePage($dbi, $name, $pagestore); ! if ($pagehash == -1) { ! $table = sprintf (gettext ("Page name '%s' is not in the database"), ! $name) . "\n"; } ! else { ! $table = "<table border=1 bgcolor=white>\n"; ! while (list($key, $val) = each($pagehash)) { ! if ($key > 0 || !$key) #key is an array index ! continue; ! if ((gettype($val) == "array") && ($showpagesource == "on")) { ! $val = implode($val, "$FieldSeparator#BR#$FieldSeparator\n"); ! $val = htmlspecialchars($val); ! $val = str_replace("$FieldSeparator#BR#$FieldSeparator", "<br>", $val); ! } ! elseif (($key == 'lastmodified') || ($key == 'created')) ! $val = date($datetimeformat, $val); ! else ! $val = htmlspecialchars($val); - $table .= "<tr><td>$key</td><td>$val</td></tr>\n"; - } ! $table .= "</table>"; ! } ! return $table; ! } ! $html .= "<P><B>"; ! $html .= gettext ("Current version"); ! $html .= "</B></p>"; ! // $dbi = OpenDataBase($WikiPageStore); --- done by index.php ! $html .= ViewPageProps($info, $WikiPageStore); ! ! $html .= "<P><B>"; ! $html .= gettext ("Archived version"); ! $html .= "</B></p>"; ! // $dbi = OpenDataBase($ArchivePageStore); ! $html .= ViewPageProps($info, $ArchivePageStore); ! GeneratePage('MESSAGE', $html, gettext("PageInfo").": '$info'", 0); ?> --- 2,61 ---- <!-- Display the internal structure of a page. Steve Wainstead, June 2000 --> <?php ! ! function ViewpageProps($name, $pagestore) ! { ! global $dbi, $showpagesource, $datetimeformat, $FieldSeparator; ! ! $pagehash = RetrievePage($dbi, $name, $pagestore); ! if ($pagehash == -1) { ! return QElement('p', ! sprintf (gettext ("Page name '%s' is not in the database"), ! $name)); } ! $rows = ''; ! while (list($key, $val) = each($pagehash)) { ! if ($key > 0 || !$key) ! continue; //key is an array index ! $cols = QElement('td', array('align' => 'right'), $key); ! ! if (is_array($val)) ! { ! if (empty($showpagesource)) ! continue; ! $cols .= Element('td', ! nl2br(htmlspecialchars(join("\n", $val)))); } ! elseif (($key == 'lastmodified') || ($key == 'created')) ! $cols .= QElement('td', ! date($datetimeformat, $val)); ! else ! $cols .= QElement('td', $val); ! ! $rows .= Element('tr', $cols); ! } ! return Element('table', array('border' => 1, 'bgcolor' => 'white'), $rows); ! } ! $html = ''; ! ! if (empty($showpagesource)) ! { ! $text = gettext ("Show the page source"); ! $url = WikiURL($pagename, array('action' => 'info', ! 'showpagesource' => 'on')); ! $html .= QElement('a', array('href' => $url), $text); ! } ! ! $html .= Element('p', QElement('b', gettext ("Current version"))); ! $html .= ViewPageProps($pagename, $WikiPageStore); ! $html .= Element('p', QElement('b', gettext ("Archived version"))); ! $html .= ViewPageProps($pagename, $ArchivePageStore); ! GeneratePage('MESSAGE', $html, gettext("PageInfo").": '$pagename'", 0); ?> Index: savepage.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/savepage.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** savepage.php 2001/02/08 18:19:16 1.9 --- savepage.php 2001/02/10 22:15:08 1.10 *************** *** 10,14 **** function UpdateRecentChanges($dbi, $pagename, $isnewpage) { ! global $remoteuser; // this is set in the config global $dateformat; global $WikiPageStore; --- 10,14 ---- function UpdateRecentChanges($dbi, $pagename, $isnewpage) { ! global $user; global $dateformat; global $WikiPageStore; *************** *** 51,60 **** : $recentchanges['content'][$i++]; // add the updated page's name to the array if($isnewpage) { ! $newpage[$k++] = "* [$pagename] (new) ..... $remoteuser\r"; } else { ! $diffurl = "phpwiki:?diff=" . rawurlencode($pagename); ! $newpage[$k++] = "* [$pagename] ([diff|$diffurl]) ..... $remoteuser\r"; } if ($isNewDay) --- 51,62 ---- : $recentchanges['content'][$i++]; + $userid = $user->id(); + // add the updated page's name to the array if($isnewpage) { ! $newpage[$k++] = "* [$pagename] (new) ..... $userid\r"; } else { ! $diffurl = "phpwiki:" . rawurlencode($pagename) . "?action=diff"; ! $newpage[$k++] = "* [$pagename] ([diff|$diffurl]) ..... $userid\r"; } if ($isNewDay) *************** *** 106,111 **** - - $pagename = rawurldecode($post); $pagehash = RetrievePage($dbi, $pagename, $WikiPageStore); --- 108,111 ---- *************** *** 118,122 **** $newpage = 1; } else { ! if (($pagehash['flags'] & FLAG_PAGE_LOCKED) && !defined('WIKI_ADMIN')) { $html = "<p>" . gettext ("This page has been locked by the administrator and cannot be edited."); $html .= "\n<p>" . gettext ("Sorry for the inconvenience."); --- 118,122 ---- $newpage = 1; } else { ! if (($pagehash['flags'] & FLAG_PAGE_LOCKED) && ! $user->is_admin()) { $html = "<p>" . gettext ("This page has been locked by the administrator and cannot be edited."); $html .= "\n<p>" . gettext ("Sorry for the inconvenience."); *************** *** 129,136 **** } ! // archive it if it's a new author ! if (empty($minor_edit)) { ! SaveCopyToArchive($dbi, $pagename, $pagehash); ! } $newpage = 0; } --- 129,138 ---- } ! if ($user->id() != $pagehash['author'] && ! $user->is_admin()) ! unset($minor_edit); // Force archive ! ! if (empty($minor_edit)) ! SaveCopyToArchive($dbi, $pagename, $pagehash); ! $newpage = 0; } *************** *** 139,155 **** $pagehash['lastmodified'] = time(); $pagehash['version']++; ! $pagehash['author'] = $remoteuser; // create page header - $enc_url = rawurlencode($pagename); - $enc_name = htmlspecialchars($pagename); $html = sprintf(gettext("Thank you for editing %s."), ! "<a href=\"$ScriptUrl?$enc_url\">$enc_name</a>"); $html .= "<br>\n"; if (! empty($content)) { // patch from Grant Morgan <gr...@ry...> for magic_quotes_gpc ! if (get_magic_quotes_gpc()) ! $content = stripslashes($content); $pagehash['content'] = preg_split('/[ \t\r]*\n/', chop($content)); --- 141,154 ---- $pagehash['lastmodified'] = time(); $pagehash['version']++; ! $pagehash['author'] = $user->id(); // create page header $html = sprintf(gettext("Thank you for editing %s."), ! WikiURL($pagename)); $html .= "<br>\n"; if (! empty($content)) { // patch from Grant Morgan <gr...@ry...> for magic_quotes_gpc ! fix_magic_quotes_gpc($content); $pagehash['content'] = preg_split('/[ \t\r]*\n/', chop($content)); *************** *** 161,174 **** } - for ($i = 1; $i <= NUM_LINKS; $i++) { - if (! empty(${'r'.$i})) { - if (preg_match("#^($AllowedProtocols):#", ${'r'.$i})) - $pagehash['refs'][$i] = ${'r'.$i}; - else - $html .= "<P>Link [$i]: <B>unknown protocol</B>" . - " - use one of $AllowedProtocols - link discarded.</P>\n"; - } - } - InsertPage($dbi, $pagename, $pagehash); UpdateRecentChanges($dbi, $pagename, $newpage); --- 160,163 ---- *************** *** 186,191 **** if (!empty($SignatureImg)) ! $html .= "<P><img src=\"$SignatureImg\"></P>\n"; ! $html .= "<hr noshade><P>"; include('lib/transform.php'); --- 175,180 ---- if (!empty($SignatureImg)) ! $html .= sprintf("<P><img src=\"%s\"></P>\n", MakeURLAbsolute($SignatureImg)); ! $html .= "<hr noshade><P>"; include('lib/transform.php'); Index: search.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/search.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** search.php 2001/01/02 00:10:28 1.3 --- search.php 2001/02/10 22:15:08 1.4 *************** *** 3,19 **** rcs_id('$Id$'); ! if(get_magic_quotes_gpc()) ! $search = stripslashes($search); $html = "<P><B>" . sprintf(gettext ("Searching for \"%s\" ....."), ! htmlspecialchars($search)) . "</B></P>\n"; // quote regexp chars ! $search = preg_quote($search); // search matching pages ! $query = InitTitleSearch($dbi, $search); $found = 0; while ($page = TitleSearchNextMatch($dbi, $query)) { --- 3,21 ---- rcs_id('$Id$'); ! if (empty($searchterm)) ! $searchterm = ''; // FIXME: do something better here? + fix_magic_quotes_gpc($searchterm); + $html = "<P><B>" . sprintf(gettext ("Searching for \"%s\" ....."), ! htmlspecialchars($searchterm)) . "</B></P>\n"; // quote regexp chars ! $search = preg_quote($searchterm); // search matching pages ! $query = InitTitleSearch($dbi, $searchterm); $found = 0; while ($page = TitleSearchNextMatch($dbi, $query)) { Index: stdlib.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/stdlib.php,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -r1.26 -r1.27 *** stdlib.php 2001/02/08 18:18:10 1.26 --- stdlib.php 2001/02/10 22:15:08 1.27 *************** *** 1,7 **** --- 1,11 ---- <?php rcs_id('$Id$'); + /* Standard functions for Wiki functionality ExitWiki($errormsg) + MakeURLAbsolute($url, $base = false) + WikiURL($pagename, $args, $abs) + LinkExistingWikiWord($wikiword, $linktext) LinkUnknownWikiWord($wikiword, $linktext) *************** *** 19,22 **** --- 23,46 ---- */ + function fix_magic_quotes_gpc (&$text) + { + if (get_magic_quotes_gpc()) { + $text = stripslashes($text); + } + return $text; + } + + + function get_remote_host () { + // Apache won't show REMOTE_HOST unless the admin configured it + // properly. We'll be nice and see if it's there. + if (getenv('REMOTE_HOST')) + return getenv('REMOTE_HOST'); + $host = getenv('REMOTE_ADDR'); + if (ENABLE_REVERSE_DNS) + return gethostbyaddr($host); + return $host; + } + function ExitWiki($errormsg) *************** *** 39,75 **** } ! ! function LinkExistingWikiWord($wikiword, $linktext='') { global $ScriptUrl; ! $enc_word = rawurlencode($wikiword); ! if(empty($linktext)) ! $linktext = htmlspecialchars($wikiword); ! return "<a href=\"$ScriptUrl?$enc_word\">$linktext</a>"; } ! function LinkUnknownWikiWord($wikiword, $linktext='') { ! global $ScriptUrl; ! $enc_word = rawurlencode($wikiword); ! if(empty($linktext)) ! $linktext = htmlspecialchars($wikiword); ! return "<u>$linktext</u><a href=\"$ScriptUrl?edit=$enc_word\">?</a>"; } function LinkURL($url, $linktext='') { ! global $ScriptUrl; if(ereg("[<>\"]", $url)) { return "<b><u>BAD URL -- remove all of <, >, "</u></b>"; } ! if(empty($linktext)) ! $linktext = htmlspecialchars($url); ! return "<a href=\"$url\">$linktext</a>"; } function LinkImage($url, $alt='[External Image]') { ! global $ScriptUrl; if(ereg('[<>"]', $url)) { return "<b><u>BAD URL -- remove all of <, >, "</u></b>"; } ! return "<img src=\"$url\" ALT=\"$alt\">"; } --- 63,172 ---- } ! function MakeURLAbsolute($url, $base = false) { global $ScriptUrl; ! ! if (preg_match('@^(\w+:|/)@', $url)) ! return $url; ! ! return preg_replace('@[^/]*$@', '', empty($base) ? $ScriptUrl : $base) . $url; } + ! function WikiURL($pagename, $args = '', $make_abs_url = false) { ! global $ScriptName, $ScriptUrl; ! ! if (is_array($args)) ! { ! reset($args); ! $enc_args = array(); ! while (list ($key, $val) = each($args)) { ! $enc_args[] = urlencode($key) . '=' . urlencode($val); ! } ! $args = join('&', $enc_args); ! } ! ! if (USE_PATH_INFO) { ! $url = $make_abs_url ? "$ScriptUrl/" : ''; ! $url .= rawurlencode($pagename); ! if ($args) ! $url .= "?$args"; ! } ! else { ! $url = $make_abs_url ? $ScriptUrl : $ScriptName; ! $url .= "?pagename=" . rawurlencode($pagename); ! if ($args) ! $url .= "&$args"; ! } ! return $url; } + define('NO_END_TAG_PAT', + '/^' . join('|', array('area', 'base', 'basefont', + 'br', 'col', 'frame', + 'hr', 'image', 'input', + 'isindex', 'link', 'meta', + 'param')) . '$/i'); + + function Element($tag, $args = '', $content = '') + { + $html = "<$tag"; + if (is_array($args)) + { + while (list($key, $val) = each($args)) + $html .= sprintf(' %s="%s"', $key, htmlspecialchars($val)); + } + else + $content = $args; + + $html .= '>'; + if (!preg_match(NO_END_TAG_PAT, $tag)) + { + $html .= $content; + $html .= "</$tag>"; + } + return $html; + } + + function QElement($tag, $args = '', $content = '') + { + if (is_array($args)) + return Element($tag, $args, htmlspecialchars($content)); + else + { + $content = $args; + return Element($tag, htmlspecialchars($content)); + } + } + function LinkURL($url, $linktext='') { ! // FIXME: Is this needed (or sufficient?) if(ereg("[<>\"]", $url)) { return "<b><u>BAD URL -- remove all of <, >, "</u></b>"; } ! return QElement('a', array('href' => $url), ($linktext ? $linktext : $url)); } + function LinkExistingWikiWord($wikiword, $linktext='') { + return LinkURL(WikiURL($wikiword), + $linktext ? $linktext : $wikiword); + } + + function LinkUnknownWikiWord($wikiword, $linktext='') { + if (empty($linktext)) + $linktext = $wikiword; + + return QElement('u', $linktext) + . QElement('a', array('href' => WikiURL($wikiword, array('action' => 'edit'))), + '?'); + } + + function LinkImage($url, $alt='[External Image]') { ! // FIXME: Is this needed (or sufficient?) ! // As long as the src in htmlspecialchars()ed I think it's safe. if(ereg('[<>"]', $url)) { return "<b><u>BAD URL -- remove all of <, >, "</u></b>"; } ! return Element('img', array('src' => $url, 'alt' => $alt)); } *************** *** 78,102 **** list( $wiki, $page ) = split( ":", $link ); - if(empty($linktext)) - $linktext = htmlspecialchars($link); - $page = urlencode($page); - return "<a href=\"$interwikimap[$wiki]$page\">$linktext</a>"; - } - - - function ParseAdminTokens($line) { - global $ScriptUrl; ! while (preg_match("/%%ADMIN-INPUT-(.*?)-(\w+)%%/", $line, $matches)) { ! $head = str_replace('_', ' ', $matches[2]); ! $form = "<FORM ACTION=\"$ScriptUrl\" METHOD=POST>" ! ."$head: <INPUT NAME=$matches[1] SIZE=20> " ! ."<INPUT TYPE=SUBMIT VALUE=\"" . gettext("Go") . "\">" ! ."</FORM>"; ! $line = str_replace($matches[0], $form, $line); ! } ! return $line; } // converts spaces to tabs function CookSpaces($pagearray) { --- 175,184 ---- list( $wiki, $page ) = split( ":", $link ); ! $url = $interwikimap[$wiki] . urlencode($page); ! return LinkURL($url, $linktext ? $linktext : $link); } + // converts spaces to tabs function CookSpaces($pagearray) { *************** *** 138,141 **** --- 220,296 ---- + function MakeWikiForm ($pagename, $args, $button_text = '') { + global $ScriptUrl; + + $formargs['action'] = USE_PATH_INFO ? WikiURL($pagename) : $ScriptUrl; + $formargs['method'] = 'post'; + $contents = ''; + $input_seen = 0; + + while (list($key, $val) = each($args)) + { + $a = array('name' => $key, 'value' => $val, 'type' => 'hidden'); + + if (preg_match('/^ (\d*) \( (.*) \) $/x', $val, $m)) + { + $input_seen++; + $a['type'] = 'text'; + $a['size'] = $m[1] ? $m[1] : 30; + $a['value'] = $m[2]; + } + + $contents .= Element('input', $a); + } + + if (!empty($button_text)) { + if ($input_seen) + $contents .= ' '; + $contents .= Element('input', array('type' => 'submit', + 'value' => $button_text)); + } + + return Element('form', $formargs, $contents); + } + + function SplitQueryArgs ($query_args = '') + { + $split_args = split('&', $query_args); + $args = array(); + while (list($key, $val) = each($split_args)) + if (preg_match('/^ ([^=]+) =? (.*) /x', $val, $m)) + $args[$m[1]] = $m[2]; + return $args; + } + + function LinkPhpwikiURL($url, $text = '') { + global $pagename; + $args = array(); + $page = $pagename; + + if (!preg_match('/^ phpwiki: ([^?]*) [?]? (.*) $/x', $url, $m)) + return "<b><u>BAD phpwiki: URL</u></b>"; + + if ($m[1]) + $page = urldecode($m[1]); + $qargs = $m[2]; + + if (!$page && preg_match('/^(diff|edit|links|info|diff)=([^&]+)$/', $qargs, $m)) + { + // Convert old style links (to not break diff links in RecentChanges). + $page = urldecode($m[2]); + $args = array("action" => $m[1]); + } + else + { + $args = SplitQueryArgs($qargs); + } + + // FIXME: ug, don't like this + if (preg_match('/=\d*\(/', $qargs)) + return MakeWikiForm($page, $args, $text); + else + return LinkURL(WikiURL($page, $args), $text ? $text : $url); + } + function ParseAndLink($bracketlink) { global $dbi, $ScriptUrl, $AllowedProtocols, $InlineImages; *************** *** 153,157 **** // named link of the form "[some link name | http://blippy.com/]" $URL = trim($matches[3]); ! $linkname = htmlspecialchars(trim($matches[1])); $linktype = 'named'; } else { --- 308,312 ---- // named link of the form "[some link name | http://blippy.com/]" $URL = trim($matches[3]); ! $linkname = trim($matches[1]); $linktype = 'named'; } else { *************** *** 176,182 **** } elseif (preg_match("#^phpwiki:(.*)#", $URL, $match)) { $link['type'] = "url-wiki-$linktype"; ! if(empty($linkname)) ! $linkname = htmlspecialchars($URL); ! $link['link'] = "<a href=\"$ScriptUrl$match[1]\">$linkname</a>"; } elseif (preg_match("#^\d+$#", $URL)) { $link['type'] = "footnote-$linktype"; --- 331,335 ---- } elseif (preg_match("#^phpwiki:(.*)#", $URL, $match)) { $link['type'] = "url-wiki-$linktype"; ! $link['link'] = LinkPhpwikiURL($URL, $linkname); } elseif (preg_match("#^\d+$#", $URL)) { $link['type'] = "footnote-$linktype"; *************** *** 285,289 **** global $ScriptUrl, $AllowedProtocols, $templates; global $datetimeformat, $dbi, $logo, $FieldSeparator; ! if (!is_array($hash)) unset($hash); --- 438,443 ---- global $ScriptUrl, $AllowedProtocols, $templates; global $datetimeformat, $dbi, $logo, $FieldSeparator; ! global $user; ! if (!is_array($hash)) unset($hash); *************** *** 329,347 **** _iftoken('LOCK', (isset($hash['flags']) && ($hash['flags'] & FLAG_PAGE_LOCKED)), $page); ! _iftoken('ADMIN', defined('WIKI_ADMIN'), $page); ! _iftoken('MINOR_EDIT', isset($hash['minor_edit']), $page); ! _dotoken('SCRIPTURL', $ScriptUrl, $page); _dotoken('PAGE', htmlspecialchars($name), $page); ! _dotoken('ALLOWEDPROTOCOLS', $AllowedProtocols, $page); ! _dotoken('LOGO', $logo, $page); // invalid for messages (search results, error messages) if ($template != 'MESSAGE') { _dotoken('PAGEURL', rawurlencode($name), $page); ! _dotoken('LASTMODIFIED', ! date($datetimeformat, $hash['lastmodified']), $page); ! _dotoken('LASTAUTHOR', $hash['author'], $page); ! _dotoken('VERSION', $hash['version'], $page); if (strstr($page, "$FieldSeparator#HITS$FieldSeparator#")) { _dotoken('HITS', GetHitCount($dbi, $name), $page); --- 483,522 ---- _iftoken('LOCK', (isset($hash['flags']) && ($hash['flags'] & FLAG_PAGE_LOCKED)), $page); ! _iftoken('ADMIN', $user->is_admin(), $page); ! _iftoken('ANONYMOUS', !$user->is_authenticated(), $page); ! if (empty($hash['minor_edit_checkbox'])) ! $hash['minor_edit_checkbox'] = ''; ! _iftoken('MINOR_EDIT_CHECKBOX', $hash['minor_edit_checkbox'], $page); ! ! _dotoken('MINOR_EDIT_CHECKBOX', $hash['minor_edit_checkbox'], $page); ! ! _dotoken('USERID', htmlspecialchars($user->id()), $page); ! _dotoken('SCRIPTURL', htmlspecialchars($ScriptUrl), $page); _dotoken('PAGE', htmlspecialchars($name), $page); ! _dotoken('LOGO', htmlspecialchars(MakeURLAbsolute($logo)), $page); ! global $RCS_IDS; ! _dotoken('RCS_IDS', join("\n", $RCS_IDS), $page); + // FIXME: Clean up this stuff + $browse_page = WikiURL($name); + _dotoken('BROWSE_PAGE', $browse_page, $page); + $arg_sep = strstr($browse_page, '?') ? '&' : '?'; + _dotoken('ACTION', $browse_page . $arg_sep . "action=", $page); + _dotoken('BROWSE', WikiURL(''), $page); + + // FIXME: this is possibly broken. + _dotoken('BASE_URL', WikiURL($name, '', 'absolute_url'), $page); + // invalid for messages (search results, error messages) if ($template != 'MESSAGE') { _dotoken('PAGEURL', rawurlencode($name), $page); ! if (!empty($hash['lastmodified'])) ! _dotoken('LASTMODIFIED', ! date($datetimeformat, $hash['lastmodified']), $page); ! if (!empty($hash['author'])) ! _dotoken('LASTAUTHOR', $hash['author'], $page); ! if (!empty($hash['version'])) ! _dotoken('VERSION', $hash['version'], $page); if (strstr($page, "$FieldSeparator#HITS$FieldSeparator#")) { _dotoken('HITS', GetHitCount($dbi, $name), $page); *************** *** 350,361 **** _dotoken('RELATEDPAGES', LinkRelatedPages($dbi, $name), $page); } - } - - // valid only for EditLinks - if ($template == 'EDITLINKS') { - for ($i = 1; $i <= NUM_LINKS; $i++) { - $ref = isset($hash['refs'][$i]) ? $hash['refs'][$i] : ''; - _dotoken("R$i", $ref, $page); - } } --- 525,528 ---- Index: transform.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/transform.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 *** transform.php 2001/02/09 04:00:25 1.13 --- transform.php 2001/02/10 22:15:08 1.14 *************** *** 205,209 **** $transform->register(WT_SIMPLE_MARKUP, 'wtm_htmlchars'); - $transform->register(WT_SIMPLE_MARKUP, 'wtm_hr'); $transform->register(WT_SIMPLE_MARKUP, 'wtm_linebreak'); $transform->register(WT_SIMPLE_MARKUP, 'wtm_bold_italics'); --- 205,208 ---- *************** *** 217,220 **** --- 216,220 ---- $transform->register(WT_MODE_MARKUP, 'wtm_preformatted'); $transform->register(WT_MODE_MARKUP, 'wtm_headings'); + $transform->register(WT_MODE_MARKUP, 'wtm_hr'); $transform->register(WT_MODE_MARKUP, 'wtm_paragraph'); *************** *** 387,394 **** } - // four or more dashes to <hr> - function wtm_hr($line, &$transformer) { - return ereg_replace("^-{4,}", '<hr>', $line); - } // %%% are linebreaks --- 387,390 ---- *************** *** 411,420 **** // wiki token: title search dialog function wtm_title_search($line, &$transformer) { - global $ScriptUrl; if (strpos($line, '%%Search%%') !== false) { ! $html = "<form action=\"$ScriptUrl\">\n" . ! "<input type=text size=30 name=search>\n" . ! "<input type=submit value=\"". htmlspecialchars(gettext("Search")) . ! "\"></form>\n"; $line = str_replace('%%Search%%', $html, $line); } --- 407,415 ---- // wiki token: title search dialog function wtm_title_search($line, &$transformer) { if (strpos($line, '%%Search%%') !== false) { ! $html = LinkPhpwikiURL( ! "phpwiki:?action=search&searchterm=()&searchtype=title", ! gettext("Search")); ! $line = str_replace('%%Search%%', $html, $line); } *************** *** 424,433 **** // wiki token: fulltext search dialog function wtm_fulltext_search($line, &$transformer) { - global $ScriptUrl; if (strpos($line, '%%Fullsearch%%') !== false) { ! $html = "<form action=\"$ScriptUrl\">\n" . ! "<input type=text size=30 name=full>\n" . ! "<input type=submit value=\"". htmlspecialchars(gettext("Search")) . ! "\"></form>\n"; $line = str_replace('%%Fullsearch%%', $html, $line); } --- 419,427 ---- // wiki token: fulltext search dialog function wtm_fulltext_search($line, &$transformer) { if (strpos($line, '%%Fullsearch%%') !== false) { ! $html = LinkPhpwikiURL( ! "phpwiki:?action=search&searchterm=()&searchtype=full", ! gettext("Search")); ! $line = str_replace('%%Fullsearch%%', $html, $line); } *************** *** 513,516 **** --- 507,522 ---- $line = preg_replace("/^!+/", '', $line); $line = $trfrm->SetHTMLMode($heading, ZERO_LEVEL, 0) . $line; + } + return $line; + } + + // four or more dashes to <hr> + // Note this is of type WT_MODE_MARKUP becuase <hr>'s aren't + // allowed within <p>'s. (e.g. "<p><hr></p>" is not valid HTML.) + function wtm_hr($line, &$trfrm) { + if (preg_match('/^-{4,}(.*)$/', $line, $m)) { + $line = $trfrm->SetHTMLMode('', ZERO_LEVEL, 0) . '<hr>'; + if ($m[1]) + $line .= $trfrm->SetHTMLMode('p', ZERO_LEVEL, 0) . $m[1]; } return $line; Index: ziplib.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/ziplib.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** ziplib.php 2001/02/08 02:34:32 1.4 --- ziplib.php 2001/02/10 22:15:08 1.5 *************** *** 67,70 **** --- 67,71 ---- if (!($fp = gzopen($filename, "rb"))) die("gzopen failed"); + $unz = ''; while ($buf = gzread($fp, 4096)) $unz .= $buf; *************** *** 265,269 **** } ! if ($attrib['write_protected']) $atx = (0100444 << 16) | 1; // S_IFREG + read permissions to everybody. else --- 266,270 ---- } ! if (!empty($attrib['write_protected'])) $atx = (0100444 << 16) | 1; // S_IFREG + read permissions to everybody. else *************** *** 272,276 **** $ati = $attrib['is_ascii'] ? 1 : 0; ! if (!$attrib['mtime']) $attrib['mtime'] = time(); list ($mod_date, $mod_time) = unixtime2dostime($attrib['mtime']); --- 273,277 ---- $ati = $attrib['is_ascii'] ? 1 : 0; ! if (empty($attrib['mtime'])) $attrib['mtime'] = time(); list ($mod_date, $mod_time) = unixtime2dostime($attrib['mtime']); *************** *** 278,282 **** // Construct parts common to "Local file header" and "Central // directory file header." ! $head = pack("vvvvvVVVvv", 20, // Version needed to extract (FIXME: is this right?) --- 279,287 ---- // Construct parts common to "Local file header" and "Central // directory file header." ! if (!isset($attrib['extra_field'])) ! $attrib['extra_field'] = ''; ! if (!isset($attrib['file_comment'])) ! $attrib['file_comment'] = ''; ! $head = pack("vvvvvVVVvv", 20, // Version needed to extract (FIXME: is this right?) *************** *** 456,460 **** preg_match('/^([ !-<>-~]*)(?:([!-<>-~]$)|(.))/s', $string, $match); $quoted .= $match[1] . $match[2]; ! if ($match[3]) $quoted .= sprintf("=%02X", ord($match[3])); $string = substr($string, strlen($match[0])); --- 461,465 ---- preg_match('/^([ !-<>-~]*)(?:([!-<>-~]$)|(.))/s', $string, $match); $quoted .= $match[1] . $match[2]; ! if (!empty($match[3])) $quoted .= sprintf("=%02X", ord($match[3])); $string = substr($string, strlen($match[0])); *************** *** 522,528 **** { // phpwiki's with versions > 1.2.x shouldn't have references. ! for ($i = 1; $i <= NUM_LINKS; $i++) ! if ($ref = $refs[$i]) ! $params["ref$i"] = rawurlencode($ref); } --- 527,533 ---- { // phpwiki's with versions > 1.2.x shouldn't have references. ! for ($i = 1; $i <= 12 /*NUM_LINKS*/; $i++) ! if (!empty($refs[$i])) ! $params["ref$i"] = rawurlencode($refs[$i]); } *************** *** 570,575 **** if (! preg_match("/^\r?\n/", $string, $match)) ! die("No blank line after headers:\n '" ! . htmlspecialchars($string) . "'"); $string = substr($string, strlen($match[0])); --- 575,583 ---- if (! preg_match("/^\r?\n/", $string, $match)) ! { ! // No blank line after headers. ! return false; ! } ! $string = substr($string, strlen($match[0])); *************** *** 638,641 **** --- 646,675 ---- } + function GenerateFootnotesFromRefs($params) + { + $footnotes = array(); + reset($params); + while (list($p, $reference) = each($params)) + { + if (preg_match('/^ref([1-9][0-9]*)$/', $p, $m)) + $footnotes[$m[1]] = sprintf(gettext ("[%d] See [%s]"), + $m[1], rawurldecode($reference)); + } + + if (sizeof($footnotes) > 0) + { + ksort($footnotes); + return "-----\n" + . gettext ("!References") . "\n" + . join("\n%%%\n", $footnotes) . "\n"; + } + else + return ""; + } + + + // Convert references in meta-data to footnotes. + // Only zip archives generated by phpwiki 1.2.x or earlier should have + // references. function ParseMimeifiedPages ($data) { *************** *** 677,699 **** die("Unknown encoding type: $encoding"); ! // Convert references in meta-data to footnotes. ! // Only zip archives generated by phpwiki 1.2.x or earlier should have ! // references. ! $footnotes = ''; ! for ($i = 1; $i <= NUM_LINKS; $i++) ! { ! if (empty($params["ref$i"])) ! continue; ! $footnotes .= sprintf(gettext ("[%d] See [%s]"), ! $i, rawurldecode($params["ref$i"])) . "\n%%%\n"; ! } - if ($footnotes) - { - $data .= "-----\n"; - $data .= gettext ("!References") . "\n"; - $data .= $footnotes; - } - $pagehash['content'] = preg_split('/[ \t\r]*\n/', chop($data)); --- 711,716 ---- die("Unknown encoding type: $encoding"); ! $data .= GenerateFootnotesFromRefs($params); $pagehash['content'] = preg_split('/[ \t\r]*\n/', chop($data)); --- editlinks.php DELETED --- |
From: Geoffrey T. D. <da...@us...> - 2001-02-10 22:14:40
|
Update of /cvsroot/phpwiki/phpwiki/templates In directory usw-pr-cvs1:/tmp/cvs-serv20420/templates Modified Files: README browse.html editpage.html message.html Log Message: Jeff hacks again: LOT's of changes. Highlights: * Pagename in PATH_INFO support added. * Redid the user (admin) authentication stuff. All access now through index.php. See HISTORY for (a few) more details. Index: README =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/templates/README,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** README 2000/11/08 16:19:01 1.3 --- README 2001/02/10 22:15:08 1.4 *************** *** 42,49 **** the search result, or a message text. ! ###ALLOWEDPROTOCOLS### ! Protocols allowed for external links and references. ! Default: http|https|mailto|ftp|news|gopher Conditional placeholders: --- 42,69 ---- the search result, or a message text. ! ###USERID### ! The userid of the current users. For non-authenticated users, ! the userid is the host name or IP number of the user. ! ! ###LOGO### ! URL of the phpwiki logo image. ! ! ###RCS_IDS### ! The RCS ids of the php source files which contributed to the current ! page. ! ! ###BROWSE_PAGE### ! The URL to use to browse the current page. ! ! ###ACTION### ! The leading part of the URL for performing an action on the current page. ! Eg. <a href="###ACTION###edit">Edit this page</a>. ! ! ###BROWSE### ! The leading part of the URL for browsing to another page. ! Eg. <a href="###BROWSE###FindPage">Edit this page</a>. + ###BASE_URL### + The base URL for the current page. Conditional placeholders: *************** *** 68,79 **** Conditions to test: - COPY If page has a copy in the archive. Usually used to display/omit - the EditCopy link in the editpage template. - ADMIN If the current user is an admin. Used in e.g. browse template to display admin buttons at the top. LOCK If current page is locked and thus cannot be edited. For examples see browse.html and editpage.html --- 88,110 ---- Conditions to test: ADMIN If the current user is an admin. Used in e.g. browse template to display admin buttons at the top. + ANONYMOUS + If the current user is not authenticated. + + COPY If page has a copy in the archive. Usually used to display/omit + the EditCopy link in the editpage template. + LOCK If current page is locked and thus cannot be edited. + MINOR_EDIT_CHECKBOX + If the current user is the same as the last editor of this + page, this will contain the complete HTML for a checkbox, + which, when checked will prevent a backup copy from being made. + + If the current user is different than the last editor, + MINOR_EDIT_CHECKBOX will be blank. + For examples see browse.html and editpage.html *************** *** 96,114 **** Note: this is also used for detecting concurrent updates to a page. See hidden input field in EDITPAGE template for how to use it. - - - Only for EditLinks: - - ###1###, ###2###, .... - Placeholder for references. Up to NUM_LINKS placeholders will be - substituted. NUM_LINKS is defined in lib/config.php Examples: ! <A HREF="###SCRIPTURL###">the entry (default) page</A> ! <A HREF="###SCRIPTURL###?###PAGEURL###">the current page</A> ! <A HREF="###SCRIPTURL###?FindPage">the FindPage page</A> <head><title>PhpWiki Page: ###PAGE###</title></head> --- 127,142 ---- Note: this is also used for detecting concurrent updates to a page. See hidden input field in EDITPAGE template for how to use it. + ###HITS### + The hit count of the current page. + ###RELATEDPAGES### + The related pages list for the current page. Examples: ! <A HREF="###BROWSE###FrontPage">the entry (default) page</A> ! <A HREF="###BROWSE_PAGE###">the current page</A> ! <A HREF="###BROWSE###FindPage">the FindPage page</A> <head><title>PhpWiki Page: ###PAGE###</title></head> Index: browse.html =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/templates/browse.html,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** browse.html 2000/11/09 16:29:10 1.9 --- browse.html 2001/02/10 22:15:08 1.10 *************** *** 1,31 **** <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>###PAGE###</title> </head> <body bgcolor=ivory text=black alink=red link=darkblue vlink=darkmagenta> ! <h1><a href="###SCRIPTURL###"><img src="###LOGO###" border=0 alt="[phpwiki]" align=middle width=50 height=50></a> ! <a href="###SCRIPTURL###?full=###PAGEURL###">###PAGE###</a></h1> ! ###IF:ADMIN###<FORM ACTION="###SCRIPTURL###" METHOD=POST> ! ###IF LOCK###[<a href="###SCRIPTURL###?unlock=###PAGEURL###">Unlock page</a>] ! ###IF !LOCK###[<a href="###SCRIPTURL###?lock=###PAGEURL###">Lock page</a>] - - ! [<a href="###SCRIPTURL###?remove=###PAGEURL###">Remove page</A>] ! <hr noshade> ###ENDIF:ADMIN### <P> ###CONTENT### <hr noshade> ! ###IF ADMIN###<a href="###SCRIPTURL###?edit=###PAGEURL###">EditText</a> of this page ###IF:!ADMIN### ###IF LOCK###Page locked ! ###IF !LOCK###<a href="###SCRIPTURL###?edit=###PAGEURL###">EditText</a> of this page ###ENDIF:!ADMIN### (last edited ###LASTMODIFIED###) ! [<a href="###SCRIPTURL###?info=###PAGEURL###">info</a>] ! [<a href="###SCRIPTURL###?diff=###PAGEURL###">diff</a>]) <br> ! <a href="###SCRIPTURL###?FindPage">FindPage</a> by browsing or searching <hr noshade> <small>###RELATEDPAGES###</small> --- 1,40 ---- + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> + <!-- phpwiki source: + ###RCS_IDS### + --> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> + <base href="###BASE_URL###"> <title>###PAGE###</title> </head> <body bgcolor=ivory text=black alink=red link=darkblue vlink=darkmagenta> ! <h1><a href="###BROWSE###FrontPage"><img src="###LOGO###" border=0 alt="[phpwiki]" align=middle width=50 height=50></a> ! <a href="###ACTION###search&searchtype=full&searchterm=###PAGEURL###">###PAGE###</a></h1> ! ###IF:!ANONYMOUS### ! <p>You are logged in as <em>###USERID###</em>. ! [<a href="###ACTION###logout">Log Out</a>]</p> ! ###IF:ADMIN### ! ###IF LOCK###[<a href="###ACTION###unlock">Unlock page</a>] ! ###IF !LOCK###[<a href="###ACTION###lock">Lock page</a>] - - ! [<a href="###ACTION###remove">Remove page</a>] ###ENDIF:ADMIN### + <hr noshade> + ###ENDIF:!ANONYMOUS### <P> ###CONTENT### <hr noshade> ! ###IF ADMIN###<a href="###ACTION###edit">EditText</a> of this page ###IF:!ADMIN### ###IF LOCK###Page locked ! ###IF !LOCK###<a href="###ACTION###edit">EditText</a> of this page ###ENDIF:!ADMIN### (last edited ###LASTMODIFIED###) ! [<a href="###ACTION###info">info</a>] ! [<a href="###ACTION###diff">diff</a>]) <br> ! <a href="###BROWSE###FindPage">FindPage</a> by browsing or searching <hr noshade> <small>###RELATEDPAGES###</small> Index: editpage.html =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/templates/editpage.html,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** editpage.html 2001/02/08 08:51:50 1.8 --- editpage.html 2001/02/10 22:15:08 1.9 *************** *** 1,5 **** --- 1,10 ---- + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> + <!-- phpwiki source: + ###RCS_IDS### + --> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> + <base href="###BASE_URL###"> <title>###PAGE###</title> </head> *************** *** 7,13 **** <body> ! <form method="POST" action="###SCRIPTURL###"> ! <h1><a href="###SCRIPTURL###"><img src="###LOGO###" border=0 alt="[phpwiki]" width=50 height=50></a> Edit ###PAGE### <input type="submit" value=" Save "></h1> --- 12,18 ---- <body> ! <form method="POST" action="###BROWSE_PAGE###"> ! <h1><a href="###BROWSE###FrontPage"><img src="###LOGO###" border=0 alt="[phpwiki]" width=50 height=50></a> Edit ###PAGE### <input type="submit" value=" Save "></h1> *************** *** 15,30 **** <textarea name="content" ROWS="22" COLS="80" wrap="virtual">###CONTENT###</textarea> <br> ! <input type="checkbox" name="minor_edit" value="yes" ! ###IF MINOR_EDIT### checked ! > ! This is a minor change, don't archive old version. ! <br> <input type="checkbox" name="convert" value="tabs" > I can't type tabs. ! Please <a href="###SCRIPTURL###?ConvertSpacesToTabs">ConvertSpacesToTabs</a> for me when I save. ! <p><a href="###SCRIPTURL###?GoodStyle">GoodStyle</a> tips for editing. ! ###IF COPY###<br><a href="###SCRIPTURL###?copy=###PAGEURL###">EditCopy</a> from previous author <hr noshade> --- 20,34 ---- <textarea name="content" ROWS="22" COLS="80" wrap="virtual">###CONTENT###</textarea> <br> ! ###IF:MINOR_EDIT_CHECKBOX### ! ###MINOR_EDIT_CHECKBOX### This is a minor change, don't archive old version. ! <br> ! ###ENDIF:MINOR_EDIT_CHECKBOX### <input type="checkbox" name="convert" value="tabs" > I can't type tabs. ! Please <a href="###BROWSE###ConvertSpacesToTabs">ConvertSpacesToTabs</a> for me when I save. ! <p><a href="###BROWSE###GoodStyle">GoodStyle</a> tips for editing. ! ###IF COPY###<br><a href="###ACTION###edit&version=archive">EditCopy</a> from previous author <hr noshade> *************** *** 40,44 **** </small> ! <input type="hidden" name="post" value="###PAGEURL###"> <input type="hidden" name="editversion" value="###VERSION###"> </form> --- 44,49 ---- </small> ! <input type="hidden" name="action" value="save"> ! <input type="hidden" name="pagename" value="###PAGEURL###"> <input type="hidden" name="editversion" value="###VERSION###"> </form> Index: message.html =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/templates/message.html,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** message.html 2000/10/22 13:30:57 1.4 --- message.html 2001/02/10 22:15:08 1.5 *************** *** 1,5 **** --- 1,10 ---- + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> + <!-- phpwiki source: + ###RCS_IDS### + --> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> + <base href="###BASE_URL###"> <title>###PAGE###</title> </head> *************** *** 7,11 **** <body bgcolor=linen text=black alink=red link=darkblue vlink=darkmagenta> ! <h1><a href="###SCRIPTURL###"><img src="###LOGO###" border=0 alt="[phpwiki]" width=50 height=50></a> ###PAGE###</h1> --- 12,16 ---- <body bgcolor=linen text=black alink=red link=darkblue vlink=darkmagenta> ! <h1><a href="###BROWSE###FrontPage"><img src="###LOGO###" border=0 alt="[phpwiki]" width=50 height=50></a> ###PAGE###</h1> |
From: Geoffrey T. D. <da...@us...> - 2001-02-10 22:14:40
|
Update of /cvsroot/phpwiki/phpwiki/pgsrc In directory usw-pr-cvs1:/tmp/cvs-serv20420/pgsrc Modified Files: PhpWikiAdministration TextFormattingRules Added Files: MagicPhpWikiURLs Log Message: Jeff hacks again: LOT's of changes. Highlights: * Pagename in PATH_INFO support added. * Redid the user (admin) authentication stuff. All access now through index.php. See HISTORY for (a few) more details. --- NEW FILE --- !!! About phpwiki: URLs A special type of URL is available for making links to perform administrative and other special functions in PhpWiki. Here is a brief description of how they work. The basic syntax of a phpwiki: URL is __phpwiki:__''pagename''__?__''query-args'' If ''pagename'' is omitted it defaults to the current page. ''Query-args'' should be a set of parameters in standard HTTP GET format. The "action=''x''" parameter should almost always be given. It can be one of __browse__, __info__, __diff__, __search__, __edit__, __zip__, __dumpserial__, __loadserial__, __remove__, __lock__, __unlock__, __login__, __logout__, or __save__. The default action is __browse__. Some of the actions accept other parameters. ;__info__: Accepts __showpagesource__. ;__search__: Accepts __searchterm__, and __searchtype__. ;__edit__: Accepts __version__. ;__remove__: Accepts __verify__. ;__save__: Accepts __editversion__, __minor_edit__, and __content__. !! Writing Magic Links in Wiki Pages A magic link looks like: __[[__ ''text'' __|__ ''phpwiki-url'' __]__ The "''text'' __|__" is optional but usually recommended. If given it will provide the label for the link. The ''pagename'' part is optional, too. If omitted, the link will refer to the current wiki-page. !Some examples [[ Edit the !SandBox | phpwiki:!SandBox?action=edit ] will generate a link which will take you directly to editing the SandBox, like so: [ Edit the SandBox | phpwiki:SandBox?action=edit ]. Other possibilites: * [ Diff the SandBox | phpwiki:SandBox?action=diff ], * [ Lock the FrontPage | phpwiki:FrontPage?action=lock ], * [ Get a Full Zip Dump | phpwiki:?action=zip&include=all ], * [ Page titles containing 'wiki' | phpwiki:?action=search&searchterm=wiki ], !! Writing Magic Forms in Wiki Pages If one of the ''query-args'' has a value like ''arg''__=__''opt-width''__(__''opt-dflt-val''__)__ the link will be rendered as a form, rather than as an anchor. ''Opt-width'', if given specifies the size of the input area, while ''opt-dflt-val'' specifies the default value for the input. If ''text'' is given in the link, then a submit-button with that label will be included in the form, otherwise the submit button will be omitted. Examples: [[ Full Search | phpwiki:?action=search&searchtype=full&searchterm=() ] gives [ Full Search | phpwiki:?action=search&searchtype=full&searchterm=() ] While [[ phpwiki:?action=search&searchterm=12() ] yields [ phpwiki:?action=search&searchterm=12() ] Other examples: [ Browse Page | phpwiki:?action=browse&pagename=() ] Index: PhpWikiAdministration =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/pgsrc/PhpWikiAdministration,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** PhpWikiAdministration 2001/02/08 01:28:16 1.3 --- PhpWikiAdministration 2001/02/10 22:15:08 1.4 *************** *** 1,11 **** ! !!! This works only if you are logged in as ADMIN ----------- ! ZIP files of database ! __[ZIP Snapshot | phpwiki:?zip=snapshot]__ : contains only the latest versions ! __[ZIP Dump | phpwiki:?zip=all]__ : contains all archived versions These links lead to zip files, generated on the fly, which contain the most --- 1,21 ---- ! __Note__: The actions on this page require administrative privileges. ! They won't work unless you have set an admin username and password in the PhpWiki config file. ----------- + ! Log In + __[Log In | phpwiki:?action=login]__ + + This allows you to login. + While you are logged in you will be able to ''lock'', ''unlock'' and ''delete'' pages. + You will also be able edit ''locked'' pages. + + ---------- + ! ZIP files of database ! __[ZIP Snapshot | phpwiki:?action=zip]__ : contains only the latest versions ! __[ZIP Dump | phpwiki:?action=zip&include=all]__ : contains all archived versions These links lead to zip files, generated on the fly, which contain the most *************** *** 28,32 **** __Dump__ ! %%ADMIN-INPUT-dumpserial-Dump_serialized_pages%% Pages will be written out as "serialized" strings of a PHP --- 38,42 ---- __Dump__ ! [ Dump Serialized Pages | phpwiki:?action=dumpserial&directory=%/tmp/wikidump ] Pages will be written out as "serialized" strings of a PHP *************** *** 37,41 **** __Load__ ! %%ADMIN-INPUT-loadserial-Load_serialized_pages%% If you have dumped a set of pages from PhpWiki, you can reload them here. --- 47,51 ---- __Load__ ! [ Load Serialized Pages | phpwiki:?action=loadserial&directory=%/tmp/wikidump ] If you have dumped a set of pages from PhpWiki, you can reload them here. Index: TextFormattingRules =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/pgsrc/TextFormattingRules,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** TextFormattingRules 2001/02/08 09:10:26 1.10 --- TextFormattingRules 2001/02/10 22:15:08 1.11 *************** *** 65,68 **** --- 65,73 ---- * If you really must use HTML, your system administrator can enable this feature. Start each line with a bar (|). Note that this feature is disabled by default. + ! More detail than you want to know + + See MagicPhpWikiURLs for gory details on how to write + various kind of wiki maintainance links. + ----- |
From: Geoffrey T. D. <da...@us...> - 2001-02-10 22:14:39
|
Update of /cvsroot/phpwiki/phpwiki/admin In directory usw-pr-cvs1:/tmp/cvs-serv20420/admin Modified Files: dumpserial.php loadserial.php lockpage.php zip.php Added Files: removepage.php Log Message: Jeff hacks again: LOT's of changes. Highlights: * Pagename in PATH_INFO support added. * Redid the user (admin) authentication stuff. All access now through index.php. See HISTORY for (a few) more details. --- NEW FILE --- <?php if (!function_exists('RemovePage')) { $html = gettext ("Function not yet implemented."); } else if (empty($verify) || $verify != 'okay') { $html = sprintf(gettext ("You are about to remove '%s' permanently!"), htmlspecialchars($pagename)); $html .= "\n<P>"; $html .= sprintf(gettext ("Click <a href=\"%s\">here</a> to remove the page now."), htmlspecialchars(MakeWikiURL($pagename, array('action' => 'remove', 'verify' => 'okay')))); $html .= "\n<P>"; $html .= gettext ("Otherwise press the \"Back\" button of your browser."); } else { RemovePage($dbi, $pagename); $html = sprintf(gettext ("Removed page '%s' succesfully."), htmlspecialchars($pagename)); } GeneratePage('MESSAGE', $html, gettext ("Remove page"), 0); ?> Index: dumpserial.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/admin/dumpserial.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** dumpserial.php 2000/11/08 15:30:16 1.1 --- dumpserial.php 2001/02/10 22:15:07 1.2 *************** *** 6,11 **** directory as serialized data structures. */ ! ! $directory = $dumpserial; $pages = GetAllWikiPagenames($dbi); --- 6,14 ---- directory as serialized data structures. */ ! if (empty($directory)) ! ExitWiki(gettext("You must specify a directory to dump to")); ! ! fix_magic_quotes_gpc($directory); ! $pages = GetAllWikiPagenames($dbi); *************** *** 39,42 **** $html .= "<p><b>Dump complete.</b>"; GeneratePage('MESSAGE', $html, 'Dump serialized pages', 0); - ExitWiki(''); ?> --- 42,44 ---- Index: loadserial.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/admin/loadserial.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** loadserial.php 2000/11/08 15:30:16 1.1 --- loadserial.php 2001/02/10 22:15:07 1.2 *************** *** 6,10 **** */ ! $directory = $loadserial; $html = "Loading serialized pages from '$directory'.<p>\n"; --- 6,11 ---- */ ! fix_magic_quotes_gpc($directory); ! $html = "Loading serialized pages from '$directory'.<p>\n"; Index: lockpage.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/admin/lockpage.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** lockpage.php 2000/11/08 15:30:16 1.1 --- lockpage.php 2001/02/10 22:15:07 1.2 *************** *** 1,22 **** <!-- $Id$ --> <?php ! if(isset($lock)) $page = $lock; ! elseif(isset($unlock)) $page = $unlock; ! $argv[0] = $page; // necessary for displaying the page afterwards ! $pagename = rawurldecode($page); ! $pagehash = RetrievePage($dbi, $pagename, $WikiPageStore); ! if (! is_array($pagehash)) ! ExitWiki("Unknown page '".htmlspecialchars($pagename)."'\n"); ! if (isset($lock)) { ! $pagehash['flags'] |= FLAG_PAGE_LOCKED; ! InsertPage($dbi, $pagename, $pagehash); ! // echo htmlspecialchars($page) . " locked\n"; ! } elseif(isset($unlock)) { ! $pagehash['flags'] &= ~FLAG_PAGE_LOCKED; ! InsertPage($dbi, $pagename, $pagehash); ! // echo htmlspecialchars($page) . " unlocked\n"; ! } ?> --- 1,16 ---- <!-- $Id$ --> <?php ! $user->must_be_admin("lock or unlock pages"); ! $pagehash = RetrievePage($dbi, $pagename, $WikiPageStore); ! if (! is_array($pagehash)) ! ExitWiki("Unknown page '".htmlspecialchars($pagename)."'\n"); ! if ($action == 'lock') ! $pagehash['flags'] |= FLAG_PAGE_LOCKED; ! else ! $pagehash['flags'] &= ~FLAG_PAGE_LOCKED; ! ! InsertPage($dbi, $pagename, $pagehash); ?> Index: zip.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/admin/zip.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** zip.php 2001/02/07 02:23:24 1.2 --- zip.php 2001/02/10 22:15:07 1.3 *************** *** 1,3 **** --- 1,4 ---- <?php // $Id$ + include 'lib/ziplib.php'; function MailifyPage ($pagehash, $oldpagehash = false) *************** *** 68,75 **** } ! if(defined('WIKI_ADMIN')) ! MakeWikiZip(($zip == 'all')); ! CloseDataBase($dbi); ! exit; ?> --- 69,75 ---- } ! if (ZIPDUMP_AUTH) ! $user->must_be_admin("make zip archives"); ! MakeWikiZip(isset($include) && $include == 'all'); ?> |
From: Geoffrey T. D. <da...@us...> - 2001-02-10 22:14:39
|
Update of /cvsroot/phpwiki/phpwiki In directory usw-pr-cvs1:/tmp/cvs-serv20420 Modified Files: HISTORY index.php Removed Files: admin.php Log Message: Jeff hacks again: LOT's of changes. Highlights: * Pagename in PATH_INFO support added. * Redid the user (admin) authentication stuff. All access now through index.php. See HISTORY for (a few) more details. Index: HISTORY =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/HISTORY,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 *** HISTORY 2001/02/08 18:19:16 1.13 --- HISTORY 2001/02/10 22:15:07 1.14 *************** *** 1,2 **** --- 1,34 ---- + 02/09/01 Jeff hack's again: + + * Pagename in PATH_INFO support added. This is configurable, + cause, near as I can figure, if the php interpreter is run stand-alone + in /cgi-bin there's no way to pass any useful PATH_INFO to it. + (If a stand-alone php, in say /usr/local/bin, is used as a CGI interpreter, + PATH_INFO will work, as long as php was configured with --enable-discard-path .) + + Along with this I refactored the semantics of all the query arguments to + make them (IMHO) more consistent. + + * Redid the administrator authentication stuff. Eliminated admin.php --- + all access is now through index.php. (New file lib/userauth.php.) + Still a little rough, but a big improvement, I think. Hopefully this + can be developed into a more general user identification scheme... + + Along with eliminating admin.php and the new auth scheme, completely + refactored index.php. It should be easy now to swap config.php and index.php. + (I'll do that soon.) + + * Continued cleaning out page reference stuff. + + * Force archive of old page if author changes. (Unless new author + is admin.) + + * More warning fixes in diff.php + + * Refactored the semantics of the phpwiki: URL's. + See pgsrc/PhpWikiAdministration and pgsrc/MagicPhpWikiURLs + for more information. + + Bug fixes: * Don't show signature image if $SignatureImg (in config.php) is left unset * Bug fix: hang on full zip dump Index: index.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/index.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** index.php 2000/11/08 15:34:06 1.5 --- index.php 2001/02/10 22:15:07 1.6 *************** *** 1,45 **** - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> - <!-- $Id$ --> <?php ! /* ! The main page, i.e. the main loop. ! This file is always called first. ! */ ! ! if (!defined('WIKI_ADMIN')) { // index.php not included by admin.php? ! include "lib/config.php"; ! include "lib/stdlib.php"; ! // All requests require the database ! $dbi = OpenDataBase($WikiPageStore); } ! // Allow choice of submit buttons to determine type of search: ! if (isset($searchtype) && ($searchtype == 'full')) ! $full = $searchstring; ! elseif (isset($searchstring)) // default to title search ! $search = $searchstring; ! if (isset($edit)) { ! include "lib/editpage.php"; ! } elseif (isset($links)) { ! include "lib/editlinks.php"; ! } elseif (isset($copy)) { include "lib/editpage.php"; ! } elseif (isset($search)) { ! include "lib/search.php"; ! } elseif (isset($full)) { ! include "lib/fullsearch.php"; ! } elseif (isset($post)) { include "lib/savepage.php"; ! } elseif (isset($info)) { include "lib/pageinfo.php"; ! } elseif (isset($diff)) { include "lib/diff.php"; ! } else { include "lib/display.php"; // defaults to FrontPage ! } ! ! CloseDataBase($dbi); ?> --- 1,127 ---- <?php ! $RCS_IDS = array('$Id$'); ! function rcs_id($id) ! { ! global $RCS_IDS; ! $RCS_IDS[] = $id; ! } ! ! include "lib/config.php"; ! include "lib/stdlib.php"; ! include "lib/userauth.php"; ! ! ! if (isset($pagename)) ! $pagename = fix_magic_quotes_gpc($pagename); ! else if (USE_PATH_INFO && !empty($PATH_INFO)) ! $pagename = substr($PATH_INFO, 1); ! else ! $pagename = gettext("FrontPage"); ! ! if (empty($action)) ! $action = 'browse'; ! else ! fix_magic_quotes_gpc($action); ! ! // Fix for compatibility with very old diff links in RecentChanges. ! // (The [phpwiki:?diff=PageName] style links are fixed elsewhere.) ! if (isset($diff)) ! { ! $action = 'diff'; ! $pagename = fix_magic_quotes_gpc($diff); ! unset($diff); ! } ! ! function get_auth_mode ($action) ! { ! switch ($action) { ! ! case 'logout': ! return 'LOGOUT'; ! ! case 'login': ! return 'REQUIRE_AUTH'; ! ! case 'lock': ! case 'unlock': ! case 'remove': ! case 'dumpserial': ! case 'loadserial': ! // Auto-login if user attempts one of these ! return 'REQUIRE_AUTH'; ! ! case 'zip': ! // Auto-loing if necessary ! return ZIPDUMP_AUTH ? 'REQUIRE_AUTH' : 'NORMAL'; ! default: ! return 'NORMAL'; } + } ! $user = new WikiUser(get_auth_mode($action)); ! // All requests require the database ! $dbi = OpenDataBase($WikiPageStore); ! ! // if there is no FrontPage, create a basic set of Wiki pages ! if ( ! IsWikiPage($dbi, gettext("FrontPage")) ) ! { ! include "lib/setupwiki.php"; ! } ! ! switch ($action) { ! case 'edit': include "lib/editpage.php"; ! break; ! case 'search': ! if (isset($searchtype) && ($searchtype == 'full')) { ! include "lib/fullsearch.php"; ! } ! else { ! include "lib/search.php"; ! } ! break; ! ! case 'save': include "lib/savepage.php"; ! break; ! case 'info': include "lib/pageinfo.php"; ! break; ! case 'diff': include "lib/diff.php"; ! break; ! ! case 'zip': ! include "admin/zip.php"; ! break; ! ! case 'dumpserial': ! include "admin/dumpserial.php"; ! break; ! ! case 'loadserial': ! include "admin/loadserial.php"; ! break; ! ! case 'remove': ! include 'admin/removepage.php'; ! break; ! ! case 'lock': ! case 'unlock': ! include "admin/lockpage.php"; ! include "lib/display.php"; ! break; ! ! case 'browse': ! case 'login': ! case 'logout': ! default: include "lib/display.php"; // defaults to FrontPage ! break; ! } + CloseDataBase($dbi); ?> --- admin.php DELETED --- |
From: Geoffrey T. D. <da...@us...> - 2001-02-10 05:25:34
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory usw-pr-cvs1:/tmp/cvs-serv12583/lib Modified Files: Tag: release-1_2-branch diff.php ziplib.php Log Message: Fixes for PHP4 E_NOTICE warnings Index: diff.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/diff.php,v retrieving revision 1.4.2.1 retrieving revision 1.4.2.2 diff -C2 -r1.4.2.1 -r1.4.2.2 *** diff.php 2001/02/08 18:28:31 1.4.2.1 --- diff.php 2001/02/10 05:26:00 1.4.2.2 *************** *** 159,162 **** --- 159,164 ---- function _diag ($xoff, $xlim, $yoff, $ylim, $nchunks) { + $flip = false; + if ($xlim - $xoff > $ylim - $yoff) { *************** *** 196,200 **** reset($matches); while (list ($junk, $y) = each($matches)) ! if (! $this->in_seq[$y]) { $k = $this->_lcs_pos($y); --- 198,202 ---- reset($matches); while (list ($junk, $y) = each($matches)) ! if (empty($this->in_seq[$y])) { $k = $this->_lcs_pos($y); *************** *** 214,218 **** $this->in_seq[$y] = 1; } ! else if (! $this->in_seq[$y]) { $k = $this->_lcs_pos($y); --- 216,220 ---- $this->in_seq[$y] = 1; } ! else if (empty($this->in_seq[$y])) { $k = $this->_lcs_pos($y); Index: ziplib.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/ziplib.php,v retrieving revision 1.2.2.1 retrieving revision 1.2.2.2 diff -C2 -r1.2.2.1 -r1.2.2.2 *** ziplib.php 2001/02/08 18:28:31 1.2.2.1 --- ziplib.php 2001/02/10 05:26:00 1.2.2.2 *************** *** 67,70 **** --- 67,71 ---- if (!($fp = gzopen($filename, "rb"))) die("gzopen failed"); + $unz = ''; while ($buf = gzread($fp, 4096)) $unz .= $buf; *************** *** 265,269 **** } ! if ($attrib['write_protected']) $atx = (0100444 << 16) | 1; // S_IFREG + read permissions to everybody. else --- 266,270 ---- } ! if (!empty($attrib['write_protected'])) $atx = (0100444 << 16) | 1; // S_IFREG + read permissions to everybody. else *************** *** 272,276 **** $ati = $attrib['is_ascii'] ? 1 : 0; ! if (!$attrib['mtime']) $attrib['mtime'] = time(); list ($mod_date, $mod_time) = unixtime2dostime($attrib['mtime']); --- 273,277 ---- $ati = $attrib['is_ascii'] ? 1 : 0; ! if (empty($attrib['mtime'])) $attrib['mtime'] = time(); list ($mod_date, $mod_time) = unixtime2dostime($attrib['mtime']); *************** *** 278,282 **** // Construct parts common to "Local file header" and "Central // directory file header." ! $head = pack("vvvvvVVVvv", 20, // Version needed to extract (FIXME: is this right?) --- 279,287 ---- // Construct parts common to "Local file header" and "Central // directory file header." ! if (!isset($attrib['extra_field'])) ! $attrib['extra_field'] = ''; ! if (!isset($attrib['file_comment'])) ! $attrib['file_comment'] = ''; ! $head = pack("vvvvvVVVvv", 20, // Version needed to extract (FIXME: is this right?) *************** *** 456,460 **** preg_match('/^([ !-<>-~]*)(?:([!-<>-~]$)|(.))/s', $string, $match); $quoted .= $match[1] . $match[2]; ! if ($match[3]) $quoted .= sprintf("=%02X", ord($match[3])); $string = substr($string, strlen($match[0])); --- 461,465 ---- preg_match('/^([ !-<>-~]*)(?:([!-<>-~]$)|(.))/s', $string, $match); $quoted .= $match[1] . $match[2]; ! if (!empty($match[3])) $quoted .= sprintf("=%02X", ord($match[3])); $string = substr($string, strlen($match[0])); |
From: Geoffrey T. D. <da...@us...> - 2001-02-09 04:00:02
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory usw-pr-cvs1:/tmp/cvs-serv31896/lib Modified Files: transform.php Log Message: Fix type in wtm_fulltext_search() Index: transform.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/transform.php,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -r1.12 -r1.13 *** transform.php 2001/02/08 10:29:44 1.12 --- transform.php 2001/02/09 04:00:25 1.13 *************** *** 415,419 **** $html = "<form action=\"$ScriptUrl\">\n" . "<input type=text size=30 name=search>\n" . ! "<input type=submit value=\"". gettext("Search") . "\"></form>\n"; $line = str_replace('%%Search%%', $html, $line); --- 415,419 ---- $html = "<form action=\"$ScriptUrl\">\n" . "<input type=text size=30 name=search>\n" . ! "<input type=submit value=\"". htmlspecialchars(gettext("Search")) . "\"></form>\n"; $line = str_replace('%%Search%%', $html, $line); *************** *** 427,432 **** if (strpos($line, '%%Fullsearch%%') !== false) { $html = "<form action=\"$ScriptUrl\">\n" . ! "<input type=text size=30 name=full\n" . ! "<input type=submit value=\"". gettext("Search") . "\"></form>\n"; $line = str_replace('%%Fullsearch%%', $html, $line); --- 427,432 ---- if (strpos($line, '%%Fullsearch%%') !== false) { $html = "<form action=\"$ScriptUrl\">\n" . ! "<input type=text size=30 name=full>\n" . ! "<input type=submit value=\"". htmlspecialchars(gettext("Search")) . "\"></form>\n"; $line = str_replace('%%Fullsearch%%', $html, $line); |
From: Geoffrey T. D. <da...@us...> - 2001-02-08 18:28:10
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory usw-pr-cvs1:/tmp/cvs-serv4426/lib Modified Files: Tag: release-1_2-branch config.php diff.php display.php savepage.php stdlib.php ziplib.php Log Message: Propagate bug fixes from MAIN CVS branch into the stable release branch. I have not added Arno's new transform.php code. Should we? (Is it functionally equivalent to the old code?) Index: config.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/config.php,v retrieving revision 1.24 retrieving revision 1.24.2.1 diff -C2 -r1.24 -r1.24.2.1 *** config.php 2001/01/31 07:38:10 1.24 --- config.php 2001/02/08 18:28:31 1.24.2.1 *************** *** 136,140 **** // logo image (path relative to index.php) $logo = "images/wikibase.png"; ! // signature image which is shown after saving an edited page $SignatureImg = "images/signature.png"; --- 136,142 ---- // logo image (path relative to index.php) $logo = "images/wikibase.png"; ! ! // Signature image which is shown after saving an edited page ! // If this is left blank (or unset), the signature will be omitted. $SignatureImg = "images/signature.png"; *************** *** 232,238 **** if (defined('WIKI_ADMIN') && !empty($AdminUrl)) $ScriptUrl = $AdminUrl; - - $LogoImage = "<img src=\"$logo\" border=0 ALT=\"[PhpWiki!]\">"; - $LogoImage = "<a href=\"$ScriptUrl\">$LogoImage</a>"; $FieldSeparator = "\263"; --- 234,237 ---- Index: diff.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/diff.php,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -C2 -r1.4 -r1.4.2.1 *** diff.php 2000/11/01 11:31:41 1.4 --- diff.php 2001/02/08 18:28:31 1.4.2.1 *************** *** 9,12 **** --- 9,18 ---- // + // FIXME: possibly remove assert()'s for production version? + + // PHP3 does not have assert() + define('USE_ASSERTS', function_exists('assert')); + + /** * Class used internally by WikiDiff to actually compute the diffs. *************** *** 35,38 **** --- 41,45 ---- $n_from = sizeof($from_lines); $n_to = sizeof($to_lines); + $endskip = 0; // Ignore trailing and leading matching lines. *************** *** 72,82 **** $xlines[] = $line; if ( ($this->xchanged[$x] = empty($yhash[$line])) ) ! continue; // fixme? what happens to yhash/xhash when ! // there are two identical lines?? $this->xv[] = $line; $this->xind[] = $x; } - // Find the LCS. $this->_compareseq(0, sizeof($this->xv), 0, sizeof($this->yv)); --- 79,87 ---- $xlines[] = $line; if ( ($this->xchanged[$x] = empty($yhash[$line])) ) ! continue; $this->xv[] = $line; $this->xind[] = $x; } // Find the LCS. $this->_compareseq(0, sizeof($this->xv), 0, sizeof($this->yv)); *************** *** 95,107 **** while ($x < $n_from || $y < $n_to) { ! /* ! if ( ($y == $n_to && !$this->xchanged[$x]) ! || ($x == $n_from && !$this->ychanged[$y]) ) ! die("assertion error"); ! */ // Skip matching "snake". $x0 = $x; $ncopy = 0; while ( $x < $n_from && $y < $n_to && !$this->xchanged[$x] && !$this->ychanged[$y]) --- 100,110 ---- while ($x < $n_from || $y < $n_to) { ! USE_ASSERTS && assert($y < $n_to || $this->xchanged[$x]); ! USE_ASSERTS && assert($x < $n_from || $this->ychanged[$y]); // Skip matching "snake". $x0 = $x; $ncopy = 0; + while ( $x < $n_from && $y < $n_to && !$this->xchanged[$x] && !$this->ychanged[$y]) *************** *** 134,138 **** } } ! if (!empty($endskip)) $this->edits[] = $endskip; } --- 137,141 ---- } } ! if ($endskip != 0) $this->edits[] = $endskip; } *************** *** 196,200 **** { $k = $this->_lcs_pos($y); ! //if (!$k) die('assertion "!$k" failed'); $ymids[$k] = $ymids[$k-1]; break; --- 199,203 ---- { $k = $this->_lcs_pos($y); ! USE_ASSERTS && assert($k > 0); $ymids[$k] = $ymids[$k-1]; break; *************** *** 204,208 **** if ($y > $this->seq[$k-1]) { ! //if ($y >= $this->seq[$k]) die('assertion failed'); // Optimization: this is a common case: // next match is just replacing previous match. --- 207,211 ---- if ($y > $this->seq[$k-1]) { ! USE_ASSERTS && assert($y < $this->seq[$k]); // Optimization: this is a common case: // next match is just replacing previous match. *************** *** 214,218 **** { $k = $this->_lcs_pos($y); ! //if (!$k) die('assertion "!$k" failed'); $ymids[$k] = $ymids[$k-1]; } --- 217,221 ---- { $k = $this->_lcs_pos($y); ! USE_ASSERTS && assert($k > 0); $ymids[$k] = $ymids[$k-1]; } *************** *** 254,258 **** } ! //if ($ypos == $this->seq[$end]) die("assertion failure"); $this->in_seq[$this->seq[$end]] = false; --- 257,261 ---- } ! USE_ASSERTS && assert($ypos != $this->seq[$end]); $this->in_seq[$this->seq[$end]] = false; *************** *** 329,333 **** * * We do something when a run of changed lines include a ! * line at one end and have an excluded, identical line at the other. * We are free to choose which identical line is included. * `compareseq' usually chooses the one at the beginning, --- 332,336 ---- * * We do something when a run of changed lines include a ! * line at one end and has an excluded, identical line at the other. * We are free to choose which identical line is included. * `compareseq' usually chooses the one at the beginning, *************** *** 341,345 **** --- 344,352 ---- $i = 0; $j = 0; + + USE_ASSERTS && assert('sizeof($lines) == sizeof($changed)'); $len = sizeof($lines); + $other_len = sizeof($other_changed); + while (1) { *************** *** 347,356 **** * Scan forwards to find beginning of another run of changes. * Also keep track of the corresponding point in the other file. */ ! while ($i < $len && $changed[$i] == 0) { ! while ($other_changed[$j++]) ! continue; ! $i++; } --- 354,374 ---- * Scan forwards to find beginning of another run of changes. * Also keep track of the corresponding point in the other file. + * + * Throughout this code, $i and $j are adjusted together so that + * the first $i elements of $changed and the first $j elements + * of $other_changed both contain the same number of zeros + * (unchanged lines). + * Furthermore, $j is always kept so that $j == $other_len or + * $other_changed[$j] == false. */ ! while ($j < $other_len && $other_changed[$j]) ! $j++; ! ! while ($i < $len && ! $changed[$i]) { ! USE_ASSERTS && assert('$j < $other_len && ! $other_changed[$j]'); ! $i++; $j++; ! while ($j < $other_len && $other_changed[$j]) ! $j++; } *************** *** 361,368 **** // Find the end of this run of changes. ! while (isset($changed[++$i])) continue; - while ($other_changed[$j]) - $j++; do --- 379,384 ---- // Find the end of this run of changes. ! while (++$i < $len && $changed[$i]) continue; do *************** *** 379,390 **** * This merges with previous changed regions. */ ! while ($start && $lines[$start - 1] == $lines[$i - 1]) { $changed[--$start] = 1; $changed[--$i] = false; ! while ($changed[$start - 1]) $start--; while ($other_changed[--$j]) continue; } --- 395,408 ---- * This merges with previous changed regions. */ ! while ($start > 0 && $lines[$start - 1] == $lines[$i - 1]) { $changed[--$start] = 1; $changed[--$i] = false; ! while ($start > 0 && $changed[$start - 1]) $start--; + USE_ASSERTS && assert('$j > 0'); while ($other_changed[--$j]) continue; + USE_ASSERTS && assert('$j >= 0 && !$other_changed[$j]'); } *************** *** 394,398 **** * CORRESPONDING == LEN means no such point has been found. */ ! $corresponding = empty($other_changed[$j - 1]) ? $len : $i; /* --- 412,416 ---- * CORRESPONDING == LEN means no such point has been found. */ ! $corresponding = $j < $other_len ? $i : $len; /* *************** *** 403,414 **** * the changed region is moved forward as far as possible. */ ! while ($i != $len && $lines[$start] == $lines[$i]) { $changed[$start++] = false; $changed[$i++] = 1; ! while ($changed[$i]) $i++; ! while ($other_changed[++$j]) $corresponding = $i; } } --- 421,439 ---- * the changed region is moved forward as far as possible. */ ! while ($i < $len && $lines[$start] == $lines[$i]) { $changed[$start++] = false; $changed[$i++] = 1; ! while ($i < $len && $changed[$i]) $i++; ! ! USE_ASSERTS && assert('$j < $other_len && ! $other_changed[$j]'); ! $j++; ! if ($j < $other_len && $other_changed[$j]) ! { $corresponding = $i; + while ($j < $other_len && $other_changed[$j]) + $j++; + } } } *************** *** 423,428 **** --- 448,455 ---- $changed[--$start] = 1; $changed[--$i] = 0; + USE_ASSERTS && assert('$j > 0'); while ($other_changed[--$j]) continue; + USE_ASSERTS && assert('$j >= 0 && !$other_changed[$j]'); } } *************** *** 482,486 **** { // Was an add, turn it into a delete. $nadd = sizeof($edit); ! if ($nadd == 0) die("assertion error"); $edit = -$nadd; } --- 509,513 ---- { // Was an add, turn it into a delete. $nadd = sizeof($edit); ! USE_ASSERTS && assert ($nadd > 0); $edit = -$nadd; } Index: display.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/display.php,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -C2 -r1.5 -r1.5.2.1 *** display.php 2000/12/30 21:09:13 1.5 --- display.php 2001/02/08 18:28:31 1.5.2.1 *************** *** 7,12 **** // if it wasn't this file would not have been included ! if (!empty($argv[0])) { ! $pagename = rawurldecode($argv[0]); } else { $pagename = gettext("FrontPage"); --- 7,15 ---- // if it wasn't this file would not have been included ! if (empty($QUERY_STRING) && isset($argv[0])) ! $QUERY_STRING = $argv[0]; ! ! if (isset($QUERY_STRING) && preg_match('/^[-+%\w]+$/', $QUERY_STRING)) { ! $pagename = urldecode($QUERY_STRING); } else { $pagename = gettext("FrontPage"); Index: savepage.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/savepage.php,v retrieving revision 1.7 retrieving revision 1.7.2.1 diff -C2 -r1.7 -r1.7.2.1 *** savepage.php 2001/01/04 18:30:32 1.7 --- savepage.php 2001/02/08 18:28:31 1.7.2.1 *************** *** 178,183 **** // fixme: no test for flat file db system ! if ($WikiPageStore == "/tmp/wikidb") { ! $html .= "<P><B>Warning: the Wiki DBM file still lives in the " . "/tmp directory. Please read the INSTALL file and move " . "the DBM file to a permanent location or risk losing " . --- 178,183 ---- // fixme: no test for flat file db system ! if (isset($DBMdir) && preg_match('@^/tmp\b@', $DBMdir)) { ! $html .= "<P><B>Warning: the Wiki DB files still live in the " . "/tmp directory. Please read the INSTALL file and move " . "the DBM file to a permanent location or risk losing " . *************** *** 185,189 **** } ! $html .= "<P><img src=\"$SignatureImg\"></P><hr noshade><P>"; include('lib/transform.php'); --- 185,192 ---- } ! if (!empty($SignatureImg)) ! $html .= "<P><img src=\"$SignatureImg\"></P>\n"; ! ! $html .= "<hr noshade><P>"; include('lib/transform.php'); Index: stdlib.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/stdlib.php,v retrieving revision 1.21 retrieving revision 1.21.2.1 diff -C2 -r1.21 -r1.21.2.1 *** stdlib.php 2001/01/15 12:32:57 1.21 --- stdlib.php 2001/02/08 18:28:31 1.21.2.1 *************** *** 4,9 **** Standard functions for Wiki functionality ExitWiki($errormsg) ! LinkExistingWikiWord($wikiword) ! LinkUnknownWikiWord($wikiword) LinkURL($url, $linktext) LinkImage($url, $alt) --- 4,9 ---- Standard functions for Wiki functionality ExitWiki($errormsg) ! LinkExistingWikiWord($wikiword, $linktext) ! LinkUnknownWikiWord($wikiword, $linktext) LinkURL($url, $linktext) LinkImage($url, $alt) Index: ziplib.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/ziplib.php,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -r1.2 -r1.2.2.1 *** ziplib.php 2001/01/01 23:13:32 1.2 --- ziplib.php 2001/02/08 18:28:31 1.2.2.1 *************** *** 672,676 **** if ($encoding == 'quoted-printable') $data = QuotedPrintableDecode($data); ! else if ($encoding && $encoding == 'binary') die("Unknown encoding type: $encoding"); --- 672,676 ---- if ($encoding == 'quoted-printable') $data = QuotedPrintableDecode($data); ! else if ($encoding && $encoding != 'binary') die("Unknown encoding type: $encoding"); |
From: Geoffrey T. D. <da...@us...> - 2001-02-08 18:28:10
|
Update of /cvsroot/phpwiki/phpwiki In directory usw-pr-cvs1:/tmp/cvs-serv4426 Modified Files: Tag: release-1_2-branch HISTORY Log Message: Propagate bug fixes from MAIN CVS branch into the stable release branch. I have not added Arno's new transform.php code. Should we? (Is it functionally equivalent to the old code?) Index: HISTORY =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/HISTORY,v retrieving revision 1.12 retrieving revision 1.12.2.1 diff -C2 -r1.12 -r1.12.2.1 *** HISTORY 2001/02/01 05:35:01 1.12 --- HISTORY 2001/02/08 18:28:31 1.12.2.1 *************** *** 1,2 **** --- 1,10 ---- + * Don't show signature image if $SignatureImg (in config.php) is left unset + * Bug fix: hang on full zip dump + * Bug fix: hang on diff + * Bug fix: unzip failed on some old zip-dumps + * Bug fix: check for DB files in /tmp was broken + * Minor security fix: pagename must now be url-encoded + * Spelling fixes in pgsrc/* + 1.2.0 02/01/01 * Support for PHP 4.0.4 (using the dba_* interface for DBM files), |
From: Geoffrey T. D. <da...@us...> - 2001-02-08 18:28:10
|
Update of /cvsroot/phpwiki/phpwiki/admin In directory usw-pr-cvs1:/tmp/cvs-serv4426/admin Modified Files: Tag: release-1_2-branch zip.php Log Message: Propagate bug fixes from MAIN CVS branch into the stable release branch. I have not added Arno's new transform.php code. Should we? (Is it functionally equivalent to the old code?) Index: zip.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/admin/zip.php,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -r1.1 -r1.1.2.1 *** zip.php 2000/11/08 15:30:16 1.1 --- zip.php 2001/02/08 18:28:31 1.1.2.1 *************** *** 1,5 **** <?php // $Id$ ! function MailifyPage ($pagehash, $archive = false) { global $SERVER_ADMIN, $ArchivePageStore; --- 1,5 ---- <?php // $Id$ ! function MailifyPage ($pagehash, $oldpagehash = false) { global $SERVER_ADMIN, $ArchivePageStore; *************** *** 13,23 **** $head .= "Mime-Version: 1.0 (Produced by PhpWiki 1.1.x)\r\n"; ! if ($archive) { ! $oldpage = RetrievePage($archive, $pagehash['pagename'], $ArchivePageStore); ! if (is_array($oldpage)) ! return $head . MimeMultipart(array(MimeifyPage($oldpage), ! MimeifyPage($pagehash))); } return $head . MimeifyPage($pagehash); } --- 13,22 ---- $head .= "Mime-Version: 1.0 (Produced by PhpWiki 1.1.x)\r\n"; ! if (is_array($oldpagehash)) { ! return $head . MimeMultipart(array(MimeifyPage($oldpagehash), ! MimeifyPage($pagehash))); } + return $head . MimeifyPage($pagehash); } *************** *** 38,42 **** if ($include_archive) { - $dba = OpenDataBase($ArchivePageStore); $zipname = "wikidb.zip"; } --- 37,40 ---- *************** *** 48,53 **** --- 46,58 ---- set_time_limit(30); // Reset watchdog. $pagehash = RetrievePage($dbi, $pagename, $WikiPageStore); + if (! is_array($pagehash)) continue; + + if ($include_archive) + $oldpagehash = RetrievePage($dbi, $pagename, $ArchivePageStore); + else + $oldpagehash = false; + $attrib = array('mtime' => $pagehash['lastmodified'], 'is_ascii' => 1); *************** *** 55,59 **** $attrib['write_protected'] = 1; ! $content = MailifyPage($pagehash, $dba); $zip->addRegularFile( rawurlencode($pagehash['pagename']), --- 60,64 ---- $attrib['write_protected'] = 1; ! $content = MailifyPage($pagehash, $oldpagehash); $zip->addRegularFile( rawurlencode($pagehash['pagename']), *************** *** 61,67 **** } $zip->finish(); - - if ($dba) - CloseDataBase($dba); } --- 66,69 ---- |
From: Geoffrey T. D. <da...@us...> - 2001-02-08 18:28:10
|
Update of /cvsroot/phpwiki/phpwiki/pgsrc In directory usw-pr-cvs1:/tmp/cvs-serv4426/pgsrc Modified Files: Tag: release-1_2-branch AddingPages HowToUseWiki PhpWikiAdministration TextFormattingRules Log Message: Propagate bug fixes from MAIN CVS branch into the stable release branch. I have not added Arno's new transform.php code. Should we? (Is it functionally equivalent to the old code?) Index: AddingPages =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/pgsrc/AddingPages,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -C2 -r1.4 -r1.4.2.1 *** AddingPages 2000/11/06 16:14:42 1.4 --- AddingPages 2001/02/08 18:28:31 1.4.2.1 *************** *** 1,3 **** ! To add a new page to Wiki, all you have to do is come up with a meaningful title, capatalize all the words and StringThemTogetherLikeThis. Wiki automagically recognizes it as a hyperlink. Alternatively, you can put anything into [square brackets]. --- 1,3 ---- ! To add a new page to Wiki, all you have to do is come up with a meaningful title, capitalize all the words and StringThemTogetherLikeThis. Wiki automagically recognizes it as a hyperlink. Alternatively, you can put anything into [square brackets]. Index: HowToUseWiki =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/pgsrc/HowToUseWiki,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -C2 -r1.4 -r1.4.2.1 *** HowToUseWiki 2000/11/06 16:14:43 1.4 --- HowToUseWiki 2001/02/08 18:28:31 1.4.2.1 *************** *** 15,19 **** nothing rhymes with monospacing ! * You can seperate paragraphs with an extra blank line. Example: I am a paragraph. --- 15,19 ---- nothing rhymes with monospacing ! * You can separate paragraphs with an extra blank line. Example: I am a paragraph. Index: PhpWikiAdministration =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/pgsrc/PhpWikiAdministration,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -r1.2 -r1.2.2.1 *** PhpWikiAdministration 2000/11/08 15:54:00 1.2 --- PhpWikiAdministration 2001/02/08 18:28:31 1.2.2.1 *************** *** 12,16 **** recent versions of all pages in the PhpWiki. The pages are stored, one per file, as MIME (RFC2045) e-mail (RFC822) messages, with the content type ! application/x-phpwiki for the snapshot and content type mulipart/mixed for the dump. In the latter case, there is one subpart (with type application/x-phpwiki) for each version of the --- 12,16 ---- recent versions of all pages in the PhpWiki. The pages are stored, one per file, as MIME (RFC2045) e-mail (RFC822) messages, with the content type ! application/x-phpwiki for the snapshot and content type multipart/mixed for the dump. In the latter case, there is one subpart (with type application/x-phpwiki) for each version of the Index: TextFormattingRules =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/pgsrc/TextFormattingRules,v retrieving revision 1.8 retrieving revision 1.8.2.1 diff -C2 -r1.8 -r1.8.2.1 *** TextFormattingRules 2000/11/08 17:07:32 1.8 --- TextFormattingRules 2001/02/08 18:28:31 1.8.2.1 *************** *** 10,15 **** ! Lists ! * asterick for first level ! ** asterick-asterick for second level, etc. * Use * for bullet lists, # for numbered lists (mix at will) * semicolon-term-colon-definition for definition lists: --- 10,15 ---- ! Lists ! * asterisk for first level ! ** asterisk-asterisk for second level, etc. * Use * for bullet lists, # for numbered lists (mix at will) * semicolon-term-colon-definition for definition lists: *************** *** 52,56 **** * Hyperlinks to external pages are done like this: [http://www.wcsb.org/] * You can name the links by providing a name, a bar (|) and then the hyperlink or pagename: [PhpWiki home page | http://phpwiki.sourceforge.net/] - [the front page | FrontPage] ! * You can suppress linking to old-style references and URIs by preceeding the word with a '!', e.g. !NotLinkedAsWikiName, !http://not.linked.to/ * [1], [2], [3], [4] refer to remote references. Click EditLinks on the edit form to enter URLs. These differ from the newer linking scheme; references are unique to a page. * Also, the old way of linking URL's is still supported: precede URLs with "http:", "ftp:" or "mailto:" to create links automatically as in: http://c2.com/ --- 52,56 ---- * Hyperlinks to external pages are done like this: [http://www.wcsb.org/] * You can name the links by providing a name, a bar (|) and then the hyperlink or pagename: [PhpWiki home page | http://phpwiki.sourceforge.net/] - [the front page | FrontPage] ! * You can suppress linking to old-style references and URIs by preceding the word with a '!', e.g. !NotLinkedAsWikiName, !http://not.linked.to/ * [1], [2], [3], [4] refer to remote references. Click EditLinks on the edit form to enter URLs. These differ from the newer linking scheme; references are unique to a page. * Also, the old way of linking URL's is still supported: precede URLs with "http:", "ftp:" or "mailto:" to create links automatically as in: http://c2.com/ |
From: Geoffrey T. D. <da...@us...> - 2001-02-08 18:18:55
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory usw-pr-cvs1:/tmp/cvs-serv3835/lib Modified Files: config.php savepage.php Log Message: Don't display $SignatureImg unless one is set in config.php Fix check for DB files in /tmp Index: config.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/config.php,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -r1.27 -r1.28 *** config.php 2001/02/08 15:11:00 1.27 --- config.php 2001/02/08 18:19:16 1.28 *************** *** 136,141 **** // logo image (path relative to index.php) $logo = "images/wikibase.png"; ! // signature image which is shown after saving an edited page ! $SignatureImg = "images/signature.png"; // date & time formats used to display modification times, etc. --- 136,143 ---- // logo image (path relative to index.php) $logo = "images/wikibase.png"; ! ! // Signature image which is shown after saving an edited page ! // If this is left blank (or unset), the signature will be omitted. ! //$SignatureImg = "images/signature.png"; // date & time formats used to display modification times, etc. Index: savepage.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/savepage.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** savepage.php 2001/02/07 22:14:35 1.8 --- savepage.php 2001/02/08 18:19:16 1.9 *************** *** 178,183 **** // fixme: no test for flat file db system ! if ($WikiPageStore == "/tmp/wikidb") { ! $html .= "<P><B>Warning: the Wiki DBM file still lives in the " . "/tmp directory. Please read the INSTALL file and move " . "the DBM file to a permanent location or risk losing " . --- 178,183 ---- // fixme: no test for flat file db system ! if (isset($DBMdir) && preg_match('@^/tmp\b@', $DBMdir)) { ! $html .= "<P><B>Warning: the Wiki DB files still live in the " . "/tmp directory. Please read the INSTALL file and move " . "the DBM file to a permanent location or risk losing " . *************** *** 185,189 **** } ! $html .= "<P><img src=\"$SignatureImg\"></P><hr noshade><P>"; include('lib/transform.php'); --- 185,192 ---- } ! if (!empty($SignatureImg)) ! $html .= "<P><img src=\"$SignatureImg\"></P>\n"; ! ! $html .= "<hr noshade><P>"; include('lib/transform.php'); |