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
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
1
(7) |
2
(15) |
3
(34) |
4
(24) |
5
|
|
6
(3) |
7
(18) |
8
(49) |
9
(2) |
10
(1) |
11
(9) |
12
|
|
13
(21) |
14
(25) |
15
(5) |
16
(21) |
17
(13) |
18
(11) |
19
(24) |
|
20
(9) |
21
(22) |
22
(17) |
23
(6) |
24
|
25
(6) |
26
|
|
27
(8) |
28
(53) |
29
(14) |
30
(9) |
|
|
|
Update of /cvsroot/phpwiki/phpwiki/lib/wikilens In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10416 Modified Files: PageListColumns.php Log Message: + Change numbacklinks function to use existing core functions. It's slower, but it'll work. + Change ratingvalue column to get its specific user as column 5 (index 4). + ratingwidget column uses WikiPlugin_RateIt's RatingWidgetHtml Index: PageListColumns.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/wikilens/PageListColumns.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -2 -b -p -d -r1.3 -r1.4 --- PageListColumns.php 21 Jun 2004 17:01:41 -0000 1.3 +++ PageListColumns.php 30 Jun 2004 20:12:09 -0000 1.4 @@ -34,4 +34,5 @@ rcs_id('$Id$'); require_once('lib/PageList.php'); require_once("lib/wikilens/RatingsUser.php"); +require_once('lib/plugin/RateIt.php'); /** @@ -44,5 +45,11 @@ class _PageList_Column_numbacklinks exte function _getValue ($page_handle, &$revision_handle) { - return $page_handle->getNumLinks(); + //return $page_handle->getNumLinks(); + $theIter = $page_handle->getBackLinks(); + $total = 0; + while($curr = $theIter->next()){ + $total++; + } + return $total; } }; @@ -142,8 +149,8 @@ class _PageList_Column_ratingvalue exten function _PageList_Column_ratingvalue ($params) { $this->_pagelist =& $params[3]; - $this->_user = $this->_pagelist->getOption('user'); + $this->_user =& $params[4];//$this->_pagelist->getOption('user'); assert(!empty($this->_user)); $this->_PageList_Column($params[0], $params[1], $params[2]); - $this->_dimension = $this->_pagelist->getOption('dimension');; + $this->_dimension = $this->_pagelist->getOption('dimension'); } @@ -204,5 +211,5 @@ class _PageList_Column_ratingwidget exte function format ($pagelist, $page_handle, &$revision_handle) { - $widget = RatingWidgetHtml($page_handle->getName(), "", "pagerat", $this->_dimension, "small"); + $widget = WikiPlugin_RateIt::RatingWidgetHtml($page_handle->getName(), "", "pagerat", $this->_dimension, "small"); $td = HTML::td($widget); $td->setAttr('nowrap', 'nowrap'); @@ -234,4 +241,5 @@ class _PageList_Column_prediction extend // This needs to be a reference so things aren't recomputed for this user $this->_active_ratings_user =& RatingsUserFactory::getUser($active_user->getId()); + $this->_pagelist =& $params[3]; $this->_PageList_Column($params[0], $params[1], $params[2]); @@ -278,7 +286,8 @@ class _PageList_Column_top3recs extends $this->_active_ratings_user =& new RatingsUser($active_user->getId()); $this->_PageList_Column($params[0], $params[1], $params[2]); + if (!empty($params[3])) { $this->_pagelist =& $params[3]; - $this->_dimension = $this->_pagelist->getOption('dimension');; + $this->_dimension = $this->_pagelist->getOption('dimension'); $this->_users = $this->_pagelist->getOption('users'); } @@ -288,5 +297,4 @@ class _PageList_Column_top3recs extends { $ratings = $this->_active_ratings_user->get_ratings(); - $iter = $page_handle->getLinks(); $recs = array(); @@ -349,4 +357,12 @@ $WikiTheme->addPageListColumn // $Log$ +// Revision 1.4 2004年06月30日 20:12:09 dfrankow +// + Change numbacklinks function to use existing core functions. +// It's slower, but it'll work. +// +// + Change ratingvalue column to get its specific user as column 5 (index 4). +// +// + ratingwidget column uses WikiPlugin_RateIt's RatingWidgetHtml +// // Revision 1.3 2004年06月21日 17:01:41 rurban // fix typo and rating method call
Update of /cvsroot/phpwiki/phpwiki/lib/wikilens In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10103 Modified Files: RatingsUser.php Log Message: Use RatingsDb singleton. Index: RatingsUser.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/wikilens/RatingsUser.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -2 -b -p -d -r1.2 -r1.3 --- RatingsUser.php 21 Jun 2004 17:01:41 -0000 1.2 +++ RatingsUser.php 30 Jun 2004 20:06:44 -0000 1.3 @@ -73,5 +73,5 @@ class RatingsUser { if (isset($this->_rdbi)) return $this->_rdbi; - $this->_rdbi = new RatingsDb(); + $this->_rdbi = RatingsDb::getTheRatingsDb(); return $this->_rdbi; } @@ -147,4 +147,6 @@ class RatingsUser { if (isset($dimension)) { + + if (isset($this->_ratings[$pagename][$dimension])) { @@ -166,6 +168,10 @@ class RatingsUser { // XXX: does this really want to do a full ratings load? (scalability?) $this->_load_ratings(); + + if ($this->has_rated($pagename, $dimension)) { + + return $this->_ratings[$pagename][$dimension]->get_rating(); } @@ -348,6 +354,8 @@ class RatingsUser { // passing null as first parameter to indicate all dimensions $dbi = $this->_get_rating_dbi(); + $rating_iter = $dbi->sql_get_rating(null, $this->_userid, null); //$rating_iter = $dbi->get_rating(null, $this->_userid); + while($rating = $rating_iter->next()) { @@ -359,4 +367,5 @@ class RatingsUser { $rating['ratingvalue']); } + $this->_ratings_loaded = true; } @@ -417,4 +426,7 @@ class _UserRating // $Log$ +// Revision 1.3 2004年06月30日 20:06:44 dfrankow +// Use RatingsDb singleton. +// // Revision 1.2 2004年06月21日 17:01:41 rurban // fix typo and rating method call
Update of /cvsroot/phpwiki/phpwiki/lib/wikilens In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9107 Modified Files: RatingsDb.php Log Message: + Add getTheRatingsDb() singleton. + Remove defaulting of dimension, userid, pagename in getRating-- it didn't work + Fix typo in get_rating. + Fix _sql_get_rating_result + Fix sql_rate(). It's now not transactionally safe yet, but at least it works. Index: RatingsDb.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/wikilens/RatingsDb.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -2 -b -p -d -r1.2 -r1.3 --- RatingsDb.php 19 Jun 2004 10:22:41 -0000 1.2 +++ RatingsDb.php 30 Jun 2004 20:05:36 -0000 1.3 @@ -32,4 +32,5 @@ define('RATING_STORAGE','SQL'); class RatingsDb extends WikiDB { + function RatingsDb() { global $request; @@ -50,8 +51,19 @@ class RatingsDb extends WikiDB { } + // this is a singleton. It ensures there is only 1 ratingsDB. + function &getTheRatingsDb(){ + static $_theRatingsDb; + + if (!isset($_theRatingsDb)){ + $_theRatingsDb = new RatingsDb(); + } + //echo "rating db is $_theRatingsDb"; + return $_theRatingsDb; + } + + /// ************************************************************************************* // FIXME // from Reini Urban's RateIt plugin - function addRating($rating, $userid, $pagename, $dimension) { if (RATING_STORAGE == 'SQL') { @@ -77,7 +89,4 @@ class RatingsDb extends WikiDB { function getRating($userid=null, $pagename=null, $dimension=null) { - if (is_null($dimension)) $dimension = $this->dimension; - if (is_null($userid)) $userid = $this->userid; - if (is_null($pagename)) $pagename = $this->pagename; if (RATING_STORAGE == 'SQL') { $ratings_iter = $this->sql_get_rating($dimension, $userid, $pagename); @@ -149,11 +158,12 @@ class RatingsDb extends WikiDB { $orderby = null, $pageinfo = "ratee") { if (RATING_STORAGE == 'SQL') { - $ratings_iter = $this->sql_get_rating($dimension, $userid, $pagename); + $ratings_iter = $this->sql_get_rating($dimension, $rater, $pagename); if ($rating = $ratings_iter->next()) { return $rating['ratingvalue']; } else return false; + // return $ratings_iter; } else { - return $this->metadata_get_rating($userid, $pagename, $dimension); + return $this->metadata_get_rating($rater, $pagename, $dimension); } /* @@ -404,5 +414,4 @@ class RatingsDb extends WikiDB { if (($pageinfo != "ratee") && ($pageinfo != "rater")) return; - $dbi = &$this->_dbi->_backend; //$dbh = &$this->_dbi; @@ -426,5 +435,5 @@ class RatingsDb extends WikiDB { if (isset($rater) or isset($ratee)) $what = '*'; // same as _get_users_rated_result() - else $what = 'DISTINCT p.pagename'; + else $what = 'DISTINCT p.pagename, r.ratingvalue, r.dimension'; $query = "SELECT $what" @@ -432,5 +441,4 @@ class RatingsDb extends WikiDB { . $where . $orderbyStr; - $result = $dbi->_dbh->query($query); return $result; @@ -492,14 +500,12 @@ class RatingsDb extends WikiDB { assert($raterid); assert($rateeid); + //we changed back to delete and insert because update didn't work if it was a new rating + + $dbi->_dbh->query("DELETE from $rating_tbl WHERE dimension=$dimension AND raterpage=$raterid AND rateepage=$rateeid"); $where = "WHERE raterpage='$raterid' AND rateepage='$rateeid'"; - if (isset($dimension)) $where .= " AND dimension='$dimension'"; - // atomic transaction: - $dbi->_dbh->query("UPDATE $rating_tbl SET ratingvalue='$rating', rateeversion='$rateeversion' $where"); - /* - $dbi->_dbh->query("DELETE FROM $rating_tbl $where"); - // NOTE: Leave tstamp off the insert, and MySQL automatically updates it (only if MySQL is used) - $dbi->_dbh->query("INSERT INTO $rating_tbl (dimension, raterpage, rateepage, ratingvalue, rateeversion) VALUES ('$dimension', $raterid, $rateeid, '$rating', '$rateeversion')"); - */ + $insert = "INSERT INTO $rating_tbl (dimension, raterpage, rateepage, ratingvalue, rateeversion) VALUES ('$dimension', $raterid, $rateeid, '$rating', '$rateeversion')"; + $dbi->_dbh->query($insert); + //$dbi->unlock(); return true; @@ -656,4 +662,13 @@ extends WikiDB_backend_PearDB { // $Log$ +// Revision 1.3 2004年06月30日 20:05:36 dfrankow +// + Add getTheRatingsDb() singleton. +// + Remove defaulting of dimension, userid, pagename in getRating-- +// it didn't work +// + Fix typo in get_rating. +// + Fix _sql_get_rating_result +// + Fix sql_rate(). It's now not transactionally safe yet, but at least it +// works. +// // Revision 1.2 2004年06月19日 10:22:41 rurban // outcomment the pear specific methods to let all pages load
Update of /cvsroot/phpwiki/phpwiki/themes/wikilens/templates In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8741 Added Files: categorypage.tmpl Log Message: For CategoryPage plugin, to list items in a category --- NEW FILE: categorypage.tmpl --- <?php rcs_id('$Id: categorypage.tmpl,v 1.1 2004年06月30日 20:00:20 dfrankow Exp $'); ?> <div class="categorypage categorypage-form"> This page represents the <?=$SINGULAR?> category. <br/> All pages that are in the <?=$SINGULAR?> category refer to this page. <br/><br/> <?php $this->_printPlugin("<" . "?plugin UserRatings nobuds=" . ($SHOWBUDS ? 0 : 1) . " category=\"" . $PAGENAME . "\" ?" . ">"); ?> <br/> <?php if ($SHOWBUDS){ $btn = Button(array('exclude' => "$EXCLUDE", 'category' => "$PAGENAME", 'showbuds' => false), _("Hide Buddy Ratings in the $SINGULAR category"), $PAGENAME); } else { $btn = Button(array('exclude' => "$EXCLUDE", 'category' => "$PAGENAME", 'showbuds' => true), _("Show Buddy Ratings in the $SINGULAR category"), $PAGENAME); } ?> <?= $btn ?> <h3>To create a page in the <?=$SINGULAR?> category</h3> <ol> <li> Search to see if it already exists. We don't want lots of duplicate pages. You can use this FuzzyPages search: <?plugin-form FuzzyPages ?> </li> <br/> <li> If it does not exist, you can create the page. You can use this CreatePage button, or see <?php $link = WikiLink("HowToUseWiki"); ?> <?= $link ?> for more ways to navigate or create pages. <?php $bpage = "~~[" . $PAGENAME . "]"; $initial_content = "\"This page is in the $bpage category. You must leave in at least one reference to $bpage in order for this page to be in the $bpage category. Otherwise, edit this text to describe your page.\""; $adder = ""; //if($SELF_ON_CREATE == true){ //$adder = "save_and_redirect_to=\"" . $PAGENAME . "\""; //} $this->_printPlugin("<" . "?plugin-form CreatePage " . $adder . " initial_content=" . $initial_content . " ?" . ">"); ?> </li> <br/> <li> Once you have created a page, it will simply appear in the list above. If you would like to add information about the page, click on its name in the list and edit and save the text. To ensure that the page stays in this category, make sure <b>[<?=$PAGENAME?>]</b> is in the description somewhere (including the brackets to be safe). </li> </ol> </div>
Update of /cvsroot/phpwiki/phpwiki/lib/plugin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7909 Modified Files: RateIt.php Log Message: Make changes suitable so that wikilens theme (and wikilens.org) work properly. + Remove predictions (for now) + Use new RatingsDb singleton. + Change RatingWidgetHtml() to use parameters like a normal PHP function so we can have PHP check that we're passing the right # of them. + Change RatingWidgetHtml() to be callable static-ally (without a plugin object) + Remove the "RateIt" button for now, because we don't use it on wikilens.org. Maybe if someone wants the button, there can be an arg or flag for it. + Always show the cancel button, because UI widgets should not hide. + Remove the "No opinion" button for now, because we don't yet store that. This is a useful thing, tho, for the future. Index: RateIt.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/plugin/RateIt.php,v retrieving revision 1.11 retrieving revision 1.12 diff -u -2 -b -p -d -r1.11 -r1.12 --- RateIt.php 19 Jun 2004 10:22:41 -0000 1.11 +++ RateIt.php 30 Jun 2004 19:59:07 -0000 1.12 @@ -108,12 +108,6 @@ function displayRating(imgPrefix, rating var imgName = imgPrefix + i; var imgSrc = '".$img."'; - if (pred) - document[imgName].title = '"._("Predicted rating ")."'+ratingvalue; - else document[imgName].title = '"._("Your rating ")."'+ratingvalue; if (i<=(ratingvalue*2)) { - if (pred) - document[imgName].src = imgSrc + ((i%2) ? 'Rk1' : 'Rk0') + '.png'; - else document[imgName].src = imgSrc + ((i%2) ? 'Ok1' : 'Ok0') + '.png'; } else { @@ -121,8 +115,7 @@ function displayRating(imgPrefix, rating } } - if ((pred == 0) && (ratingvalue > 0)) - document[cancel].src = imgSrc + 'Cancel.png'; - else - document[cancel].src = imgSrc + 'CancelN.png'; + + //document[cancel].src = imgSrc + 'Cancel.png'; + } function click(actionImg, pagename, version, imgPrefix, dimension, rating) { @@ -160,4 +153,5 @@ function deleteRating(actionImg, page, d * string between ''s */ + function _javascript_quote_string($s) { return str_replace("'", "\'", $s); @@ -206,5 +200,5 @@ function deleteRating(actionImg, page, d if (RATING_STORAGE == 'SQL') { - $rdbi = new RatingsDb(); + $rdbi = RatingsDb::getTheRatingsDb(); $this->_rdbi =& $rdbi; } @@ -215,5 +209,5 @@ function deleteRating(actionImg, page, d global $WikiTheme; $actionImg = $WikiTheme->_path . $this->actionImgPath(); - $rdbi->addRating($request->getArg('rating')); + $rdbi->addRating($request->getArg('rating'), $user->getId(), $this->pagename, $this->dimension); ob_end_clean(); // discard any previous output // delete the cache @@ -233,5 +227,5 @@ function deleteRating(actionImg, page, d global $WikiTheme; $actionImg = $WikiTheme->_path . $this->actionImgPath(); - $rdbi->deleteRating(); + $rdbi->deleteRating($user->getId(), $this->pagename, $this->dimension); ob_end_clean(); // discard any previous output // delete the cache @@ -250,5 +244,4 @@ function deleteRating(actionImg, page, d // $WikiTheme->addMoreHeaders($this->RatingWidgetJavascript()); // or we change the header in the ob_buffer. - //Todo: add a validator based on the users last rating mtime $rating = $rdbi->getRating(); @@ -263,5 +256,5 @@ function deleteRating(actionImg, page, d */ $args['rating'] = $rating; - return $this->RatingWidgetHtml($args); + return $this->RatingWidgetHtml($args['pagename'], $args['version'], $args['imgPrefix'], $args['dimension'], $args['small']); } else { if (!$user->isSignedIn()) @@ -273,7 +266,8 @@ function deleteRating(actionImg, page, d $rdbi->getAvg($this->pagename, $this->dimension)), HTML::br()); - if ($rating !== false) + if ($rating !== false) { $html->pushContent(sprintf(_("Your rating was %.1f"), $rating)); + } else { $pred = $rdbi->getPrediction($this->userid, $this->pagename, $this->dimension); @@ -322,18 +316,21 @@ function deleteRating(actionImg, page, d * And only the widget, but no value (for buddies) also. */ - function RatingWidgetHtml($args) { + function RatingWidgetHtml($pagename, $version, $imgPrefix, $dimension, $small = false) { global $WikiTheme, $request; - extract($args); - if (!$request->_user->isSignedIn()) return; + + $imgPrefix = $pagename . $imgPrefix; $actionImgName = $imgPrefix . 'RateItAction'; $dbi =& $GLOBALS['request']->getDbh(); $version = $dbi->_backend->get_latest_version($pagename); - $rdbi =& $this->_rdbi; + //$rdbi =& $this->_rdbi; + $rdbi = RatingsDb::getTheRatingsDb(); + $id = 'rateit'; // Protect against 's, though not \r or \n - $reImgPrefix = $this->_javascript_quote_string($imgPrefix); - $reActionImgName = $this->_javascript_quote_string($actionImgName); - $rePagename = $this->_javascript_quote_string($pagename); + + $reImgPrefix = WikiPlugin_RateIt::_javascript_quote_string($imgPrefix); + $reActionImgName = WikiPlugin_RateIt::_javascript_quote_string($actionImgName); + $rePagename = WikiPlugin_RateIt::_javascript_quote_string($pagename); //$dimension = $args['pagename'] . "rat"; @@ -343,8 +340,4 @@ function deleteRating(actionImg, page, d $none[$i] = $WikiTheme->_findData("images/RateItRk$i.png"); } - if (!$small) { - $html->pushContent(Button(_("RateIt"),_("RateIt"), $pagename)); - $html->pushContent(HTML::raw(' ')); - } @@ -360,6 +353,7 @@ function deleteRating(actionImg, page, d $img_attr = array(); $img_attr['src'] = $nk[$i%2]; - if (!$rating and !$pred) - $img_attr['src'] = $none[$i%2]; + //if (!$rating and !$pred) + // $img_attr['src'] = $none[$i%2]; + $img_attr['name'] = $imgPrefix . $i; $img_attr['border'] = 0; @@ -367,10 +361,12 @@ function deleteRating(actionImg, page, d $a1->addToolTip(_("Rate the topic of this page")); $html->pushContent($a1); + //This adds a space between the rating smilies: // if (($i%2) == 0) $html->pushContent(' '); } $html->pushContent(HTML::Raw(' ')); + $a0 = HTML::a(array('href' => 'javascript:click(\'' . $reActionImgName . '\',\'' . $rePagename . '\',\'' . $version . '\',\'' . $reImgPrefix . '\',\'' . $dimension . '\',\'X\')')); - if ($rating) { + $msg = _("Cancel rating"); $a0->pushContent(HTML::img(array('src' => $WikiTheme->getImageUrl("RateItCancel"), @@ -379,5 +375,5 @@ function deleteRating(actionImg, page, d $a0->addToolTip($msg); $html->pushContent($a0); - } elseif ($pred) { + /*} elseif ($pred) { $msg = _("No opinion"); $html->pushContent(HTML::img(array('src' => $WikiTheme->getImageUrl("RateItCancelN"), @@ -386,5 +382,5 @@ function deleteRating(actionImg, page, d //$a0->addToolTip($msg); //$html->pushContent($a0); - } + }*/ $img_attr = array(); $img_attr['src'] = $WikiTheme->_findData("images/RateItAction.png"); @@ -407,4 +403,18 @@ function deleteRating(actionImg, page, d // $Log$ +// Revision 1.12 2004年06月30日 19:59:07 dfrankow +// Make changes suitable so that wikilens theme (and wikilens.org) work properly. +// + Remove predictions (for now) +// + Use new RatingsDb singleton. +// + Change RatingWidgetHtml() to use parameters like a normal PHP function +// so we can have PHP check that we're passing the right # of them. +// + Change RatingWidgetHtml() to be callable static-ally +// (without a plugin object) +// + Remove the "RateIt" button for now, because we don't use it on wikilens.org. +// Maybe if someone wants the button, there can be an arg or flag for it. +// + Always show the cancel button, because UI widgets should not hide. +// + Remove the "No opinion" button for now, because we don't yet store that. +// This is a useful thing, tho, for the future. +// // Revision 1.11 2004年06月19日 10:22:41 rurban // outcomment the pear specific methods to let all pages load
Update of /cvsroot/phpwiki/phpwiki/lib/plugin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7618 Added Files: UserRatings.php Log Message: UserRatings for WikiLens --- NEW FILE: UserRatings.php --- <?php // -*-php-*- rcs_id('$Id: UserRatings.php,v 1.1 2004年06月30日 19:54:17 dfrankow Exp $'); /** Copyright 2004 Dan Frankowski This file is part of PhpWiki. PhpWiki is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. PhpWiki is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with PhpWiki; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /** */ require_once('lib/PageList.php'); require_once('lib/wikilens/Buddy.php'); require_once("lib/wikilens/PageListColumns.php"); if (ENABLE_USER_NEW) require_once("lib/WikiUserNew.php"); else require_once("lib/WikiUser.php"); /** * Show a user's ratings in a table, using PageList. * Usage: * <?plugin UserRatings ?> * * This only works with the "wikilens" theme. */ class WikiPlugin_UserRatings extends WikiPlugin { function getName () { return _("UserRatings"); } function getDescription () { return _("List the user's ratings."); } function getVersion() { return preg_replace("/[Revision: $]/", '', "\$Revision: 1.1 $"); } function getDefaultArguments() { return array('dimension' => '0', // array of userids to display ratings for; null/empty for // active user only 'userids' => null, // array of pageids to display ratings for; null for all // of current active user's ratings 'pageids' => null, // a category to display ratings for; null for no category; // has higher precedence than pageids 'category' => null, 'pagename' => '[pagename]', // hackish 'exclude' => '', 'limit' => 0, // limit of <=0 is show-all 'noheader' => 0, 'userPage' => false, 'nobuds' => false, // rating columns are added later 'info' => 'pagename'); // getting a bit crowded with the buddies... // 'info' => 'hits,pagename,author,ratingwidget'); } // info arg allows multiple columns // info=mtime,hits,summary,version,author,locked,minor // exclude arg allows multiple pagenames exclude=HomePage,RecentChanges function run($dbi, $argstr, $request) { extract($this->getArgs($argstr, $request)); // XXX: fix to reflect multi-user ratings? $caption = _("Displaying %d ratings:"); $active_user = $request->getUser(); $active_userid = $active_user->_userid; // check for request to display a category's ratings if(isset($category) && is_string($category) && strlen($category)) { $pageids = array(); $category_page = $dbi->getPage($category); $iter = $category_page->getLinks(); while($item = $iter->next()) { array_push($pageids, $item->getName()); } // XXX: is there a way to retrieve the preferred plural // representation of a category name? // XXX: should the category text be a link? can it be one easily? $caption = sprintf(_("Showing all %ss (%%d):"), $category); } // if null is passed as the pageids argument and no category was passed, // show active user's ratings elseif(!isset($pageids) || !is_array($pageids)) { // XXX: need support for sorted ratings // bug: pages excluded from the PageList via the "exclude" argument // count toward the limit! $pageids = array(); $active_user_ratings_user = & RatingsUserFactory::getUser($active_user->getId()); $current_user_ratings = $active_user_ratings_user->get_ratings(); if ($userPage){ //we're on a user's homepage, get *their* ratings $this_page_user = & RatingsUserFactory::getUser($userPage); $caption = _("Here are $userPage" . "'s %d page ratings:"); $ratings = $this_page_user->get_ratings(); } else { $caption = _("Here are your %d page ratings:"); $ratings = $current_user_ratings; } $i = 0; foreach($ratings as $pagename => $page_ratings) { // limit is currently only honored for "own" ratings if($limit > 0 && $i >= $limit) { break; } if(isset($page_ratings[$dimension])) { array_push($pageids, $pagename); $i++; } } // $caption = _("Here are your %d page ratings:"); //make $ratings the user's ratings again if it had been treated as the current page // name's ratings $ratings = $current_user_ratings; } // if userids is null or empty, fill it with just the active user if(!isset($userids) || !is_array($userids) || !count($userids)) { // TKL: moved getBuddies call inside if statement because it was // causing the userids[] parameter to be ignored if(is_string($active_userid) && strlen($active_userid) && $active_user->isSignedIn() && !$userPage) { if (isset($category_page)){ $userids = getBuddies($active_userid, $dbi, $category_page->getName()); } else { $userids = getBuddies($active_userid, $dbi); } } elseif ($userPage) { //we're on a user page, show that user's ratings as the only column $userids = array(); array_push($userids, $userPage); } else { $userids = array(); // XXX: this wipes out the category caption... // $caption = _("You must be logged in to view ratings."); } } // find out which users we should show ratings for // users allowed in the prediction calculation $allowed_users = array(); // users actually allowed to be shown to the user $allowed_users_toshow = array(); foreach($userids as $userid) { $user = & RatingsUserFactory::getUser($userid); if($user->allow_view_ratings($active_user)) { array_push($allowed_users_toshow, &$user); } // all users should be allowed in calculation array_push($allowed_users, &$user); // This line ensures $user is not a reference type after this loop // If it is a reference type, that can produce very unexpected behavior! unset($user); } // if no buddies, use allusers in prediction calculation if (count($userids) == 0 || $userPage){ $allowed_users = array(); //$people_iter = $dbi->get_users_rated(); $people_dbi = RatingsDb::getTheRatingsDb(); $people_iter = $people_dbi->sql_get_users_rated(); while($people_array = $people_iter->next()){ $userid = $people_array['pagename']; $user = & RatingsUserFactory::getUser($userid); array_push($allowed_users, &$user); } } $columns = $info ? explode(",", $info) : array(); // build our table... $pagelist = new PageList($columns, $exclude, array('dimension' => $dimension, 'users' => $allowed_users_toshow)); // augment columns //$preds = new _PageList_Column_prediction('prediction', _("Pred"), 'right', $dimension, $allowed_users); $preds = array('_PageList_column_prediction','custom:prediction', _("Pred"),'right',' ' , $allowed_users); $pagelist->addColumnObject($preds); //$widget = new _PageList_Column_ratingwidget('ratingwidget', _("Rate"), 'left', $dimension); $widget = array('_PageList_column_ratingwidget','custom:ratingwidget', _("Rate"), 'center'); $pagelist->addColumnObject($widget); $noRatingUsers = array(); if (!$nobuds){ foreach($allowed_users_toshow as $idx => $user) { // For proper caching behavior, get a ref, don't user $user $u = & $allowed_users_toshow[$idx]; //$col = & new _PageList_Column_ratingvalue('ratingvalue', $u->getId(), 'right', $dimension, $u); $col = array('_PageList_Column_ratingvalue','custom:ratingvalue', $u->getId(), 'right',' ' ,$u); $pagelist->addColumnObject($col); unset($u); } } // add rows -- each row represents an item (page) foreach($pageids as $pagename) { // addPage can deal with cases where it is passed a string $pagelist->addPage($pagename); } if (! $noheader) { $pagelist->setCaption(_($caption)); } return $pagelist; } }; // Local Variables: // mode: php // tab-width: 8 // c-basic-offset: 4 // c-hanging-comment-ender-p: nil // indent-tabs-mode: nil // End: ?>
Update of /cvsroot/phpwiki/phpwiki/lib/plugin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7000 Added Files: CategoryPage.php Log Message: CategoryPage for WikiLens --- NEW FILE: CategoryPage.php --- <?php // -*-php-*- rcs_id('$Id: CategoryPage.php,v 1.1 2004年06月30日 19:51:30 dfrankow Exp $'); /** Copyright 1999, 2000, 2001, 2002 $ThePhpWikiProgrammingTeam This file is part of PhpWiki. PhpWiki is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. PhpWiki is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with PhpWiki; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #require_once('lib/InlineParser.php'); require_once('lib/BlockParser.php'); /** * CategoryPage plugin. * * This puts boilerplate text on a category page to make it easily usable * by novices. * * Usage: * <?plugin-form CategoryPage ?> * * It finds the file templates/categorypage.tmpl, then loads it with a few * variables substituted. * * This has only been used in wikilens.org. */ class WikiPlugin_CategoryPage extends WikiPlugin { function getName () { return _("CategoryPage"); } function getDescription () { return _("Create a Wiki page."); } function getVersion() { return preg_replace("/[Revision: $]/", '', "\$Revision: 1.1 $"); } function getDefaultArguments() { return array(// Assume the categories are listed on the HomePage 'exclude' => false, 'pagename' => '[pagename]', 'plural' => false, 'singular' => false, 'self_on_create' => true, 'showbuds' => false); } function run($dbi, $argstr, $request) { $args = $this->getArgs($argstr, $request); if (empty($args['singular'])) { $args['singular'] = $args['pagename']; } if (empty($args['plural'])) { $args['plural'] = $args['singular'] . 's'; } return new Template('categorypage', $request, array('EXCLUDE' => $args['exclude'], 'PAGENAME' => $args['pagename'], 'PLURAL' => $args['plural'], 'SHOWBUDS' => $args['showbuds'], 'SELF_ON_CREATE' => $args['self_on_create'], 'SINGULAR' => $args['singular'])); } }; // Local Variables: // mode: php // tab-width: 8 // c-basic-offset: 4 // c-hanging-comment-ender-p: nil // indent-tabs-mode: nil // End: ?>
Update of /cvsroot/phpwiki/phpwiki In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32662 Modified Files: Makefile Log Message: get db params from config/config.ini only db root is needed for Makefile now Index: Makefile =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/Makefile,v retrieving revision 1.3 retrieving revision 1.4 diff -u -2 -b -p -d -r1.3 -r1.4 --- Makefile 23 Jun 2004 11:53:55 -0000 1.3 +++ Makefile 30 Jun 2004 11:30:42 -0000 1.4 @@ -1,9 +1,14 @@ # gnu make (also with cygwin) version -# TODO: get db params from config/config.ini DB_ADMINUSER=root DB_ADMINPASS=secret -DB_DB=phpwiki -DB_USER=wikiuser -DB_PASS= +# get db params from config/config.ini +DATABASE_DSN := $(shell config/make-dbhelper.pl config/config.ini) +#DB_DB=phpwiki +DB_DB := $(word 1,${DATABASE_DSN}) +#DB_USER=wikiuser +DB_USER := $(word 2,${DATABASE_DSN}) +#DB_PASS= +DB_PASS := $(word 3,${DATABASE_DSN}) + DB_SQLITE_DBFILE = /tmp/phpwiki-sqlite.db @@ -11,10 +16,16 @@ DB_SQLITE_DBFILE = /tmp/phpwiki-sqlite.d PHP_SRC := $(wildcard *.php ./lib/*.php ./lib/WikiDB/*.php ./lib/plugin/*.php) +.PHONY: all locale mysql psql sqlite + all: TAGS TAGS: $(PHP_SRC) # etags $(PHP_SRC) - if [ -f TAGS ]; then /usr/bin/mv -f TAGS TAGS~; fi - /usr/bin/find . . \( -type d -regex '\(^\./lib/pear\)\|\(^\./lib/WikiDB/adodb\)\|\(^\./lib/nusoap\)\|\(^\./lib/fpdf\)\|\(^\./locale/.*/LC_MESSAGES\)' \) -prune -o -name \*.php -exec etags -a '{}' \; + if [ -f $@ ]; then /usr/bin/mv -f $@ $@~; fi + /usr/bin/find . \( -type d -regex '\(^\./lib/pear\)\|\(^\./lib/WikiDB/adodb\)\|\(^\./lib/nusoap\)\|\(^\./lib/fpdf\)\|\(^\./locale/.*/LC_MESSAGES\)' \) -prune -o -name \*.php | etags -L - + +TAGS.full: $(PHP_SRC) + if [ -f $@ ]; then /usr/bin/mv -f $@ $@~; fi + /usr/bin/find . -name \*.php -o -name \*.tmpl | etags -L - --langmap="HTML:.tmpl" -f $@; locale: @@ -24,4 +35,8 @@ locale: DB_OPTS=-u$(DB_ADMINUSER) -p$(DB_ADMINPASS) +dbtest: + echo DB_OPTS=$(DB_OPTS) DB_DB=$(DB_DB) DB_USER=${DB_USER} DB_PASS=${DB_PASS} + +# initialize the database mysql: mysqladmin $(DB_OPTS) create $(DB_DB) @@ -30,15 +45,23 @@ TO $(DB_USER)@localhost IDENTIFIED BY '$ mysql $(DB_OPTS) $(DB_DB) < schemas/mysql.sql +# initialize the database psql: su postmaster createdb $(DB_DB) -ifeq ($(DB_PASS),"") + ifeq ($(DB_PASS),"") createuser -D -A -P $(DB_USER) -else + else createuser -D -A $(DB_USER) -endif + endif psql $(DB_DB) -f schemas/psql.sql logout +# initialize the database sqlite: sqlite $(DB_SQLITE_DBFILE) < schemas/sqlite.sql + +# update the database +${DB_SQLITE_DBFILE}: schemas/sqlite.sql + echo ".dump" | sqlite ${DB_SQLITE_DBFILE} > dump.sql + mv ${DB_SQLITE_DBFILE} ${DB_SQLITE_DBFILE}.old + sqlite $(DB_SQLITE_DBFILE) < dump.sql
Update of /cvsroot/phpwiki/phpwiki/config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32662/config Added Files: make-dbhelper.pl Log Message: get db params from config/config.ini only db root is needed for Makefile now --- NEW FILE: make-dbhelper.pl --- #!/usr/bin/perl -n # makefile helper to extract the database, user and password from config.ini if (/^\s*DATABASE_DSN\s*=\s*"?([\w:\/@]+)/) { $dsn = 1ドル; $db = $user = $pass = ''; $dsn =~ /.+\/(.+?)$/ and $db = 1ドル; $dsn =~ /:\/\/(\w+):/ and $user = 1ドル; $dsn =~ /:\/\/\w+:(\w+)@/ and $pass = 1ドル; print "$db $user $pass\n"; exit; }
Update of /cvsroot/phpwiki/phpwiki/lib/plugin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20295 Modified Files: SyntaxHighlighter.php Log Message: use predefined constants, and added sf.net defaults Index: SyntaxHighlighter.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/plugin/SyntaxHighlighter.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -2 -b -p -d -r1.5 -r1.6 --- SyntaxHighlighter.php 14 Jun 2004 11:31:39 -0000 1.5 +++ SyntaxHighlighter.php 29 Jun 2004 18:47:40 -0000 1.6 @@ -47,15 +47,18 @@ Fixes by Reini Urban: HIGHLIGHT_DATA_DIR, HIGHLIGHT_EXE */ - -define('HIGHLIGHT_EXE','highlight'); +if (!defined('HIGHLIGHT_EXE')) + define('HIGHLIGHT_EXE','highlight'); //define('HIGHLIGHT_EXE','/usr/local/bin/highlight'); +//define('HIGHLIGHT_EXE','/home/groups/p/ph/phpwiki/bin/highlight'); // highlight requires two subdirs themes and langDefs somewhere. // Best by highlight.conf in $HOME, but the webserver user usually // doesn't have a $HOME -if (isWindows()) +if (!defined('HIGHLIGHT_DATA_DIR')) + if (isWindows()) define('HIGHLIGHT_DATA_DIR','f:\cygnus\usr\local\share\highlight'); -else + else define('HIGHLIGHT_DATA_DIR','/usr/share/highlight'); + //define('HIGHLIGHT_DATA_DIR','/home/groups/p/ph/phpwiki/share/highlight'); class WikiPlugin_SyntaxHighlighter @@ -181,4 +184,7 @@ extends WikiPlugin // $Log$ +// Revision 1.6 2004年06月29日 18:47:40 rurban +// use predefined constants, and added sf.net defaults +// // Revision 1.5 2004年06月14日 11:31:39 rurban // renamed global $Theme to $WikiTheme (gforge nameclash)
Update of /cvsroot/phpwiki/phpwiki/themes/default In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12602 Modified Files: phpwiki-heavy.css phpwiki.css Log Message: better desc Index: phpwiki-heavy.css =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/themes/default/phpwiki-heavy.css,v retrieving revision 1.4 retrieving revision 1.5 diff -u -2 -b -p -d -r1.4 -r1.5 --- phpwiki-heavy.css 21 Feb 2003 04:21:46 -0000 1.4 +++ phpwiki-heavy.css 29 Jun 2004 18:09:20 -0000 1.5 @@ -89,4 +89,5 @@ input.wikiaction, input.wikiadmin, input height: auto; width: auto; +/* These gecko-specific give CSS parse error: */ -moz-appearance: none; -moz-box-sizing: content-box; Index: phpwiki.css =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/themes/default/phpwiki.css,v retrieving revision 1.42 retrieving revision 1.43 diff -u -2 -b -p -d -r1.42 -r1.43 --- phpwiki.css 13 Jun 2004 09:40:08 -0000 1.42 +++ phpwiki.css 29 Jun 2004 18:09:20 -0000 1.43 @@ -185,5 +185,5 @@ caption { font-family: Arial, Helvetica, .pagelist tr.oddrow { background: white; } th.gridbutton { - background-color: threedlightshadow; + background-color: ThreedLightShadow; color: black; font-family: Tahoma, sans-serif, Arial, Helvetica; @@ -197,5 +197,5 @@ th.gridbutton { border-width: 1px; border-style: solid; - border-color: threedhighlight threeddarkshadow threeddarkshadow threedhighlight; + border-color: ThreedHighlight ThreedDarkShadow ThreedDarkShadow ThreedHighlight; } input.gridbutton, a.gridbutton, a:hover.gridbutton, a:visited.gridbutton { @@ -205,5 +205,5 @@ input.gridbutton, a.gridbutton, a:hover. /*font-style: menu;*/ font-family: Tahoma, sans-serif, Arial, Helvetica; - background-color: threedlightshadow; + background-color: ThreedLightShadow; color: black; }
Update of /cvsroot/phpwiki/phpwiki/config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6179 Modified Files: config-default.ini config-dist.ini Log Message: outcomment KEYWORD_LINK_REGEXP. This is never read Index: config-default.ini =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/config/config-default.ini,v retrieving revision 1.14 retrieving revision 1.15 diff -u -2 -b -p -d -r1.14 -r1.15 --- config-default.ini 22 Jun 2004 07:05:15 -0000 1.14 +++ config-default.ini 29 Jun 2004 12:36:34 -0000 1.15 @@ -88,5 +88,5 @@ INTERWIKI_MAP_FILE = lib/interwiki.map WARN_NONPUBLIC_INTERWIKIMAP = false KEYWORDS = "Category:Topic" -KEYWORD_LINK_REGEXP = "(?<=^\'. join(\'|^\', $keywords) . \')[[:upper:]].*$" +; KEYWORD_LINK_REGEXP = "(?<=^\'. join(\'|^\', $keywords) . \')[[:upper:]].*$" TOC_FULL_SYNTAX = true COPYRIGHTPAGE_TITLE = "GNU General Public License" Index: config-dist.ini =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/config/config-dist.ini,v retrieving revision 1.20 retrieving revision 1.21 diff -u -2 -b -p -d -r1.20 -r1.21 --- config-dist.ini 29 Jun 2004 06:48:00 -0000 1.20 +++ config-dist.ini 29 Jun 2004 12:36:34 -0000 1.21 @@ -734,5 +734,5 @@ WARN_NONPUBLIC_INTERWIKIMAP = false ; The default behavior is to match Category* and Topic* links. KEYWORDS = "Category:Topic" -;KEYWORD_LINK_REGEXP = "(?<=^\'. join(\'|^\', $keywords) . \')[[:upper:]].*$" +; KEYWORD_LINK_REGEXP = "(?<=^\'. join(\'|^\', $keywords) . \')[[:upper:]].*$" ; Author and Copyright Site Navigation Links
Update of /cvsroot/phpwiki/phpwiki/pgsrc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19293 Modified Files: ReleaseNotes Log Message: updates Index: ReleaseNotes =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/pgsrc/ReleaseNotes,v retrieving revision 1.40 retrieving revision 1.41 diff -u -2 -b -p -d -r1.40 -r1.41 --- ReleaseNotes 28 Jun 2004 13:31:31 -0000 1.40 +++ ReleaseNotes 29 Jun 2004 10:52:40 -0000 1.41 @@ -1,3 +1,3 @@ -Date: Tue, 8 Jun 2004 22:20:05 +0200 +Date: 2004年6月29日 10:03:50 +0200 Mime-Version: 1.0 (Produced by PhpWiki 1.3.11pre) X-Rcs-Id: $Id$ @@ -21,5 +21,5 @@ fixes: * utf-8 pagenames fixed (typed foreign names from IE) * CGI: no PATH_INFO fix -* fix some too loose PagePerms for signed, but not authenticated users +* fix some too loose PhpWiki:PagePermissions for signed, but not authenticated users (admin, owner, creator), and edit and view for Bogo and Password users * security fix for create ACL: action=edit is now checked for create @@ -27,28 +27,28 @@ fixes: * fixed important WikiDB bug with DEBUG > 0: wrong assertion around line 172 (#954648) -* RssFeed stability fix for empty feeds or broken connections +* RssFeedPlugin stability fix for empty feeds or broken connections * fixed Sidebar theme CSS, added existing dates to jscalendar -* fixed ImageLinks, broken since 1.3.10 (Bug #956068) +* fixed PhpWiki:ImageLinks, broken since 1.3.10 (Bug #956068) * fixed lib/pear/File_Passwd loading * fixed missing DEBUG warnings (Support #954260) * TranslateText: verbatim needed a pagebreak * fixed duplicate session_id warning with adodb -* fixed adodb DbPassUser login -* fixed external DbPassUser login +* fixed adodb ~DbPassUser login +* fixed external ~DbPassUser login * fixed adodb action=upgrade -* fixed FilePassUser locking problems +* fixed ~FilePassUser locking problems * fixed a lot of LDAP auth and group issues * fixed LDAP options handling (by John Cole) * fixed possible security problems: allowing only posixly strict usernames, and an actual LDAP Injection problem, detected by Steve Christey, MITRE. -* honor s=wildcard arguments for WikiAdmin plugins +* honor s=wildcard arguments for ~WikiAdmin plugins * fixed flatfile assertion (#963268) - check existing previous version * fixed all msg references from index.php to config/config.ini * fixed immediate LANG and THEME in-session updates if not stored in prefs -* fixed USER_AUTH_POLICY=old, use only USER_AUTH_ORDER methods (besides HttpAuth) +* fixed USER_AUTH_POLICY=old, use only USER_AUTH_ORDER methods (besides ~HttpAuth) and removed LDAP, POP3, IMAP default configs. * RelatedChanges: fixed days links * fix Rename: Change pagename in all linked pages -* fixed PageChangeNotification for not-current users +* fixed PhpWiki:PageChangeNotification for not-current users * fixed UpLoadPlugin for filenames with space (Bug #969532) * fixed label support for CreateTocPlugin (Bug #969495) @@ -58,30 +58,32 @@ fixes: * fixed unneeded UserPreferences plugin login screen on dumphtml * catch SOAP fatal on GooglePlugin without GOOGLE_LICENSE_KEY -* silently ignore jshide argument on MacIE for AddComment and CreateToc +* silently ignore jshide argument on MacIE for AddCommentPlugin and CreateTocPlugin * PhpWiki is now allow_call_time_pass_reference = Off safe (php.ini) Some external libraries are not (Pear_DB odbc, adodb oracle) * fixed sql statements for pagedata where it is not needed, fixing the typical PageList memory exhaustion on simple page lists. +* fixed crash after login, by eliminating endless recursion in + group isAdmin() checks changes: -* WikiAdminSetAcl functional -* enabled PagePerm for all admin plugins (no admin required): - Remove, Rename, Replace, SetAcl, Chown +* ~WikiAdminSetAcl functional +* enabled PhpWiki:PagePermissions for all admin plugins (no admin required): + Remove, Rename, Replace, ~SetAcl, Chown * new Error-style with collapsed output of repeated messages * trim pagenames to avoid abuse * no double login page header, better login msg. -* improved FileFinder include_path logic (NormalizeLocalFileName, ...) +* improved ~FileFinder include_path logic (~NormalizeLocalFileName, ...) ** init global FileFinder to add proper include paths at startup adds PHPWIKI_DIR if started from another dir, lib/pear also ** fix slashify for Windows * check more config-default and predefined constants -* AutoSplit pagenames at subpage seperators, esp for Sidebar theme +* ~AutoSplit pagenames at subpage seperators, esp for Sidebar theme * improve Pagelist layout by equal pagename width for limited lists * added CPAN to interwiki.map * ExternalSearchPlugin useimage arg (RFE #952323) * Simplified some strings for easier translation -* added hash and object support for SessionPassUser userid session variable -* Auth Page=>DB PassUser upgrade: delete existing Page prefs, if Db prefs are saved. -* renamed DB_Session.php to DbSession.php +* added hash and object support for ~SessionPassUser userid session variable +* Auth Page=>DB ~PassUser upgrade: delete existing Page prefs, if Db prefs are saved. +* renamed DB_Session.php to ~DbSession.php * vastly improved french locale support, which is now complete (by Pierrick Meignen). english, german and french are now completely translated. The others partially. @@ -90,8 +92,11 @@ changes: * show RelatedChanges only if minimum two links on the current page. * PageDump: ViewSource link, better actionpage usage, MessageID TZ -* brought WikiUser (old) uptodate +* brought ~WikiUser (old) uptodate * added owner and acl fields to dumps * import GOOGLE_LICENSE_KEY and FORTUNE_DIR from config.ini -* renamed global $Theme to $WikiTheme (gforge nameclash) +* renamed global $Theme to $~WikiTheme (gforge nameclash) +* aggressive WikiDB and cache memory optimization: don't cache %content + and _cached_html if not needed. +* PageDump added format=backup: dump all revisions. new: @@ -102,21 +107,21 @@ new: * implemented WikiDB page creator and ownership * added action=pdf: only page formatter missing -* new XmlParser, HtmlParser: new libs for HTML->wiki import and htmlarea3 support -** RssFeed broken +* new ~XmlParser, ~HtmlParser: new libs for HTML->wiki import and htmlarea3 support * new pagename utf8 detection logic (from mediawiki) * new action=chown|setacl|rename|dump action shortcuts pointing to the plugin * new SyntaxHighlighter plugin (based on work by alecthomas), needs highlight from http://www.andre-simon.de/ -* new Ploticus plugin. full application/xhtml+xml support not yet +* new PloticusPlugin. full application/xhtml+xml support not yet (javascript document.write() not supported with ENABLE_XHTML_XML) * new ListPages plugin (by Dan Frankowski) -* new TeX2png plugin (by Pierrick Meignen) +* new TeX2pngPlugin (by Pierrick Meignen) * added support for ?force_unlock=1 parameter for stale File_Passwd locks (should not be needed anymore, we lock only when we actually change the passwd) -* added mysql-4.1 fix at action=upgrade +* added mysql-4.1 fix at action=upgrade, + added CACHE_CONTROL NONE => NO_CACHE config.ini fix to action=upgrade * author, owner, creator support for WikiAdmin* and AllPages plugins: ** AllPagesCreatedByMe, AllPagesLastEditedByMe, AllPagesOwnedByMe * added action revert, with button from action=diff -* added option regex to WikiAdminSearchReplace +* added option regex to ~WikiAdminSearchReplace * added oracle PearDB backend (by Philippe Vanhaesendonck)
Update of /cvsroot/phpwiki/phpwiki/lib/plugin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11560/plugin Modified Files: PageDump.php Log Message: better desc Index: PageDump.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/plugin/PageDump.php,v retrieving revision 1.14 retrieving revision 1.15 diff -u -2 -b -p -d -r1.14 -r1.15 --- PageDump.php 29 Jun 2004 10:07:40 -0000 1.14 +++ PageDump.php 29 Jun 2004 10:09:06 -0000 1.15 @@ -152,5 +152,5 @@ extends WikiPlugin } elseif ($format == 'backup') { - $desc = _("(formatted for backing up)"); // all revisions + $desc = _("(formatted for backing up: all revisions)"); // all revisions $altpreviewbuttons = HTML( Button(array('action' => $this->getName(), @@ -165,5 +165,5 @@ extends WikiPlugin $page)); } else { - $desc = _("(normal formatting)"); + $desc = _("(normal formatting: latest revision only)"); $altpreviewbuttons = HTML( Button(array('action' => $this->getName(), @@ -284,4 +284,7 @@ _("PhpWiki developers should manually in // $Log$ +// Revision 1.15 2004年06月29日 10:09:06 rurban +// better desc +// // Revision 1.14 2004年06月29日 10:07:40 rurban // added dump of all revisions by format=backup (screen and download)
Update of /cvsroot/phpwiki/phpwiki/lib/plugin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11228/plugin Modified Files: PageDump.php Log Message: added dump of all revisions by format=backup (screen and download) Index: PageDump.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/plugin/PageDump.php,v retrieving revision 1.13 retrieving revision 1.14 diff -u -2 -b -p -d -r1.13 -r1.14 --- PageDump.php 17 Jun 2004 10:39:18 -0000 1.13 +++ PageDump.php 29 Jun 2004 10:07:40 -0000 1.14 @@ -10,7 +10,8 @@ rcs_id('$Id$'); * PhpWikiAdministration needs to be updated to handle URLs again, and * add loading capability from InterWiki addresses. + + * multiple revisions in one file handled by format=backup * - * TODO: What about multiple revisions in one file? comments/summary - * field? quoted-printable? + * TODO: What about comments/summary field? quoted-printable? * * Usage: @@ -48,5 +49,5 @@ extends WikiPlugin 'page' => '[pagename]', //'encoding' => 'binary', // 'binary', 'quoted-printable' - 'format' => false, // 'normal', 'forcvs' + 'format' => false, // 'normal', 'forcvs', 'backup' // display within WikiPage or give a downloadable // raw pgsrc? @@ -61,5 +62,5 @@ extends WikiPlugin if (!$page) return ''; - if (! $dbi->isWikiPage($page)) + if (! $dbi->isWikiPage($page) ) return fmt("Page %s not found.", WikiLink($page, 'unknown')); @@ -67,5 +68,5 @@ extends WikiPlugin $p = $dbi->getPage($page); include_once("lib/loadsave.php"); - $mailified = MailifyPage($p); + $mailified = MailifyPage($p, ($format == 'backup') ? 99 : 1); // fixup_headers massages the page dump headers depending on @@ -83,5 +84,5 @@ extends WikiPlugin if ($format == 'forcvs') $this->fixup_headers_forcvs($mailified); - else + else // backup or normal $this->fixup_headers($mailified); @@ -113,5 +114,4 @@ extends WikiPlugin $mailified = wordwrap($mailified, 70); - // fixme: what about when not using VIRTUAL_PATH? $dlcvs = Button(array(//'page' => $page, 'action' => $this->getName(), @@ -125,21 +125,56 @@ extends WikiPlugin _("Download for backup"), $page); + $dlall = Button(array(//'page' => $page, + 'action' => $this->getName(), + 'format'=> 'backup', + 'download'=> true), + _("Download all revisions for backup"), + $page); $h2 = HTML::h2(fmt("Preview: Page dump of %s", WikiLink($page, 'auto'))); + global $WikiTheme; + if (!$Sep = $WikiTheme->getButtonSeparator()) + $Sep = " "; + if ($format == 'forcvs') { - $desc = _("(formatted for PhpWiki developers, not for backing up)"); - $altpreviewbutton = Button(array(//'page' => $page, - 'action' => $this->getName()), + $desc = _("(formatted for PhpWiki developers as pgsrc template, not for backing up)"); + $altpreviewbuttons = HTML( + Button(array('action' => $this->getName()), + _("Preview as normal format"), + $page), + $Sep, + Button(array( + 'action' => $this->getName(), + 'format'=> 'backup'), _("Preview as backup format"), - $page); + $page)); } - else { - $desc = _("(formatted for backing up)"); - $altpreviewbutton = Button(array(//'page' => $page, + elseif ($format == 'backup') { + $desc = _("(formatted for backing up)"); // all revisions + $altpreviewbuttons = HTML( + Button(array('action' => $this->getName(), + 'format'=> 'forcvs'), + _("Preview as developer format"), + $page), + $Sep, + Button(array( 'action' => $this->getName(), + 'format'=> ''), + _("Preview as normal format"), + $page)); + } else { + $desc = _("(normal formatting)"); + $altpreviewbuttons = HTML( + Button(array('action' => $this->getName(), 'format'=> 'forcvs'), _("Preview as developer format"), - $page); + $page), + $Sep, + Button(array( + 'action' => $this->getName(), + 'format'=> 'backup'), + _("Preview as backup format"), + $page)); } $warning = HTML( @@ -153,15 +188,11 @@ _("PhpWiki developers should manually in ); - global $WikiTheme; - if (!$Sep = $WikiTheme->getButtonSeparator()) - $Sep = " "; - return HTML($h2, HTML::em($desc), HTML::pre($mailified), - $altpreviewbutton, + $altpreviewbuttons, HTML::div(array('class' => 'errors'), HTML::strong(_("Warning:")), " ", $warning), - $dl, $Sep, $dlcvs + $dl, $Sep, $dlall, $Sep, $dlcvs ); } @@ -253,4 +284,7 @@ _("PhpWiki developers should manually in // $Log$ +// Revision 1.14 2004年06月29日 10:07:40 rurban +// added dump of all revisions by format=backup (screen and download) +// // Revision 1.13 2004年06月17日 10:39:18 rurban // fix reverse translation of possible actionpage
Update of /cvsroot/phpwiki/phpwiki/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3423 Modified Files: main.php Log Message: force string hash Index: main.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/main.php,v retrieving revision 1.170 retrieving revision 1.171 diff -u -2 -b -p -d -r1.170 -r1.171 --- main.php 25 Jun 2004 14:29:20 -0000 1.170 +++ main.php 29 Jun 2004 09:30:42 -0000 1.171 @@ -334,11 +334,11 @@ $this->version = phpwiki_version(); static $levels = false; if (!$levels) - $levels = array('-1' => _("FORBIDDEN"), - '0' => _("ANON"), - '1' => _("BOGO"), - '2' => _("USER"), - '10' => _("ADMIN"), - '100'=> _("UNOBTAINABLE")); - return $levels[$level]; + $levels = array('x-1' => _("FORBIDDEN"), + 'x0' => _("ANON"), + 'x1' => _("BOGO"), + 'x2' => _("USER"), + 'x10' => _("ADMIN"), + 'x100'=> _("UNOBTAINABLE")); + return $levels["x".$level]; } @@ -1071,4 +1071,7 @@ main(); // $Log$ +// Revision 1.171 2004年06月29日 09:30:42 rurban +// force string hash +// // Revision 1.170 2004年06月25日 14:29:20 rurban // WikiGroup refactoring:
Update of /cvsroot/phpwiki/phpwiki/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32123 Modified Files: PageList.php Log Message: More memory optimization: don't cache unneeded _cached_html and %content for content and size columns (only if sortable, which will fail for too many pages) Index: PageList.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/PageList.php,v retrieving revision 1.96 retrieving revision 1.97 diff -u -2 -b -p -d -r1.96 -r1.97 --- PageList.php 29 Jun 2004 08:47:42 -0000 1.96 +++ PageList.php 29 Jun 2004 09:11:10 -0000 1.97 @@ -243,9 +243,22 @@ class _PageList_Column_custom extends _P class _PageList_Column_size extends _PageList_Column { - function _getValue ($page_handle, &$revision_handle) { + function format (&$pagelist, $page_handle, &$revision_handle) { + return HTML::td($this->_tdattr, + HTML::raw(' '), + $this->_getValue($pagelist, $page_handle, $revision_handle), + HTML::raw(' ')); + } + + function _getValue (&$pagelist, $page_handle, &$revision_handle) { if (!$revision_handle or (!$revision_handle->_data['%content'] - or $revision_handle->_data['%content'] === true)) + or $revision_handle->_data['%content'] === true)) { $revision_handle = $page_handle->getCurrentRevision(true); - return $this->_getSize($revision_handle); + unset($revision_handle->_data['%pagedata']['_cached_html']); + } + $size = $this->_getSize($revision_handle); + // we can safely purge the content when it is not sortable + if (empty($pagelist->_sortby[$this->_field])) + unset($revision_handle->_data['%content']); + return $size; } @@ -259,5 +272,4 @@ class _PageList_Column_size extends _Pag function _getSize($revision_handle) { $bytes = @strlen($revision_handle->_data['%content']); - //unset($revision_handle->_data['%content']); return ByteFormatter($bytes); } @@ -356,12 +368,17 @@ class _PageList_Column_content extends _ } } + function _getValue ($page_handle, &$revision_handle) { if (!$revision_handle or (!$revision_handle->_data['%content'] - or $revision_handle->_data['%content'] === true)) + or $revision_handle->_data['%content'] === true)) { $revision_handle = $page_handle->getCurrentRevision(true); + } // Not sure why implode is needed here, I thought // getContent() already did this, but it seems necessary. $c = implode("\n", $revision_handle->getContent()); + if (empty($pagelist->_sortby[$this->_field])) + unset($revision_handle->_data['%content']); if ($this->_field == 'hi_content') { + unset($revision_handle->_data['%pagedata']['_cached_html']); $search = $_POST['admin_replace']['from']; if ($search and ($i = strpos($c,$search))) { @@ -386,4 +403,6 @@ class _PageList_Column_content extends _ // false --> don't bother processing hrefs for embedded WikiLinks $ct = TransformText($c, $revision_handle->get('markup'), false); + if (empty($pagelist->_sortby[$this->_field])) + unset($revision_handle->_data['%pagedata']['_cached_html']); return HTML::div(array('style' => 'font-size:x-small'), HTML::div(array('class' => 'transclusion'), $ct), @@ -1252,4 +1271,9 @@ extends PageList { // $Log$ +// Revision 1.97 2004年06月29日 09:11:10 rurban +// More memory optimization: +// don't cache unneeded _cached_html and %content for content and size columns +// (only if sortable, which will fail for too many pages) +// // Revision 1.96 2004年06月29日 08:47:42 rurban // Memory optimization (reference to parent, smart bool %content)
Update of /cvsroot/phpwiki/phpwiki/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27639 Modified Files: ArchiveCleaner.php IniConfig.php WikiDB.php stdlib.php Log Message: Use ...version() $need_content argument in WikiDB also: To reduce the memory footprint for larger sets of pagelists, we don't cache the content (only true or false) and we purge the pagedata (_cached_html) also. _cached_html is only cached for the current pagename. => Vastly improved page existance check, ACL check, ... Now only PagedList info=content or size needs the whole content, esp. if sortable. Index: ArchiveCleaner.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/ArchiveCleaner.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -2 -b -p -d -r1.3 -r1.4 --- ArchiveCleaner.php 29 Apr 2004 20:41:03 -0000 1.3 +++ ArchiveCleaner.php 29 Jun 2004 08:52:22 -0000 1.4 @@ -34,9 +34,9 @@ class ArchiveCleaner $authors_seen = array(); - $current = $page->getCurrentRevision(); + $current = $page->getCurrentRevision(false); - for ( $revision = $page->getRevisionBefore($current); + for ( $revision = $page->getRevisionBefore($current,false); $revision->getVersion() > 0; - $revision = $page->getRevisionBefore($revision) ) { + $revision = $page->getRevisionBefore($revision,false) ) { if ($revision->get('is_minor_edit')) Index: IniConfig.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/IniConfig.php,v retrieving revision 1.43 retrieving revision 1.44 diff -u -2 -b -p -d -r1.43 -r1.44 --- IniConfig.php 29 Jun 2004 06:48:02 -0000 1.43 +++ IniConfig.php 29 Jun 2004 08:52:22 -0000 1.44 @@ -301,4 +301,5 @@ function IniConfig($file) { // Another "too-tricky" redefine global $KeywordLinkRegexp; + if (!isset($rs['KEYWORDS'])) $rs['KEYWORDS'] = @$rsdef['KEYWORDS']; if (!isset($rs['KEYWORDS'])) $rs['KEYWORDS'] = "Category:Topic"; $keywords = preg_split('/\s*:\s*/', $rs['KEYWORDS']); @@ -611,4 +612,14 @@ function fix_configs() { // $Log$ +// Revision 1.44 2004年06月29日 08:52:22 rurban +// Use ...version() $need_content argument in WikiDB also: +// To reduce the memory footprint for larger sets of pagelists, +// we don't cache the content (only true or false) and +// we purge the pagedata (_cached_html) also. +// _cached_html is only cached for the current pagename. +// => Vastly improved page existance check, ACL check, ... +// +// Now only PagedList info=content or size needs the whole content, esp. if sortable. +// // Revision 1.43 2004年06月29日 06:48:02 rurban // Improve LDAP auth and GROUP_LDAP membership: Index: WikiDB.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/WikiDB.php,v retrieving revision 1.72 retrieving revision 1.73 diff -u -2 -b -p -d -r1.72 -r1.73 --- WikiDB.php 25 Jun 2004 14:15:08 -0000 1.72 +++ WikiDB.php 29 Jun 2004 08:52:22 -0000 1.73 @@ -208,6 +208,5 @@ class WikiDB { function isWikiPage ($pagename) { $page = $this->getPage($pagename); - $current = $page->getCurrentRevision(); - return ! $current->hasDefaultContents(); + return $page->exists(); } @@ -409,5 +408,5 @@ class WikiDB { $page->save($current->getPackedContent(), $version + 1, $meta); } - } elseif (!$oldpage->getCurrentRevision() and !$newpage->exists()) { + } elseif (!$oldpage->getCurrentRevision(false) and !$newpage->exists()) { // if a version 0 exists try it also. $result = $this->_backend->rename_page($from, $to); @@ -583,7 +582,13 @@ class WikiDB_Page } + // To reduce the memory footprint for larger sets of pagelists, + // we don't cache the content (only true or false) and + // we purge the pagedata (_cached_html) also function exists() { - $current = $this->getCurrentRevision(); - return ! $current->hasDefaultContents(); + $current = $this->getCurrentRevision(false); + unset($current->_wikidb->_cache->_pagedata_cache[$this->_pagename]); + $exists = ! $current->hasDefaultContents(); + unset($current->_data->{'%pagedata'}); + return $exists; } @@ -922,5 +927,5 @@ class WikiDB_Page * @return WikiDB_PageRevision The current WikiDB_PageRevision object. */ - function getCurrentRevision() { + function getCurrentRevision($need_content = true) { $backend = &$this->_wikidb->_backend; $cache = &$this->_wikidb->_cache; @@ -934,5 +939,6 @@ class WikiDB_Page //$backend->lock(); $version = $cache->get_latest_version($pagename); - $revision = $this->getRevision($version); + // getRevision gets the content also! + $revision = $this->getRevision($version, $need_content); //$backend->unlock(); assert($revision); @@ -951,5 +957,5 @@ class WikiDB_Page * Note that version zero of any page always exists. */ - function getRevision($version) { + function getRevision($version, $need_content=true) { $cache = &$this->_wikidb->_cache; $pagename = &$this->_pagename; @@ -959,5 +965,5 @@ class WikiDB_Page assert($version > 0); - $vdata = $cache->get_versiondata($pagename, $version); + $vdata = $cache->get_versiondata($pagename, $version, $need_content); if (!$vdata) return false; @@ -982,5 +988,5 @@ class WikiDB_Page * the default revision) will always be found. */ - function getRevisionBefore($version) { + function getRevisionBefore($version, $need_content=true) { $backend = &$this->_wikidb->_backend; $pagename = &$this->_pagename; @@ -992,5 +998,5 @@ class WikiDB_Page //$backend->lock(); $previous = $backend->get_previous_version($pagename, $version); - $revision = $this->getRevision($previous); + $revision = $this->getRevision($previous, $need_content); //$backend->unlock(); assert($revision); @@ -1176,5 +1182,5 @@ class WikiDB_Page function isUserPage ($include_empty = true) { if ($include_empty) { - $current = $this->getCurrentRevision(); + $current = $this->getCurrentRevision(false); if ($current->hasDefaultContents()) { return false; @@ -1209,5 +1215,5 @@ class WikiDB_Page // The authenticated author of the current revision. function getAuthor() { - if ($current = $this->getCurrentRevision()) return $current->get('author_id'); + if ($current = $this->getCurrentRevision(false)) return $current->get('author_id'); else return ''; } @@ -1310,5 +1316,5 @@ class WikiDB_PageRevision if (!isset($this->_iscurrent)) { $page = $this->getPage(); - $current = $page->getCurrentRevision(); + $current = $page->getCurrentRevision(false); $this->_iscurrent = $this->getVersion() == $current->getVersion(); } @@ -1808,5 +1814,5 @@ class WikiDB_cache // there is a bug here somewhere which results in an assertion failure at line 105 // of ArchiveCleaner.php It goes away if we use the next line. - $need_content = true; + //$need_content = true; $nc = $need_content ? '1':'0'; $cache = &$this->_versiondata_cache; @@ -1817,5 +1823,5 @@ class WikiDB_cache // If we have retrieved all data, we may as well set the cache for $need_content = false if ($need_content){ - $cache[$pagename][$version]['0'] = $cache[$pagename][$version]['1']; + $cache[$pagename][$version]['0'] =& $cache[$pagename][$version]['1']; } } @@ -1825,6 +1831,17 @@ class WikiDB_cache } // FIXME: ugly - if ($vdata && !empty($vdata['%pagedata'])) + if ($vdata && !empty($vdata['%pagedata'])) { $this->_pagedata_cache[$pagename] = $vdata['%pagedata']; + // only store _cached_html for the requested page + if (defined('USECACHE') and USECACHE + and isset($vdata['%pagedata']['_cached_html']) + and $pagename != $GLOBALS['request']->getArg('pagename')) + { + unset($this->_pagedata_cache[$pagename]['_cached_html']); + unset($cache[$pagename][$version][$nc]['%pagedata']['_cached_html']); + if ($need_content) + unset($cache[$pagename][$version][0]['%pagedata']['_cached_html']); + } + } return $vdata; } @@ -1875,4 +1892,14 @@ class WikiDB_cache // $Log$ +// Revision 1.73 2004年06月29日 08:52:22 rurban +// Use ...version() $need_content argument in WikiDB also: +// To reduce the memory footprint for larger sets of pagelists, +// we don't cache the content (only true or false) and +// we purge the pagedata (_cached_html) also. +// _cached_html is only cached for the current pagename. +// => Vastly improved page existance check, ACL check, ... +// +// Now only PagedList info=content or size needs the whole content, esp. if sortable. +// // Revision 1.72 2004年06月25日 14:15:08 rurban // reduce memory footprint by caching only requested pagedate content (improving most page iterators) Index: stdlib.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/stdlib.php,v retrieving revision 1.194 retrieving revision 1.195 diff -u -2 -b -p -d -r1.194 -r1.195 --- stdlib.php 29 Jun 2004 06:48:04 -0000 1.194 +++ stdlib.php 29 Jun 2004 08:52:22 -0000 1.195 @@ -668,5 +668,6 @@ function ConvertOldMarkup ($text, $marku $bang_esc[] = "(?:" . ALLOWED_PROTOCOLS . "):[^\s<>\[\]\"'()]*[^\s<>\[\]\"'(),.?]"; $map = getInterwikiMap(); - $bang_esc[] = $map->getRegexp() . ":[^\\s.,;?()]+"; // FIXME: is this really needed? + if ($map_regex = $map->getRegexp()) + $bang_esc[] = $map_regex . ":[^\\s.,;?()]+"; // FIXME: is this really needed? $bang_esc[] = $WikiNameRegexp; $orig[] = '/!((?:' . join(')|(', $bang_esc) . '))/'; @@ -1616,4 +1617,14 @@ function url_get_contents( $uri ) { // $Log$ +// Revision 1.195 2004年06月29日 08:52:22 rurban +// Use ...version() $need_content argument in WikiDB also: +// To reduce the memory footprint for larger sets of pagelists, +// we don't cache the content (only true or false) and +// we purge the pagedata (_cached_html) also. +// _cached_html is only cached for the current pagename. +// => Vastly improved page existance check, ACL check, ... +// +// Now only PagedList info=content or size needs the whole content, esp. if sortable. +// // Revision 1.194 2004年06月29日 06:48:04 rurban // Improve LDAP auth and GROUP_LDAP membership:
Update of /cvsroot/phpwiki/phpwiki/lib/plugin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27639/plugin Modified Files: WikiAdminSelect.php Log Message: Use ...version() $need_content argument in WikiDB also: To reduce the memory footprint for larger sets of pagelists, we don't cache the content (only true or false) and we purge the pagedata (_cached_html) also. _cached_html is only cached for the current pagename. => Vastly improved page existance check, ACL check, ... Now only PagedList info=content or size needs the whole content, esp. if sortable. Index: WikiAdminSelect.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/plugin/WikiAdminSelect.php,v retrieving revision 1.18 retrieving revision 1.19 diff -u -2 -b -p -d -r1.18 -r1.19 --- WikiAdminSelect.php 16 Jun 2004 10:38:59 -0000 1.18 +++ WikiAdminSelect.php 29 Jun 2004 08:52:24 -0000 1.19 @@ -123,4 +123,5 @@ extends WikiPlugin $args = $this->getArgs($argstr, $request); $this->_args = $args; + extract($args); $this->preSelectS($args, $request); @@ -142,5 +143,5 @@ extends WikiPlugin HTML::input(array('type' => 'text', 'name' => 's', - 'value' => $s)), + 'value' => $args['s'])), HTML::input(array('type' => 'submit', 'name' => 'WikiAdminSelect', @@ -198,5 +199,5 @@ extends WikiPlugin $this->_list = $this->collectPages($this->_list, $dbi, $args['sortby'], $args['limit']); } - $pagelist = new PageList_Selectable($info, $exclude); + $pagelist = new PageList_Selectable($info, $exclude, $args); $pagelist->addPageList($this->_list); $form->pushContent($pagelist->getContent()); @@ -249,4 +250,14 @@ extends WikiPlugin // $Log$ +// Revision 1.19 2004年06月29日 08:52:24 rurban +// Use ...version() $need_content argument in WikiDB also: +// To reduce the memory footprint for larger sets of pagelists, +// we don't cache the content (only true or false) and +// we purge the pagedata (_cached_html) also. +// _cached_html is only cached for the current pagename. +// => Vastly improved page existance check, ACL check, ... +// +// Now only PagedList info=content or size needs the whole content, esp. if sortable. +// // Revision 1.18 2004年06月16日 10:38:59 rurban // Disallow refernces in calls if the declaration is a reference
Update of /cvsroot/phpwiki/phpwiki/lib/WikiDB/backend In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27639/WikiDB/backend Modified Files: PearDB.php Log Message: Use ...version() $need_content argument in WikiDB also: To reduce the memory footprint for larger sets of pagelists, we don't cache the content (only true or false) and we purge the pagedata (_cached_html) also. _cached_html is only cached for the current pagename. => Vastly improved page existance check, ACL check, ... Now only PagedList info=content or size needs the whole content, esp. if sortable. Index: PearDB.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/WikiDB/backend/PearDB.php,v retrieving revision 1.53 retrieving revision 1.54 diff -u -2 -b -p -d -r1.53 -r1.54 --- PearDB.php 27 Jun 2004 10:26:03 -0000 1.53 +++ PearDB.php 29 Jun 2004 08:52:24 -0000 1.54 @@ -128,6 +128,10 @@ extends WikiDB_backend function _extract_page_data(&$query_result) { extract($query_result); - if (isset($query_result['pagedata'])) + if (isset($query_result['pagedata'])) { $data = $this->_unserialize($query_result['pagedata']); + // Memory optimization: + // Only store the cached_html for the current pagename + // Do it here or unset it in the Cache? + } $data['hits'] = $query_result['hits']; return $data; @@ -1009,4 +1013,14 @@ extends WikiDB_backend_PearDB_generic_it } // $Log$ +// Revision 1.54 2004年06月29日 08:52:24 rurban +// Use ...version() $need_content argument in WikiDB also: +// To reduce the memory footprint for larger sets of pagelists, +// we don't cache the content (only true or false) and +// we purge the pagedata (_cached_html) also. +// _cached_html is only cached for the current pagename. +// => Vastly improved page existance check, ACL check, ... +// +// Now only PagedList info=content or size needs the whole content, esp. if sortable. +// // Revision 1.53 2004年06月27日 10:26:03 rurban // oci8 patch by Philippe Vanhaesendonck + some ADODB notes+fixes
Update of /cvsroot/phpwiki/phpwiki/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27043 Modified Files: PageList.php Log Message: Memory optimization (reference to parent, smart bool %content) Fixed class grouping in table Index: PageList.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/PageList.php,v retrieving revision 1.95 retrieving revision 1.96 diff -u -2 -b -p -d -r1.95 -r1.96 --- PageList.php 28 Jun 2004 19:00:01 -0000 1.95 +++ PageList.php 29 Jun 2004 08:47:42 -0000 1.96 @@ -216,5 +216,6 @@ class _PageList_Column extends _PageList if ($this->_need_rev) { if (!$revision_handle) - $revision_handle = $page_handle->getCurrentRevision(); + // columns which need the %content should override this. (size, hi_content) + $revision_handle = $page_handle->getCurrentRevision(false); return $revision_handle->get($this->_field); } @@ -243,6 +244,7 @@ class _PageList_Column_custom extends _P class _PageList_Column_size extends _PageList_Column { function _getValue ($page_handle, &$revision_handle) { - if (!$revision_handle) - $revision_handle = $page_handle->getCurrentRevision(); + if (!$revision_handle or (!$revision_handle->_data['%content'] + or $revision_handle->_data['%content'] === true)) + $revision_handle = $page_handle->getCurrentRevision(true); return $this->_getSize($revision_handle); } @@ -250,5 +252,5 @@ class _PageList_Column_size extends _Pag function _getSortableValue ($page_handle, &$revision_handle) { if (!$revision_handle) - $revision_handle = $page_handle->getCurrentRevision(); + $revision_handle = $page_handle->getCurrentRevision(true); return (empty($revision_handle->_data['%content'])) ? 0 : strlen($revision_handle->_data['%content']); @@ -257,4 +259,5 @@ class _PageList_Column_size extends _Pag function _getSize($revision_handle) { $bytes = @strlen($revision_handle->_data['%content']); + //unset($revision_handle->_data['%content']); return ByteFormatter($bytes); } @@ -354,6 +357,7 @@ class _PageList_Column_content extends _ } function _getValue ($page_handle, &$revision_handle) { - if (!$revision_handle) - $revision_handle = $page_handle->getCurrentRevision(); + if (!$revision_handle or (!$revision_handle->_data['%content'] + or $revision_handle->_data['%content'] === true)) + $revision_handle = $page_handle->getCurrentRevision(true); // Not sure why implode is needed here, I thought // getContent() already did this, but it seems necessary. @@ -469,14 +473,14 @@ class _PageList_Page { var $_page; - function _PageList_Page($pagelist, $page_handle) { + function _PageList_Page(&$pagelist, &$page_handle) { $this->_pagelist = $pagelist; $this->_page = $page_handle; } - function getPageList() { + function & getPageList() { return $this->_pagelist; } - function getPage() { + function & getPage() { return $this->_page; } @@ -566,5 +570,5 @@ class PageList { // for the sort buttons in <th> - 'sortby' => 'pagename', // same as for WikiDB::getAllPages + 'sortby' => '', // same as for WikiDB::getAllPages (unsorted is faster) //PageList pager options: @@ -624,5 +628,5 @@ class PageList { * it in a table or list row. */ - function _renderPageRow ($pagelist_page) { + function _renderPageRow ($pagelist_page, $i = 0) { $page_handle = $pagelist_page->getPage(); @@ -641,5 +645,5 @@ class PageList { return; - $group = (int)($this->getTotal() / $this->_group_rows); + $group = (int)($i / $this->_group_rows); $class = ($group % 2) ? 'oddrow' : 'evenrow'; $revision_handle = false; @@ -1004,5 +1008,5 @@ class PageList { **/ function _pageCompare($a, $b) { - $pagelist = $a->getPageList(); + $pagelist =& $a->_pagelist; $pagea = $a->getPage(); $pageb = $b->getPage(); @@ -1065,9 +1069,9 @@ class PageList { // make a table given the caption function _generateTable($caption) { - $this->_sortPages(); + if (count($this->_sortby) > 0) $this->_sortPages(); - $rows = array(); + $rows = array(); $i = 0; foreach ($this->_pages as $pagenum => $page) { - $rows[] = $this->_renderPageRow($page); + $rows[] = $this->_renderPageRow($page, $i++); } @@ -1232,5 +1236,5 @@ extends PageList { $columns = array('checkbox','pagename'); } - PageList::PageList($columns, $exclude, $options); + $this->PageList($columns, $exclude, $options); } @@ -1248,4 +1252,8 @@ extends PageList { // $Log$ +// Revision 1.96 2004年06月29日 08:47:42 rurban +// Memory optimization (reference to parent, smart bool %content) +// Fixed class grouping in table +// // Revision 1.95 2004年06月28日 19:00:01 rurban // removed non-portable LIMIT 1 (it's getOne anyway)
Update of /cvsroot/phpwiki/phpwiki/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5154/lib Modified Files: IniConfig.php WikiGroup.php WikiUserNew.php stdlib.php Log Message: Improve LDAP auth and GROUP_LDAP membership: no error message on false password, added two new config vars: LDAP_OU_USERS and LDAP_OU_GROUP with GROUP_METHOD=LDAP fixed two group queries (this -> user) stdlib: ConvertOldMarkup still flawed Index: IniConfig.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/IniConfig.php,v retrieving revision 1.42 retrieving revision 1.43 diff -u -2 -b -p -d -r1.42 -r1.43 --- IniConfig.php 28 Jun 2004 15:01:07 -0000 1.42 +++ IniConfig.php 29 Jun 2004 06:48:02 -0000 1.43 @@ -93,5 +93,6 @@ function IniConfig($file) { 'DEBUG', 'TEMP_DIR', 'LDAP_AUTH_HOST','LDAP_SET_OPTION','LDAP_BASE_DN', 'LDAP_AUTH_USER', - 'LDAP_AUTH_PASSWORD','LDAP_SEARCH_FIELD','AUTH_USER_FILE','DBAUTH_AUTH_DSN', + 'LDAP_AUTH_PASSWORD','LDAP_SEARCH_FIELD','LDAP_OU_GROUP','LDAP_OU_USERS', + 'AUTH_USER_FILE','DBAUTH_AUTH_DSN', 'IMAP_AUTH_HOST', 'POP3_AUTH_HOST', 'AUTH_USER_FILE', 'AUTH_GROUP_FILE', 'AUTH_SESS_USER', 'AUTH_SESS_LEVEL', @@ -610,4 +611,11 @@ function fix_configs() { // $Log$ +// Revision 1.43 2004年06月29日 06:48:02 rurban +// Improve LDAP auth and GROUP_LDAP membership: +// no error message on false password, +// added two new config vars: LDAP_OU_USERS and LDAP_OU_GROUP with GROUP_METHOD=LDAP +// fixed two group queries (this -> user) +// stdlib: ConvertOldMarkup still flawed +// // Revision 1.42 2004年06月28日 15:01:07 rurban // fixed LDAP_SET_OPTION handling, LDAP error on connection problem Index: WikiGroup.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/WikiGroup.php,v retrieving revision 1.39 retrieving revision 1.40 diff -u -2 -b -p -d -r1.39 -r1.40 --- WikiGroup.php 28 Jun 2004 15:39:28 -0000 1.39 +++ WikiGroup.php 29 Jun 2004 06:48:02 -0000 1.40 @@ -195,6 +195,6 @@ class WikiGroup{ return $this->membership[$group] = ! $user->isSignedIn(); case GROUP_BOGOUSER: - return $this->membership[$group] = (isa($user,'_BogoUser') and - $user->_level >= WIKIAUTH_BOGO); + return $this->membership[$group] = (isa($user,'_BogoUser') + and $user->_level >= WIKIAUTH_BOGO); case GROUP_SIGNED: return $this->membership[$group] = $user->isSignedIn(); @@ -202,5 +202,6 @@ class WikiGroup{ return $this->membership[$group] = $user->isAuthenticated(); case GROUP_ADMIN: - return $this->membership[$group] = $this->_level == WIKIAUTH_ADMIN; + return $this->membership[$group] = (isset($user->_level) + and $user->_level == WIKIAUTH_ADMIN); default: trigger_error(__sprintf("Undefined method %s for special group %s", @@ -331,5 +332,6 @@ class WikiGroup{ foreach ($all as $u) { $user = WikiUser($u); - if ($this->_level == WIKIAUTH_ADMIN) $users[] = $u; + if (isset($user->_level) and $user->_level == WIKIAUTH_ADMIN) + $users[] = $u; } return $users; @@ -943,9 +945,13 @@ class GroupLdap extends WikiGroup { define("LDAP_BASE_DN",''); $this->base_dn = LDAP_BASE_DN; + // if no users ou (organizational unit) is defined, + // then take out the ou= from the base_dn (if exists) and append a default + // from users and group + if (!LDAP_OU_USERS) if (strstr("ou=",LDAP_BASE_DN)) $this->base_dn = preg_replace("/(ou=\w+,)?()/","\2ドル", LDAP_BASE_DN); if (!isset($this->user) or !isa($this->user,'_LDAPPassUser')) - $this->_user = new _LDAPPassUser('LdapBogo'); + $this->_user = new _LDAPPassUser('LdapGroupTest'); // to have a valid username else $this->_user =& $this->user; @@ -993,8 +999,9 @@ class GroupLdap extends WikiGroup { // must be a valid LDAP server, and username must not contain a wildcard if ($ldap = $this->_user->_init()) { - $st_search = defined('LDAP_SEARCH_FIELD') - ? LDAP_SEARCH_FIELD."=".$this->username + $st_search = LDAP_SEARCH_FIELD ? LDAP_SEARCH_FIELD."=".$this->username : "uid=".$this->username; - $sr = ldap_search($ldap, "ou=Users".($this->base_dn ? ",".$this->base_dn : ''), $st_search); + $sr = ldap_search($ldap, (LDAP_OU_USERS ? LDAP_OU_USERS : "ou=Users") + .($this->base_dn ? ",".$this->base_dn : ''), + $st_search); if (!$sr) { $this->_user->_free(); @@ -1007,7 +1014,9 @@ class GroupLdap extends WikiGroup { } for ($i = 0; $i < $info["count"]; $i++) { - if ($info[$i]["gidnumber"]["count"]) { + if ($info[$i]["gidNumber"]["count"]) { $gid = $info[$i]["gidnumber"][0]; - $sr2 = ldap_search($ldap, "ou=Groups".($this->base_dn ? ",".$this->base_dn : ''),"gidNumber=$gid"); + $sr2 = ldap_search($ldap, (LDAP_OU_GROUP ? LDAP_OU_GROUP : "ou=Groups") + .($this->base_dn ? ",".$this->base_dn : ''), + "gidNumber=$gid"); if ($sr2) { $info2 = ldap_get_entries($ldap, $sr2); @@ -1037,19 +1046,27 @@ class GroupLdap extends WikiGroup { $members = array(); if ($ldap = $this->_user->_init()) { - $sr = ldap_search($ldap, "ou=Groups,".$this->base_dn,"cn=$group"); + $base_dn = (LDAP_OU_GROUP ? LDAP_OU_GROUP : "ou=Groups") + .($this->base_dn ? ",".$this->base_dn : ''); + $sr2 = ldap_search($ldap, $base_dn, "cn=$group"); if ($sr) $info = ldap_get_entries($ldap, $sr); else { $info = array('count' => 0); - trigger_error("LDAP_SEARCH: base=\"ou=Groups,".$this->base_dn."\" \"(cn=$group)\" failed", E_USER_NOTICE); + trigger_error("LDAP_SEARCH: base=\"$base_dn\" \"(cn=$group)\" failed", E_USER_NOTICE); } + $base_dn = (LDAP_OU_USERS ? LDAP_OU_USERS : "ou=Users") + .($this->base_dn ? ",".$this->base_dn : ''); for ($i = 0; $i < $info["count"]; $i++) { - $gid = $info[$i]["gidnumber"][0]; + $gid = $info[$i]["gidNumber"][0]; //uid=* would be better probably - $sr2 = ldap_search($ldap, "ou=Users,".$this->base_dn,"gidNumber=$gid"); + $sr2 = ldap_search($ldap, $base_dn, "gidNumber=$gid"); + if ($sr2) { $info2 = ldap_get_entries($ldap, $sr2); for ($j = 0; $j < $info2["count"]; $j++) { $members[] = $info2[$j]["cn"][0]; } + } else { + trigger_error("LDAP_SEARCH: base=\"$base_dn\" \"(gidNumber=$gid)\" failed", E_USER_NOTICE); + } } } @@ -1065,4 +1082,11 @@ class GroupLdap extends WikiGroup { // $Log$ +// Revision 1.40 2004年06月29日 06:48:02 rurban +// Improve LDAP auth and GROUP_LDAP membership: +// no error message on false password, +// added two new config vars: LDAP_OU_USERS and LDAP_OU_GROUP with GROUP_METHOD=LDAP +// fixed two group queries (this -> user) +// stdlib: ConvertOldMarkup still flawed +// // Revision 1.39 2004年06月28日 15:39:28 rurban // fixed endless recursion in WikiGroup: isAdmin() Index: WikiUserNew.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/WikiUserNew.php,v retrieving revision 1.104 retrieving revision 1.105 diff -u -2 -b -p -d -r1.104 -r1.105 --- WikiUserNew.php 28 Jun 2004 15:39:37 -0000 1.104 +++ WikiUserNew.php 29 Jun 2004 06:48:03 -0000 1.105 @@ -2081,10 +2081,13 @@ extends _PassUser return $this->_tryNextPass($submitted_password); } - // there may be more hits with this userid. - // of course it would be better to narrow down the BASE_DN + // There may be more hits with this userid. + // Of course it would be better to narrow down the BASE_DN for ($i = 0; $i < $info["count"]; $i++) { $dn = $info[$i]["dn"]; // The password is still plain text. - if ($r = ldap_bind($ldap, $dn, $submitted_password)) { + // On wrong password the ldap server will return: + // "Unable to bind to server: Server is unwilling to perform" + // The @ catches this error message. + if ($r = @ldap_bind($ldap, $dn, $submitted_password)) { // ldap_bind will return TRUE if everything matches $this->_free(); @@ -3041,4 +3044,11 @@ extends UserPreferences // $Log$ +// Revision 1.105 2004年06月29日 06:48:03 rurban +// Improve LDAP auth and GROUP_LDAP membership: +// no error message on false password, +// added two new config vars: LDAP_OU_USERS and LDAP_OU_GROUP with GROUP_METHOD=LDAP +// fixed two group queries (this -> user) +// stdlib: ConvertOldMarkup still flawed +// // Revision 1.104 2004年06月28日 15:39:37 rurban // fixed endless recursion in WikiGroup: isAdmin() Index: stdlib.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/stdlib.php,v retrieving revision 1.193 retrieving revision 1.194 diff -u -2 -b -p -d -r1.193 -r1.194 --- stdlib.php 28 Jun 2004 13:27:03 -0000 1.193 +++ stdlib.php 29 Jun 2004 06:48:04 -0000 1.194 @@ -666,6 +666,6 @@ function ConvertOldMarkup ($text, $marku // change ! escapes to ~'s. global $WikiNameRegexp, $request; - $map = getInterwikiMap(); $bang_esc[] = "(?:" . ALLOWED_PROTOCOLS . "):[^\s<>\[\]\"'()]*[^\s<>\[\]\"'(),.?]"; + $map = getInterwikiMap(); $bang_esc[] = $map->getRegexp() . ":[^\\s.,;?()]+"; // FIXME: is this really needed? $bang_esc[] = $WikiNameRegexp; @@ -1616,4 +1616,11 @@ function url_get_contents( $uri ) { // $Log$ +// Revision 1.194 2004年06月29日 06:48:04 rurban +// Improve LDAP auth and GROUP_LDAP membership: +// no error message on false password, +// added two new config vars: LDAP_OU_USERS and LDAP_OU_GROUP with GROUP_METHOD=LDAP +// fixed two group queries (this -> user) +// stdlib: ConvertOldMarkup still flawed +// // Revision 1.193 2004年06月28日 13:27:03 rurban // CreateToc disabled for old markup and Apache2 only
Update of /cvsroot/phpwiki/phpwiki/config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5154/config Modified Files: config-dist.ini Log Message: Improve LDAP auth and GROUP_LDAP membership: no error message on false password, added two new config vars: LDAP_OU_USERS and LDAP_OU_GROUP with GROUP_METHOD=LDAP fixed two group queries (this -> user) stdlib: ConvertOldMarkup still flawed Index: config-dist.ini =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/config/config-dist.ini,v retrieving revision 1.19 retrieving revision 1.20 diff -u -2 -b -p -d -r1.19 -r1.20 --- config-dist.ini 22 Jun 2004 07:05:16 -0000 1.19 +++ config-dist.ini 29 Jun 2004 06:48:00 -0000 1.20 @@ -451,4 +451,5 @@ USER_AUTH_POLICY = stacked ; ; Note: ou=Users and ou=Groups are used for GroupLdap Membership +; Better use LDAP_OU_USERS and LDAP_OU_GROUP with GROUP_METHOD=LDAP. ;LDAP_BASE_DN = "ou=Users,o=Development,dc=mycompany.com" @@ -458,15 +459,28 @@ USER_AUTH_POLICY = stacked ; LDAP_SET_OPTION = "LDAP_OPT_PROTOCOL_VERSION=3:LDAP_OPT_REFERRALS=0" -; DN to bind to the LDAP server as. -; LDAP_AUTH_USER = "CN=ldapuser,CN=Users,DC=uai,DC=int" +; DN to initially bind to the LDAP server as. This is needed if the server doesn't +; allow anonymous queries. (Windows Active Directory Server) +; LDAP_AUTH_USER = "CN=ldapuser,ou=Users,o=Development,dc=mycompany.com" -; Password to use to bind to the LDAP server, as the DN specified in -; the LDAP_AUTH_USER option (above). +; Password to use to initially bind to the LDAP server, as the DN +; specified in the LDAP_AUTH_USER option (above). ; LDAP_AUTH_PASSWORD = secret ; If you want to match usernames against an attribute other than uid, -; specify it here. +; specify it here. Default: uid ; LDAP_SEARCH_FIELD = sAMAccountName +; If you have an organizational unit for all users, define it here. +; This narrows the search, and is needed for LDAP group membership (if GROUP_METHOD=LDAP) +; Default: ou=Users +; LDAP_OU_USERS = ou=Users + +; If you have an organizational unit for all groups, define it here. +; This narrows the search, and is needed for LDAP group membership (if GROUP_METHOD=LDAP) +; The entries in this ou must have a gidNumber and cn attribute. +; Default: ou=Groups +; LDAP_OU_GROUP = ou=Groups + + ; IMAP authentication options: ;
Update of /cvsroot/phpwiki/phpwiki/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11669 Modified Files: PageList.php Log Message: removed non-portable LIMIT 1 (it's getOne anyway) removed size from info=most: needs to much memory Index: PageList.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/PageList.php,v retrieving revision 1.94 retrieving revision 1.95 diff -u -2 -b -p -d -r1.94 -r1.95 --- PageList.php 27 Jun 2004 10:26:02 -0000 1.94 +++ PageList.php 28 Jun 2004 19:00:01 -0000 1.95 @@ -512,5 +512,5 @@ class PageList { array('checkbox','remove','renamed_pagename', 'content','hi_content','perm','acl')), - 'most' => array('pagename','mtime','author','size','hits'), + 'most' => array('pagename','mtime','author','hits'), 'some' => array('pagename','mtime','author') ); @@ -678,10 +678,10 @@ class PageList { if ($DBParams['dbtype'] == 'SQL') { //FIXME: LIMIT not portable - $res = $dbi->_backend->_dbh->getOne("SELECT max(length(pagename)) FROM $page_tbl LIMIT 1"); + $res = $dbi->_backend->_dbh->getOne("SELECT max(length(pagename)) FROM $page_tbl"); if (DB::isError($res) || empty($res)) return false; else return $res; } elseif ($DBParams['dbtype'] == 'ADODB') { //FIXME: LIMIT not portable - $row = $dbi->_backend->_dbh->getRow("SELECT max(length(pagename)) FROM $page_tbl LIMIT 1"); + $row = $dbi->_backend->_dbh->getRow("SELECT max(length(pagename)) FROM $page_tbl"); return $row ? $row[0] : false; } @@ -1248,4 +1248,8 @@ extends PageList { // $Log$ +// Revision 1.95 2004年06月28日 19:00:01 rurban +// removed non-portable LIMIT 1 (it's getOne anyway) +// removed size from info=most: needs to much memory +// // Revision 1.94 2004年06月27日 10:26:02 rurban // oci8 patch by Philippe Vanhaesendonck + some ADODB notes+fixes
Update of /cvsroot/phpwiki/phpwiki/lib/plugin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11556/plugin Modified Files: ListPages.php Log Message: fixed another pass-by-reference Index: ListPages.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/plugin/ListPages.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -2 -b -p -d -r1.2 -r1.3 --- ListPages.php 18 Jun 2004 14:42:17 -0000 1.2 +++ ListPages.php 28 Jun 2004 18:58:18 -0000 1.3 @@ -88,5 +88,5 @@ extends WikiPlugin $user = new RatingsUser($userid); if ($user->allow_view_ratings($active_user)) { - array_push($allowed_users, &$user); + array_push($allowed_users, $user); } // PHP's silly references... (the behavior with this line commented @@ -125,4 +125,7 @@ extends WikiPlugin // $Log$ +// Revision 1.3 2004年06月28日 18:58:18 rurban +// fixed another pass-by-reference +// // Revision 1.2 2004年06月18日 14:42:17 rurban // added wikilens libs (not yet merged good enough, some work for DanFr)