[MediaWiki-CVS] SVN: [49222] trunk/phase3/includes/specials/SpecialBlockip.php
Revision: 49222 Author: aaron Date: 2009-04-05 19:17:54 + (Sun, 05 Apr 2009) Log Message: --- (bug 18346) Automatically hide RC log items on block too Modified Paths: -- trunk/phase3/includes/specials/SpecialBlockip.php Modified: trunk/phase3/includes/specials/SpecialBlockip.php === --- trunk/phase3/includes/specials/SpecialBlockip.php 2009-04-05 19:07:47 UTC (rev 49221) +++ trunk/phase3/includes/specials/SpecialBlockip.php 2009-04-05 19:17:54 UTC (rev 49222) @@ -526,6 +526,8 @@ # Hide name from RC $dbw->update( 'recentchanges', array("rc_deleted = rc_deleted $op $delUser"), array('rc_user_text' => $name), __METHOD__ ); + $dbw->update( 'recentchanges', array("rc_deleted = rc_deleted $op $delAction"), + array('rc_namespace' => NS_USER, 'rc_title' => $userDbKey, 'rc_logid > 0'), __METHOD__ ); # Hide name from live images $dbw->update( 'oldimage', array("oi_deleted = oi_deleted $op $delUser"), array('oi_user_text' => $name), __METHOD__ ); ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [49223] trunk/phase3/includes/specials/SpecialRevisiondelete.php
Revision: 49223 Author: aaron Date: 2009-04-05 19:42:00 + (Sun, 05 Apr 2009) Log Message: --- * Removed unused par * Style tweaks Modified Paths: -- trunk/phase3/includes/specials/SpecialRevisiondelete.php Modified: trunk/phase3/includes/specials/SpecialRevisiondelete.php === --- trunk/phase3/includes/specials/SpecialRevisiondelete.php2009-04-05 19:17:54 UTC (rev 49222) +++ trunk/phase3/includes/specials/SpecialRevisiondelete.php2009-04-05 19:42:00 UTC (rev 49223) @@ -1190,10 +1190,9 @@ } list($log,$logtype) = explode( '/',$title->getDBKey(), 2 ); $result = $this->dbw->select( 'logging', '*', - array( - 'log_type' => $logtype, - 'log_id' => $where ), - __METHOD__ ); + array( 'log_type' => $logtype, 'log_id' => $where ), + __METHOD__ + ); while( $row = $this->dbw->fetchObject( $result ) ) { $logRows[$row->log_id] = $row; } @@ -1203,18 +1202,17 @@ $success = false; continue; // Must exist } else if( !LogEventsList::userCan($logRows[$logid], LogPage::DELETED_RESTRICTED) -|| $logRows[$logid]->log_type == 'suppress' ) { - // Don't hide from oversight log!!! - $userAllowedAll=false; + || $logRows[$logid]->log_type == 'suppress' ) + { + $userAllowedAll=false; // Don't hide from oversight log!!! continue; } // Which logs did we change anything about? if( $logRows[$logid]->log_deleted != $bitfield ) { - $log_Ids[]=$logid; - $count++; - + $log_Ids[] = $logid; $this->updateLogs( $logRows[$logid], $bitfield ); - $this->updateRecentChangesLog( $logRows[$logid], $bitfield, true ); + $this->updateRecentChangesLog( $logRows[$logid], $bitfield ); + $count++; } } // Don't log or touch if nothing changed ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [49226] trunk/phase3
Revision: 49226 Author: aaron Date: 2009-04-06 01:43:38 + (Mon, 06 Apr 2009) Log Message: --- * (bug 17543) Allow partial hiding of top revision * Fixed isCurrent() check * Cleaned up/fixed some UI code duplication Modified Paths: -- trunk/phase3/includes/PageHistory.php trunk/phase3/includes/specials/SpecialRevisiondelete.php trunk/phase3/languages/messages/MessagesEn.php trunk/phase3/maintenance/language/messages.inc Modified: trunk/phase3/includes/PageHistory.php === --- trunk/phase3/includes/PageHistory.php 2009-04-05 20:18:02 UTC (rev 49225) +++ trunk/phase3/includes/PageHistory.php 2009-04-06 01:43:38 UTC (rev 49226) @@ -268,11 +268,7 @@ $s = "($curlink) ($lastlink) $arbitrary"; if( $wgUser->isAllowed( 'deleterevision' ) ) { - if( $latest ) { - // We don't currently handle well changing the top revision's settings - $del = Xml::tags( 'span', array( 'class'=>'mw-revdelundel-link' ), '('. - $this->message['rev-delundel'].')' ); - } else if( !$rev->userCan( Revision::DELETED_RESTRICTED ) ) { + if( !$rev->userCan( Revision::DELETED_RESTRICTED ) ) { // If revision was hidden from sysops $del = Xml::tags( 'span', array( 'class'=>'mw-revdelundel-link' ), '('. $this->message['rev-delundel'].')' ); Modified: trunk/phase3/includes/specials/SpecialRevisiondelete.php === --- trunk/phase3/includes/specials/SpecialRevisiondelete.php2009-04-05 20:18:02 UTC (rev 49225) +++ trunk/phase3/includes/specials/SpecialRevisiondelete.php2009-04-06 01:43:38 UTC (rev 49226) @@ -267,11 +267,9 @@ $revObjs[$row->rev_id] = new Revision( $row ); } foreach( $this->revisions as $revid ) { - // Hiding top revisison is bad - if( !isset($revObjs[$revid]) || $revObjs[$revid]->isCurrent() ) { - continue; - } else if( !$revObjs[$revid]->userCan(Revision::DELETED_RESTRICTED) ) { - // If a rev is hidden from sysops + if( !isset($revObjs[$revid]) ) continue; // Must exist + // Check if the revision was Oversighted + if( !$revObjs[$revid]->userCan(Revision::DELETED_RESTRICTED) ) { if( !$this->wasPosted ) { $wgOut->permissionRequired( 'suppressrevision' ); return; @@ -812,31 +810,26 @@ $wgOut->permissionRequired( 'suppressrevision' ); return false; } - # If the save went through, go to success message. Otherwise - # bounce back to form... + # If the save went through, go to success message... if( $this->save( $bitfield, $comment, $this->page ) ) { $this->success(); - } else if( $request->getCheck( 'oldid' ) || $request->getCheck( 'artimestamp' ) ) { - return $this->showRevs(); - } else if( $request->getCheck( 'logid' ) ) { - return $this->showLogs(); - } else if( $request->getCheck( 'oldimage' ) || $request->getCheck( 'fileid' ) ) { - return $this->showImages(); + return true; + # ...otherwise, bounce back to form... + } else { + $this->failure(); } + return false; } private function success() { global $wgOut; - $wgOut->setPagetitle( wfMsg( 'actioncomplete' ) ); - $wrap = '$1'; - if( $this->deleteKey == 'logid' ) { $wgOut->wrapWikiMsg( $wrap, 'logdelete-success' ); $this->showLogItems(); } else if( $this->deleteKey == 'oldid' || $this->deleteKey == 'artimestamp' ) { -
[MediaWiki-CVS] SVN: [49227] trunk/phase3/includes/Linker.php
Revision: 49227 Author: aaron Date: 2009-04-06 01:59:42 + (Mon, 06 Apr 2009) Log Message: --- Don't show '(comment removed)' for empty comments Modified Paths: -- trunk/phase3/includes/Linker.php Modified: trunk/phase3/includes/Linker.php === --- trunk/phase3/includes/Linker.php2009-04-06 01:43:38 UTC (rev 49226) +++ trunk/phase3/includes/Linker.php2009-04-06 01:59:42 UTC (rev 49227) @@ -1385,6 +1385,7 @@ * @return string HTML */ function revComment( Revision $rev, $local = false, $isPublic = false ) { + if( $rev->getComment() == "" ) return ""; if( $rev->isDeleted( Revision::DELETED_COMMENT ) && $isPublic ) { $block = " " . wfMsgHtml( 'rev-deleted-comment' ) . ""; } else if( $rev->userCan( Revision::DELETED_COMMENT ) ) { ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [49228] trunk/phase3/includes/Article.php
Revision: 49228 Author: aaron Date: 2009-04-06 02:11:42 + (Mon, 06 Apr 2009) Log Message: --- * Made generateReason() skip deleted user names Modified Paths: -- trunk/phase3/includes/Article.php Modified: trunk/phase3/includes/Article.php === --- trunk/phase3/includes/Article.php 2009-04-06 01:59:42 UTC (rev 49227) +++ trunk/phase3/includes/Article.php 2009-04-06 02:11:42 UTC (rev 49228) @@ -2185,18 +2185,16 @@ // Find out if there was only one contributor // Only scan the last 20 revisions - $limit = 20; $res = $dbw->select( 'revision', 'rev_user_text', - array( 'rev_page' => $this->getID() ), __METHOD__, - array( 'LIMIT' => $limit ) + array( 'rev_page' => $this->getID(), 'rev_deleted & '.Revision::DELETED_USER.'=0' ), + __METHOD__, + array( 'LIMIT' => 20 ) ); if( $res === false ) // This page has no revisions, which is very weird return false; - if( $res->numRows() > 1 ) - $hasHistory = true; - else - $hasHistory = false; + + $hasHistory = ( $res->numRows() > 1 ); $row = $dbw->fetchObject( $res ); $onlyAuthor = $row->rev_user_text; // Try to find a second contributor ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [49256] trunk/phase3/includes/Article.php
Revision: 49256 Author: aaron Date: 2009-04-07 03:06:36 + (Tue, 07 Apr 2009) Log Message: --- (Bug 18330) Made pageCountInfo() public Modified Paths: -- trunk/phase3/includes/Article.php Modified: trunk/phase3/includes/Article.php === --- trunk/phase3/includes/Article.php 2009-04-06 19:55:06 UTC (rev 49255) +++ trunk/phase3/includes/Article.php 2009-04-07 03:06:36 UTC (rev 49256) @@ -3437,7 +3437,7 @@ * @param $title Title object * @return array */ - protected function pageCountInfo( $title ) { + public function pageCountInfo( $title ) { $id = $title->getArticleId(); if( $id == 0 ) { return false; ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [49301] trunk/extensions/FlaggedRevs
Revision: 49301 Author: aaron Date: 2009-04-08 04:49:11 + (Wed, 08 Apr 2009) Log Message: --- (bug 18258) Added pending edit notice to watchlist for watched pages Modified Paths: -- trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php trunk/extensions/FlaggedRevs/FlaggedRevs.php trunk/extensions/FlaggedRevs/flaggedrevs.css trunk/extensions/FlaggedRevs/language/FlaggedRevs.i18n.php Modified: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php === --- trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php 2009-04-08 01:39:35 UTC (rev 49300) +++ trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php 2009-04-08 04:49:11 UTC (rev 49301) @@ -1542,12 +1542,26 @@ $recentchanges = SpecialPage::getTitleFor( 'Recentchanges' ); if( $wgUser->isAllowed('review') && ($wgTitle->equals($watchlist) || $wgTitle->equals($recentchanges)) ) { $dbr = wfGetDB( DB_SLAVE ); - $pages = $dbr->estimateRowCount( 'page', '*', array('page_namespace' => $wgFlaggedRevsNamespaces), __METHOD__ ); - $unreviewed = $dbr->estimateRowCount( 'flaggedpages', '*', 'fp_pending_since IS NOT NULL', __METHOD__ ); - if( ($unreviewed/$pages) > .02 ) { + $watchedOutdated = $dbr->selectField( array('watchlist','page','flaggedpages'), '1', + array( 'wl_user' => $wgUser->getId(), + 'wl_namespace = page_namespace', 'wl_title = page_title', + 'fp_reviewed' => 0, 'fp_page_id = page_id' + ), __METHOD__ + ); + # Give a notice if pages on the wachlist are outdated + if( $watchedOutdated ) { wfLoadExtensionMessages( 'FlaggedRevs' ); - $notice .= "" . - wfMsgExt('flaggedrevs-backlog',array('parseinline')) . ""; + $notice .= "" . + wfMsgExt('flaggedrevs-watched-pending',array('parseinline')) . ""; + # Otherwise, give a notice if there is a large backlog in general + } else { + $pages = $dbr->estimateRowCount( 'page', '*', array('page_namespace' => $wgFlaggedRevsNamespaces), __METHOD__ ); + $unreviewed = $dbr->estimateRowCount( 'flaggedpages', '*', 'fp_pending_since IS NOT NULL', __METHOD__ ); + if( ($unreviewed/$pages) > .02 ) { + wfLoadExtensionMessages( 'FlaggedRevs' ); + $notice .= "" . + wfMsgExt('flaggedrevs-backlog',array('parseinline')) . ""; + } } } return true; Modified: trunk/extensions/FlaggedRevs/FlaggedRevs.php === --- trunk/extensions/FlaggedRevs/FlaggedRevs.php2009-04-08 01:39:35 UTC (rev 49300) +++ trunk/extensions/FlaggedRevs/FlaggedRevs.php2009-04-08 04:49:11 UTC (rev 49301) @@ -266,7 +266,7 @@ $wgAvailableRights[] = 'stablesettings'; # Bump this number every time you change flaggedrevs.css/flaggedrevs.js -$wgFlaggedRevStyleVersion = 57; +$wgFlaggedRevStyleVersion = 58; $wgExtensionFunctions[] = 'efLoadFlaggedRevs'; Modified: trunk/extensions/FlaggedRevs/flaggedrevs.css === --- trunk/extensions/FlaggedRevs/flaggedrevs.css2009-04-08 01:39:35 UTC (rev 49300) +++ trunk/extensions/FlaggedRevs/flaggedrevs.css2009-04-08 04:49:11 UTC (rev 49301) @@ -258,6 +258,12 @@ border: 1px solid #99; background-color: #f5ecec; } +.fr-watchlist-old-notice { + padding: 3px; + margin: 5px; + border: 1px solid #99; + background-color: #FEECD7; +} /* Special pages */ .fr-pending-long { Modified: trunk/extensions/FlaggedRevs/language/FlaggedRevs.i18n.php === --- trunk/extensions/FlaggedRevs/language/FlaggedRevs.i18n.php 2009-04-08 01:39:35 UTC (rev 49300) +++ trunk/extensions/FlaggedRevs/lan
[MediaWiki-CVS] SVN: [49302] trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php
Revision: 49302 Author: aaron Date: 2009-04-08 05:47:12 + (Wed, 08 Apr 2009) Log Message: --- Broke some lines, tweaked comments Modified Paths: -- trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php Modified: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php === --- trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php 2009-04-08 04:49:11 UTC (rev 49301) +++ trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php 2009-04-08 05:47:12 UTC (rev 49302) @@ -321,7 +321,9 @@ __METHOD__ ); } # Check cache before doing another DB hit... - $idP = FlaggedRevs::getTemplateIdFromCache( $parser->getRevisionId(), $title->getNamespace(), $title->getDBKey() ); + $idP = FlaggedRevs::getTemplateIdFromCache( $parser->getRevisionId(), + $title->getNamespace(), $title->getDBKey() ); + # Use the process cache key if it's newer or we have none yet if( !is_null($idP) && (!$id || $idP > $id) ) { $id = $idP; } @@ -418,7 +420,8 @@ global $wgUseCurrentImages; # If the DB found nothing... if( $time === false ) { - $parser->mOutput->fr_includeErrors[] = $title->getPrefixedDBKey(); // May want to give an error + # May want to give an error, so track these... + $parser->mOutput->fr_includeErrors[] = $title->getPrefixedDBKey(); if( !$wgUseCurrentImages ) { $time = "0"; // no image } else { @@ -503,7 +506,8 @@ global $wgUseCurrentImages; # If the DB found nothing... if( $time === false ) { - $ig->mParser->mOutput->fr_includeErrors[] = $nt->getPrefixedDBKey(); // May want to give an error + # May want to give an error, so track these... + $ig->mParser->mOutput->fr_includeErrors[] = $nt->getPrefixedDBKey(); if( !$wgUseCurrentImages ) { $time = "0"; // no image } else { ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [49319] USERINFO/aaron
Revision: 49319 Author: aaron Date: 2009-04-08 17:44:42 + (Wed, 08 Apr 2009) Log Message: --- update Modified Paths: -- USERINFO/aaron Modified: USERINFO/aaron === --- USERINFO/aaron 2009-04-08 16:50:43 UTC (rev 49318) +++ USERINFO/aaron 2009-04-08 17:44:42 UTC (rev 49319) @@ -1,3 +1,2 @@ name: Aaron Schulz -email: jschulz_4...@msn.com -url: http://www.mediawiki.org/wiki/User:Voice_of_All +url: http://www.mediawiki.org/wiki/User:Aaron_Schulz ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [49323] trunk/extensions/CodeReview/CodeReleaseNotes.php
Revision: 49323 Author: aaron Date: 2009-04-08 21:05:04 + (Wed, 08 Apr 2009) Log Message: --- (bug 18167) Code Review page should not render magic words etc. Modified Paths: -- trunk/extensions/CodeReview/CodeReleaseNotes.php Modified: trunk/extensions/CodeReview/CodeReleaseNotes.php === --- trunk/extensions/CodeReview/CodeReleaseNotes.php2009-04-08 20:01:41 UTC (rev 49322) +++ trunk/extensions/CodeReview/CodeReleaseNotes.php2009-04-08 21:05:04 UTC (rev 49323) @@ -55,7 +55,7 @@ protected function showReleaseNotes() { global $wgOut; - $linker = new CodeCommentLinkerWiki( $this->mRepo ); + $linker = new CodeCommentLinkerHtml( $this->mRepo ); $dbr = wfGetDB( DB_SLAVE ); if ( $this->mEndRev ) { $where = 'cr_id BETWEEN ' . intval( $this->mStartRev ) . ' AND ' . intval( $this->mEndRev ); @@ -93,9 +93,10 @@ if ( $summary ) { $summary = str_replace( "\n", "", $summary ); // Newlines -> $wgOut->addHTML( "" ); - $wikiText = $linker->link( $summary ) . " ''(" . htmlspecialchars( $row->cr_author ) . - ', ' . $linker->link( "r{$row->cr_id}" ) . ")''"; - $wgOut->addWikiText( $wikiText, false ); + $wgOut->addHTML( + $linker->link( $summary ) . " (" . htmlspecialchars( $row->cr_author ) . + ', ' . $linker->link( "r{$row->cr_id}" ) . ")" + ); $wgOut->addHTML( "\n" ); } } ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [49349] trunk/phase3/includes/specials/SpecialContributions.php
Revision: 49349 Author: aaron Date: 2009-04-09 19:05:38 + (Thu, 09 Apr 2009) Log Message: --- Preserve default limit on submit Modified Paths: -- trunk/phase3/includes/specials/SpecialContributions.php Modified: trunk/phase3/includes/specials/SpecialContributions.php === --- trunk/phase3/includes/specials/SpecialContributions.php 2009-04-09 18:54:15 UTC (rev 49348) +++ trunk/phase3/includes/specials/SpecialContributions.php 2009-04-09 19:05:38 UTC (rev 49349) @@ -39,7 +39,7 @@ return; } - $this->opts['limit'] = $wgRequest->getInt( 'limit', 50 ); + $this->opts['limit'] = $wgRequest->getInt( 'limit', $wgUser->getOption('rclimit') ); $this->opts['target'] = $target; $nt = Title::makeTitleSafe( NS_USER, $target ); ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [49378] trunk/phase3/includes
Revision: 49378 Author: aaron Date: 2009-04-10 20:01:10 + (Fri, 10 Apr 2009) Log Message: --- (bug 18361) Suppression log should be in the UI language, not content language Modified Paths: -- trunk/phase3/includes/LogEventsList.php trunk/phase3/includes/LogPage.php trunk/phase3/includes/specials/SpecialRevisiondelete.php Modified: trunk/phase3/includes/LogEventsList.php === --- trunk/phase3/includes/LogEventsList.php 2009-04-10 18:51:48 UTC (rev 49377) +++ trunk/phase3/includes/LogEventsList.php 2009-04-10 20:01:10 UTC (rev 49378) @@ -282,7 +282,7 @@ 'mergepoint' => $paramArray[1] ) ) ) . ')'; // If an edit was hidden from a page give a review link to the history } else if( self::typeAction($row,array('delete','suppress'),'revision','deleterevision') ) { - if( count($paramArray) == 2 ) { + if( count($paramArray) >= 2 ) { $revdel = SpecialPage::getTitleFor( 'Revisiondelete' ); // Different revision types use different URL params... $key = $paramArray[0]; @@ -304,7 +304,7 @@ } // Hidden log items, give review link } else if( self::typeAction($row,array('delete','suppress'),'event','deleterevision') ) { - if( count($paramArray) == 1 ) { + if( count($paramArray) >= 1 ) { $revdel = SpecialPage::getTitleFor( 'Revisiondelete' ); // $paramArray[1] is a CVS of the IDs $Ids = explode( ',', $paramArray[0] ); Modified: trunk/phase3/includes/LogPage.php === --- trunk/phase3/includes/LogPage.php 2009-04-10 18:51:48 UTC (rev 49377) +++ trunk/phase3/includes/LogPage.php 2009-04-10 20:01:10 UTC (rev 49378) @@ -201,6 +201,7 @@ } else { $details = ''; array_unshift( $params, $titleLink ); + // User suppression if ( preg_match( '/^(block|suppress)\/(block|reblock)$/', $key ) ) { if ( $skin ) { $params[1] = '' . @@ -210,6 +211,7 @@ } $params[2] = isset( $params[2] ) ? self::formatBlockFlags( $params[2], is_null( $skin ) ) : ''; + // Page protections } else if ( $type == 'protect' && count($params) == 3 ) { $details .= " {$params[1]}"; // restrictions and expiries if( $params[2] ) { @@ -219,6 +221,7 @@ $details .= ' ['.wfMsgForContent('protect-summary-cascade').']'; } } + // Page moves } else if ( $type == 'move' && count( $params ) == 3 ) { if( $params[2] ) { if ( $skin ) { @@ -227,6 +230,18 @@ $details .= ' [' . wfMsgForContent( 'move-redirect-suppressed' ) . ']'; } } + // Revision deletion + } else if ( preg_match( '/^(delete|suppress)\/revision$/', $key ) && count( $params ) == 5 ) { + $count = substr_count( $params[1], ',' ) + 1; // revisions + $ofield = intval( substr( $params[3], 7 ) ); // + $nfield = intval( substr( $params[4], 7 ) ); // + $details .= ': '.RevisionDeleter::getLogMessage( $count,
[MediaWiki-CVS] SVN: [49379] trunk/phase3/includes/specials/SpecialRevisiondelete.php
Revision: 49379 Author: aaron Date: 2009-04-10 20:38:17 + (Fri, 10 Apr 2009) Log Message: --- minor style tweaks Modified Paths: -- trunk/phase3/includes/specials/SpecialRevisiondelete.php Modified: trunk/phase3/includes/specials/SpecialRevisiondelete.php === --- trunk/phase3/includes/specials/SpecialRevisiondelete.php2009-04-10 20:01:10 UTC (rev 49378) +++ trunk/phase3/includes/specials/SpecialRevisiondelete.php2009-04-10 20:38:17 UTC (rev 49379) @@ -41,12 +41,10 @@ + (bool)$this->artimestamps + (bool)$this->fileids + (bool)$this->oldimgs; # No targets? if( $types == 0 ) { - $wgOut->showErrorPage( 'revdelete-nooldid-title', 'revdelete-nooldid-text' ); - return; + return $wgOut->showErrorPage( 'revdelete-nooldid-title', 'revdelete-nooldid-text' ); # Too many targets? } else if( $types > 1 ) { - $wgOut->showErrorPage( 'revdelete-toomanytargets-title', 'revdelete-toomanytargets-text' ); - return; + return $wgOut->showErrorPage( 'revdelete-toomanytargets-title', 'revdelete-toomanytargets-text' ); } $this->page = Title::newFromUrl( $this->target ); $this->contextPage = Title::newFromUrl( $wgRequest->getText( 'page' ) ); @@ -273,8 +271,7 @@ // Check if the revision was Oversighted if( !$revObjs[$revid]->userCan(Revision::DELETED_RESTRICTED) ) { if( !$this->wasPosted ) { - $wgOut->permissionRequired( 'suppressrevision' ); - return; + return $wgOut->permissionRequired( 'suppressrevision' ); } $UserAllowed = false; } @@ -315,8 +312,7 @@ } else if( !$revObjs[$timestamp]->userCan(Revision::DELETED_RESTRICTED) ) { // If a rev is hidden from sysops if( !$this->wasPosted ) { - $wgOut->permissionRequired( 'suppressrevision' ); - return; + return $wgOut->permissionRequired( 'suppressrevision' ); } $UserAllowed = false; } @@ -326,8 +322,7 @@ } } if( !$revisions ) { - $wgOut->showErrorPage( 'revdelete-nooldid-title', 'revdelete-nooldid-text' ); - return; + return $wgOut->showErrorPage( 'revdelete-nooldid-title', 'revdelete-nooldid-text' ); } $wgOut->addHTML( "" ); @@ -413,8 +408,7 @@ } else if( !$filesObjs[$archivename]->userCan(File::DELETED_RESTRICTED) ) { // If a rev is hidden from sysops if( !$this->wasPosted ) { - $wgOut->permissionRequired( 'suppressrevision' ); - return; + return $wgOut->permissionRequired( 'suppressrevision' ); } $UserAllowed = false; } @@ -444,8 +438,7 @@ } else if( !$filesObjs[$fileid]->userCan(File::DELETED_RESTRICTED) ) { // If a rev is hidden from sysops if( !$this->wasPosted ) { - $wgOut->permissionRequired( 'suppressrevision' ); - return; + return $wgOut->permissionRequired( 'suppressrevision' ); } $UserAllowed = false; } @@ -456,8 +449,7 @@ } } if( !$revisions )
[MediaWiki-CVS] SVN: [49383] trunk/extensions/FlaggedRevs/specialpages/Stabilization_body. php
Revision: 49383 Author: aaron Date: 2009-04-11 03:31:30 + (Sat, 11 Apr 2009) Log Message: --- small cleanups Modified Paths: -- trunk/extensions/FlaggedRevs/specialpages/Stabilization_body.php Modified: trunk/extensions/FlaggedRevs/specialpages/Stabilization_body.php === --- trunk/extensions/FlaggedRevs/specialpages/Stabilization_body.php 2009-04-11 03:04:28 UTC (rev 49382) +++ trunk/extensions/FlaggedRevs/specialpages/Stabilization_body.php 2009-04-11 03:31:30 UTC (rev 49383) @@ -23,14 +23,11 @@ # Let anyone view, but not submit... if( $wgRequest->wasPosted() ) { if( $wgUser->isBlocked( !$confirm ) ) { - $wgOut->blockedPage(); - return; + return $wgOut->blockedPage(); } else if( !$this->isAllowed ) { - $wgOut->permissionRequired( 'stablesettings' ); - return; + return $wgOut->permissionRequired( 'stablesettings' ); } else if( wfReadOnly() ) { - $wgOut->readOnlyPage(); - return; + return $wgOut->readOnlyPage(); } } @@ -43,16 +40,13 @@ $this->page = Title::newFromUrl( $this->target ); # We need a page... if( is_null($this->page) ) { - $wgOut->showErrorPage( 'notargettitle', 'notargettext' ); - return; + return $wgOut->showErrorPage( 'notargettitle', 'notargettext' ); } else if( !$this->page->exists() ) { - $wgOut->addHTML( wfMsgExt( 'stabilization-notexists', array('parseinline'), + return $wgOut->addHTML( wfMsgExt( 'stabilization-notexists', array('parseinline'), $this->page->getPrefixedText() ) ); - return; } else if( !FlaggedRevs::isPageReviewable( $this->page ) ) { - $wgOut->addHTML( wfMsgExt( 'stabilization-notcontent', array('parseinline'), + return $wgOut->addHTML( wfMsgExt( 'stabilization-notcontent', array('parseinline'), $this->page->getPrefixedText() ) ); - return; } # Watch checkbox @@ -89,7 +83,7 @@ $isValid = false; } } - + // Show form or submit... if( $isValid && $confirm ) { $this->submit(); } else { @@ -99,12 +93,6 @@ protected function showSettings( $err = null ) { global $wgOut, $wgLang, $wgUser; - # Must be a content page - if( !FlaggedRevs::isPageReviewable( $this->page ) ) { - $wgOut->addHTML( wfMsgExt('stableversions-none', array('parse'), - $this->page->getPrefixedText() ) ); - return; - } # Add any error messages if( "" != $err ) { $wgOut->setSubtitle( wfMsgHtml( 'formerror' ) ); @@ -322,7 +310,7 @@ } protected function submit() { - global $wgOut, $wgUser, $wgParser; + global $wgOut, $wgUser, $wgContLang; $changed = $reset = false; $defaultPrecedence = FlaggedRevs::getPrecedence(); @@ -382,8 +370,6 @@ # Log if changed # @FIXME: do this better if( $changed ) { - global $wgContLang; - $log = new LogPage( 'stable' ); # ID, accuracy, depth, style $set = array(); @@ -435,7 +421,7 @@ } # Update the links tables as the stable version may now be the default page... FlaggedRevs::titleLinksUpdate( $this->page ); - + # Apply watchlist checkbox value if( $this->watchThis ) { $wgUser->addWatch( $this->page ); } else { ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [49406] trunk/phase3/includes/specials/SpecialRevisiondelete.php
Revision: 49406 Author: aaron Date: 2009-04-11 17:27:02 + (Sat, 11 Apr 2009) Log Message: --- * Filter out duplicated url parameters * Whitespace Modified Paths: -- trunk/phase3/includes/specials/SpecialRevisiondelete.php Modified: trunk/phase3/includes/specials/SpecialRevisiondelete.php === --- trunk/phase3/includes/specials/SpecialRevisiondelete.php2009-04-11 16:42:45 UTC (rev 49405) +++ trunk/phase3/includes/specials/SpecialRevisiondelete.php2009-04-11 17:27:02 UTC (rev 49406) @@ -29,11 +29,16 @@ $this->target = $wgRequest->getText( 'target' ); # Handle our many different possible input types. # Use CVS, since the cgi handling will break on arrays. - $this->oldids = array_filter( explode( ',', $wgRequest->getVal('oldid') ) ); - $this->artimestamps = array_filter( explode( ',', $wgRequest->getVal('artimestamp') ) ); - $this->logids = array_filter( explode( ',', $wgRequest->getVal('logid') ) ); - $this->oldimgs = array_filter( explode( ',', $wgRequest->getVal('oldimage') ) ); - $this->fileids = array_filter( explode( ',', $wgRequest->getVal('fileid') ) ); + $this->oldids = explode( ',', $wgRequest->getVal('oldid') ); + $this->oldids = array_unique( array_filter($this->oldids) ); + $this->artimestamps = explode( ',', $wgRequest->getVal('artimestamp') ); + $this->artimestamps = array_unique( array_filter($this->artimestamps) ); + $this->logids = explode( ',', $wgRequest->getVal('logid') ); + $this->logids = array_unique( array_filter($this->logids) ); + $this->oldimgs = explode( ',', $wgRequest->getVal('oldimage') ); + $this->oldimgs = array_unique( array_filter($this->oldimgs) ); + $this->fileids = explode( ',', $wgRequest->getVal('fileid') ); + $this->fileids = array_unique( array_filter($this->fileids) ); # For reviewing deleted files... $this->file = $wgRequest->getVal( 'file' ); # Only one target set at a time please! @@ -260,9 +265,11 @@ $result = $dbr->select( array('revision','page'), '*', array( 'rev_page' => $this->page->getArticleID(), - 'rev_id' => $where, - 'rev_page = page_id' ), - __METHOD__ ); + 'rev_id' => $where, + 'rev_page = page_id' + ), + __METHOD__ + ); while( $row = $dbr->fetchObject( $result ) ) { $revObjs[$row->rev_id] = new Revision( $row ); } @@ -288,9 +295,11 @@ $result = $dbr->select( 'archive', '*', array( 'ar_namespace' => $this->page->getNamespace(), - 'ar_title' => $this->page->getDBKey(), - 'ar_timestamp' => $where ), - __METHOD__ ); + 'ar_title' => $this->page->getDBKey(), + 'ar_timestamp' => $where + ), + __METHOD__ + ); while( $row = $dbr->fetchObject( $result ) ) { $timestamp = wfTimestamp( TS_MW, $row->ar_timestamp ); $revObjs[$timestamp] = new Revision( array( @@ -392,9 +401,11 @@ } $result = $dbr->select( 'oldimage', '*', array( - 'oi_name' => $this->page->getDBKey(), - 'oi_archive_name' => $where ), - __METHOD__ ); + 'oi_name' => $this->pa
[MediaWiki-CVS] SVN: [49408] trunk/phase3
Revision: 49408 Author: aaron Date: 2009-04-11 17:38:21 + (Sat, 11 Apr 2009) Log Message: --- (bug 16607) Added convenience checkboxes for revisiondelete to history pages Modified Paths: -- trunk/phase3/includes/DefaultSettings.php trunk/phase3/includes/PageHistory.php trunk/phase3/languages/messages/MessagesEn.php trunk/phase3/maintenance/language/messages.inc trunk/phase3/skins/common/history.js trunk/phase3/skins/common/wikibits.js Modified: trunk/phase3/includes/DefaultSettings.php === --- trunk/phase3/includes/DefaultSettings.php 2009-04-11 17:28:03 UTC (rev 49407) +++ trunk/phase3/includes/DefaultSettings.php 2009-04-11 17:38:21 UTC (rev 49408) @@ -1477,7 +1477,7 @@ * to ensure that client-side caches don't keep obsolete copies of global * styles. */ -$wgStyleVersion = '209'; +$wgStyleVersion = '210'; # Server-side caching: Modified: trunk/phase3/includes/PageHistory.php === --- trunk/phase3/includes/PageHistory.php 2009-04-11 17:28:03 UTC (rev 49407) +++ trunk/phase3/includes/PageHistory.php 2009-04-11 17:38:21 UTC (rev 49408) @@ -153,33 +153,48 @@ * @return string HTML output */ function beginHistoryList() { - global $wgTitle, $wgScript, $wgEnableHtmlDiff; + global $wgTitle, $wgUser, $wgScript, $wgEnableHtmlDiff; $this->lastdate = ''; $s = wfMsgExt( 'histlegend', array( 'parse') ); - $s .= Xml::openElement( 'form', array( 'action' => $wgScript, 'id' => 'mw-history-compare' ) ); + if( $wgUser->isAllowed('deleterevision') ) { + $revdel = SpecialPage::getTitleFor( 'Revisiondelete' ); + $s .= Xml::openElement( 'form', + array( + 'action' => $revdel->getFullUrl(), + 'method' => 'get', 'id' => 'mw-history-revdeleteform', + 'style' => 'visibility:hidden;float:right;' + ) + ); + $s .= Xml::hidden( 'target', $wgTitle->getPrefixedDbKey() ); + $s .= Xml::hidden( 'oldid', '', array('id'=>'revdel-oldid') ); + $s .= Xml::submitButton( wfMsg( 'showhideselectedversions' ) ); + $s .= Xml::closeElement( 'form' ); + } + $s .= Xml::openElement( 'form', array( 'action' => $wgScript, + 'id' => 'mw-history-compare' ) ); $s .= Xml::hidden( 'title', $wgTitle->getPrefixedDbKey() ); if( $wgEnableHtmlDiff ) { $s .= $this->submitButton( wfMsg( 'visualcomparison'), array( - 'name' => 'htmldiff', - 'class' => 'historysubmit', - 'accesskey' => wfMsg( 'accesskey-visualcomparison' ), - 'title' => wfMsg( 'tooltip-compareselectedversions' ), + 'name' => 'htmldiff', + 'class' => 'historysubmit', + 'accesskey' => wfMsg( 'accesskey-visualcomparison' ), + 'title' => wfMsg( 'tooltip-compareselectedversions' ), ) ); $s .= $this->submitButton( wfMsg( 'wikicodecomparison'), array( - 'class' => 'historysubmit', - 'accesskey' => wfMsg( 'accesskey-compareselectedversions' ), - 'title' => wfMsg( 'tooltip-compareselectedversions' ), + 'class' => 'historysubmit', + 'accesskey' => wfMsg( 'accesskey-compare
[MediaWiki-CVS] SVN: [49409] trunk/phase3/includes/LogPage.php
Revision: 49409 Author: aaron Date: 2009-04-11 17:46:55 + (Sat, 11 Apr 2009) Log Message: --- use correct item for count display Modified Paths: -- trunk/phase3/includes/LogPage.php Modified: trunk/phase3/includes/LogPage.php === --- trunk/phase3/includes/LogPage.php 2009-04-11 17:38:21 UTC (rev 49408) +++ trunk/phase3/includes/LogPage.php 2009-04-11 17:46:55 UTC (rev 49409) @@ -232,7 +232,7 @@ } // Revision deletion } else if ( preg_match( '/^(delete|suppress)\/revision$/', $key ) && count( $params ) == 5 ) { - $count = substr_count( $params[1], ',' ) + 1; // revisions + $count = substr_count( $params[2], ',' ) + 1; // revisions $ofield = intval( substr( $params[3], 7 ) ); // $nfield = intval( substr( $params[4], 7 ) ); // $details .= ': '.RevisionDeleter::getLogMessage( $count, $nfield, $ofield, false ); ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [49414] trunk/phase3/includes
Revision: 49414 Author: aaron Date: 2009-04-11 23:05:13 + (Sat, 11 Apr 2009) Log Message: --- Removed $wgTitle from PageHistory Modified Paths: -- trunk/phase3/includes/PageHistory.php trunk/phase3/includes/specials/SpecialRevisiondelete.php Modified: trunk/phase3/includes/PageHistory.php === --- trunk/phase3/includes/PageHistory.php 2009-04-11 20:14:38 UTC (rev 49413) +++ trunk/phase3/includes/PageHistory.php 2009-04-11 23:05:13 UTC (rev 49414) @@ -67,7 +67,7 @@ * @returns nothing */ function history() { - global $wgOut, $wgRequest, $wgTitle, $wgScript; + global $wgOut, $wgRequest, $wgScript; /* * Allow client caching. @@ -153,7 +153,7 @@ * @return string HTML output */ function beginHistoryList() { - global $wgTitle, $wgUser, $wgScript, $wgEnableHtmlDiff; + global $wgUser, $wgScript, $wgEnableHtmlDiff; $this->lastdate = ''; $s = wfMsgExt( 'histlegend', array( 'parse') ); if( $wgUser->isAllowed('deleterevision') ) { @@ -165,14 +165,14 @@ 'style' => 'visibility:hidden;float:right;' ) ); - $s .= Xml::hidden( 'target', $wgTitle->getPrefixedDbKey() ); + $s .= Xml::hidden( 'target', $this->mTitle->getPrefixedDbKey() ); $s .= Xml::hidden( 'oldid', '', array('id'=>'revdel-oldid') ); $s .= Xml::submitButton( wfMsg( 'showhideselectedversions' ) ); $s .= Xml::closeElement( 'form' ); } $s .= Xml::openElement( 'form', array( 'action' => $wgScript, 'id' => 'mw-history-compare' ) ); - $s .= Xml::hidden( 'title', $wgTitle->getPrefixedDbKey() ); + $s .= Xml::hidden( 'title', $this->mTitle->getPrefixedDbKey() ); if( $wgEnableHtmlDiff ) { $s .= $this->submitButton( wfMsg( 'visualcomparison'), array( Modified: trunk/phase3/includes/specials/SpecialRevisiondelete.php === --- trunk/phase3/includes/specials/SpecialRevisiondelete.php2009-04-11 20:14:38 UTC (rev 49413) +++ trunk/phase3/includes/specials/SpecialRevisiondelete.php2009-04-11 23:05:13 UTC (rev 49414) @@ -1528,11 +1528,11 @@ $s = ''; $changes = self::getChanges( $nbitfield, $obitfield ); if( count( $changes[0] ) ) { - $s .= wfMsgForContent ( 'revdelete-hid', implode ( ', ', $changes[0] ) ); + $s .= wfMsgForContent( 'revdelete-hid', implode( ', ', $changes[0] ) ); } if( count( $changes[1] ) ) { if ($s) $s .= '; '; - $s .= wfMsgForContent ( 'revdelete-unhid', implode ( ', ', $changes[1] ) ); + $s .= wfMsgForContent( 'revdelete-unhid', implode( ', ', $changes[1] ) ); } if( count( $changes[2] ) ) { $s .= $s ? ' (' . $changes[2][0] . ')' : $changes[2][0]; ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [49415] trunk/phase3/maintenance/archives/patch-log_user_text.sql
Revision: 49415 Author: aaron Date: 2009-04-11 23:46:12 + (Sat, 11 Apr 2009) Log Message: --- log_target_id -> log_page. Indexed to allow better log tracking wrt page moves. Modified Paths: -- trunk/phase3/maintenance/archives/patch-log_user_text.sql Modified: trunk/phase3/maintenance/archives/patch-log_user_text.sql === --- trunk/phase3/maintenance/archives/patch-log_user_text.sql 2009-04-11 23:05:13 UTC (rev 49414) +++ trunk/phase3/maintenance/archives/patch-log_user_text.sql 2009-04-11 23:46:12 UTC (rev 49415) @@ -1,7 +1,8 @@ ALTER TABLE /*$wgDBprefix*/logging ADD log_user_text varchar(255) binary NOT NULL default '', - ADD log_target_id int unsigned NULL, + ADD log_page int unsigned NULL, CHANGE log_type log_type varbinary(32) NOT NULL, CHANGE log_action log_action varbinary(32) NOT NULL; CREATE INDEX /*i*/user_type_time ON /*_*/logging (log_user, log_type, log_timestamp); +CREATE INDEX /*i*/page_type ON /*_*/logging (log_page,log_timestamp); ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [49416] trunk/phase3/maintenance/archives/patch-log_user_text.sql
Revision: 49416 Author: aaron Date: 2009-04-11 23:48:24 + (Sat, 11 Apr 2009) Log Message: --- Index name fix, tweaked field name Modified Paths: -- trunk/phase3/maintenance/archives/patch-log_user_text.sql Modified: trunk/phase3/maintenance/archives/patch-log_user_text.sql === --- trunk/phase3/maintenance/archives/patch-log_user_text.sql 2009-04-11 23:46:12 UTC (rev 49415) +++ trunk/phase3/maintenance/archives/patch-log_user_text.sql 2009-04-11 23:48:24 UTC (rev 49416) @@ -1,8 +1,8 @@ ALTER TABLE /*$wgDBprefix*/logging ADD log_user_text varchar(255) binary NOT NULL default '', - ADD log_page int unsigned NULL, + ADD log_page_id int unsigned NULL, CHANGE log_type log_type varbinary(32) NOT NULL, CHANGE log_action log_action varbinary(32) NOT NULL; CREATE INDEX /*i*/user_type_time ON /*_*/logging (log_user, log_type, log_timestamp); -CREATE INDEX /*i*/page_type ON /*_*/logging (log_page,log_timestamp); +CREATE INDEX /*i*/page_id_time ON /*_*/logging (log_page,log_timestamp); ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [49424] trunk/phase3/skins/common/wikibits.js
Revision: 49424 Author: aaron Date: 2009-04-12 14:55:06 + (Sun, 12 Apr 2009) Log Message: --- Minor JS fix for r49408 Modified Paths: -- trunk/phase3/skins/common/wikibits.js Modified: trunk/phase3/skins/common/wikibits.js === --- trunk/phase3/skins/common/wikibits.js 2009-04-12 14:48:49 UTC (rev 49423) +++ trunk/phase3/skins/common/wikibits.js 2009-04-12 14:55:06 UTC (rev 49424) @@ -431,7 +431,8 @@ } for (var i = start; i <= finish; ++i ) { checkboxes[i].checked = endState; - if( i > start ) checkboxes[i].onchange(); // fire triggers + if( i > start && typeof checkboxes[i].onchange == 'function' ) + checkboxes[i].onchange(); // fire triggers } lastCheckbox = this.index; return true; ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [49427] trunk/phase3/includes/specials/SpecialRevisiondelete.php
Revision: 49427 Author: aaron Date: 2009-04-12 15:45:27 + (Sun, 12 Apr 2009) Log Message: --- More log extract cleanup Modified Paths: -- trunk/phase3/includes/specials/SpecialRevisiondelete.php Modified: trunk/phase3/includes/specials/SpecialRevisiondelete.php === --- trunk/phase3/includes/specials/SpecialRevisiondelete.php2009-04-12 15:01:56 UTC (rev 49426) +++ trunk/phase3/includes/specials/SpecialRevisiondelete.php2009-04-12 15:45:27 UTC (rev 49427) @@ -152,23 +152,22 @@ $safeIds[] = $m[0]; } } - // Optimization for logs + // Optimization for logs: the event was hidden after it was made if( $action == 'event' ) { $dbr = wfGetDB( DB_SLAVE ); # Get the timestamp of the first item $first = $dbr->selectField( 'logging', 'log_timestamp', array('log_id' => $safeIds), __METHOD__, array('ORDER BY' => 'log_id') ); - # If there are no items, then stop here if( $first == false ) { - $conds = array('1=0'); - return array($conds,$limit); + return array( array('1=0'), $limit ); // If there are no items, then stop here } - # The event was be hidden after it was made $conds[] = 'log_timestamp > '.$dbr->addQuotes($first); // type,time index } // Format is if( count($safeIds) ) { - $conds[] = "log_params RLIKE '(^|\n|,)(".implode('|',$safeIds).")(,|\n|$)'"; + // Log deletions do not have an item type, others do... + $type = ($this->deleteKey != 'logid') ? "^{$this->deleteKey}.*" : ''; + $conds[] = "log_params RLIKE '$type(^|\n|,)(".implode('|',$safeIds).")(,|\n|$)'"; } else { $conds = array('1=0'); } ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [49433] trunk/phase3/includes/specials/SpecialRevisiondelete.php
Revision: 49433 Author: aaron Date: 2009-04-13 05:29:34 + (Mon, 13 Apr 2009) Log Message: --- Disable extract for log items for speed Modified Paths: -- trunk/phase3/includes/specials/SpecialRevisiondelete.php Modified: trunk/phase3/includes/specials/SpecialRevisiondelete.php === --- trunk/phase3/includes/specials/SpecialRevisiondelete.php2009-04-12 23:04:59 UTC (rev 49432) +++ trunk/phase3/includes/specials/SpecialRevisiondelete.php2009-04-13 05:29:34 UTC (rev 49433) @@ -85,6 +85,7 @@ $this->showImages(); } else if( $this->deleteKey == 'logid' ) { $this->showLogItems(); + return; // no logs for now } list($qc,$lim) = $this->getLogQueryCond(); # Show relevant lines from the deletion log @@ -121,8 +122,8 @@ private function getLogQueryCond() { $ids = $safeIds = array(); - $action = 'revision'; $limit = 25; // default + $conds = array( 'log_action' => 'revision' ); // revision delete logs switch( $this->deleteKey ) { case 'oldid': $ids = $this->oldids; @@ -136,13 +137,10 @@ case 'fileid': $ids = $this->fileids; break; - case 'logid': + default: // bad type? $ids = $this->logids; - $action = 'event'; - break; + return array($conds,$limit); } - // Revision delete logs - $conds = array( 'log_action' => $action ); // Just get the whole log if there are a lot if items if( count($ids) > $limit ) return array($conds,$limit); @@ -152,22 +150,9 @@ $safeIds[] = $m[0]; } } - // Optimization for logs: the event was hidden after it was made - if( $action == 'event' ) { - $dbr = wfGetDB( DB_SLAVE ); - # Get the timestamp of the first item - $first = $dbr->selectField( 'logging', 'log_timestamp', - array('log_id' => $safeIds), __METHOD__, array('ORDER BY' => 'log_id') ); - if( $first == false ) { - return array( array('1=0'), $limit ); // If there are no items, then stop here - } - $conds[] = 'log_timestamp > '.$dbr->addQuotes($first); // type,time index - } // Format is if( count($safeIds) ) { - // Log deletions do not have an item type, others do... - $type = ($this->deleteKey != 'logid') ? "^{$this->deleteKey}.*" : ''; - $conds[] = "log_params RLIKE '$type(^|\n|,)(".implode('|',$safeIds).")(,|\n|$)'"; + $conds[] = "log_params RLIKE '^{$this->deleteKey}.*(^|\n|,)(".implode('|',$safeIds).")(,|\n|$)'"; } else { $conds = array('1=0'); } ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [49434] trunk/phase3/includes/specials/SpecialRevisiondelete.php
Revision: 49434 Author: aaron Date: 2009-04-13 05:33:44 + (Mon, 13 Apr 2009) Log Message: --- Remove extra code left in r49433 Modified Paths: -- trunk/phase3/includes/specials/SpecialRevisiondelete.php Modified: trunk/phase3/includes/specials/SpecialRevisiondelete.php === --- trunk/phase3/includes/specials/SpecialRevisiondelete.php2009-04-13 05:29:34 UTC (rev 49433) +++ trunk/phase3/includes/specials/SpecialRevisiondelete.php2009-04-13 05:33:44 UTC (rev 49434) @@ -138,7 +138,6 @@ $ids = $this->fileids; break; default: // bad type? - $ids = $this->logids; return array($conds,$limit); } // Just get the whole log if there are a lot if items ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [49454] trunk/phase3/maintenance/archives/patch-log_search.sql
Revision: 49454 Author: aaron Date: 2009-04-14 02:14:05 + (Tue, 14 Apr 2009) Log Message: --- Added proposed log_search table to deal with revisiondelete log extracts and possibly other issues Added Paths: --- trunk/phase3/maintenance/archives/patch-log_search.sql Added: trunk/phase3/maintenance/archives/patch-log_search.sql === --- trunk/phase3/maintenance/archives/patch-log_search.sql (rev 0) +++ trunk/phase3/maintenance/archives/patch-log_search.sql 2009-04-14 02:14:05 UTC (rev 49454) @@ -0,0 +1,13 @@ +CREATE TABLE /*_*/log_search ( + -- Key to log_type + ls_log_type varbinary(32) NOT NULL, + -- Key to log_action + ls_log_action varbinary(32) NOT NULL, + -- The type of ID (rev ID, timestamp, other) + ls_field varbinary(32) NOT NULL, + -- The value of the ID + ls_value varchar(255) NOT NULL, + -- Key to log_id + ls_log_id int unsigned NOT NULL default 0 +); +CREATE INDEX /*i*/log_field_value ON /*_*/log_search (ls_field,ls_value,ls_log_id); Property changes on: trunk/phase3/maintenance/archives/patch-log_search.sql ___ Added: svn:eol-style + native ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [49455] trunk/phase3/maintenance/archives/patch-log_search.sql
Revision: 49455 Author: aaron Date: 2009-04-14 04:54:54 + (Tue, 14 Apr 2009) Log Message: --- Tweak r49454: remove duplication Modified Paths: -- trunk/phase3/maintenance/archives/patch-log_search.sql Modified: trunk/phase3/maintenance/archives/patch-log_search.sql === --- trunk/phase3/maintenance/archives/patch-log_search.sql 2009-04-14 02:14:05 UTC (rev 49454) +++ trunk/phase3/maintenance/archives/patch-log_search.sql 2009-04-14 04:54:54 UTC (rev 49455) @@ -1,9 +1,5 @@ CREATE TABLE /*_*/log_search ( - -- Key to log_type - ls_log_type varbinary(32) NOT NULL, - -- Key to log_action - ls_log_action varbinary(32) NOT NULL, - -- The type of ID (rev ID, timestamp, other) + -- The type of ID (rev ID, log ID, timestamp, other) ls_field varbinary(32) NOT NULL, -- The value of the ID ls_value varchar(255) NOT NULL, ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [49463] trunk/phase3/includes/Export.php
Revision: 49463 Author: aaron Date: 2009-04-14 14:42:50 + (Tue, 14 Apr 2009) Log Message: --- Log stream buffer fix Modified Paths: -- trunk/phase3/includes/Export.php Modified: trunk/phase3/includes/Export.php === --- trunk/phase3/includes/Export.php2009-04-14 10:52:11 UTC (rev 49462) +++ trunk/phase3/includes/Export.php2009-04-14 14:42:50 UTC (rev 49463) @@ -197,10 +197,10 @@ array( 'ORDER BY' => 'log_id', 'USE INDEX' => array('logging' => 'PRIMARY') ) ); $wrapper = $this->db->resultObject( $result ); + $this->outputLogStream( $wrapper ); if( $this->buffer == WikiExporter::STREAM ) { $this->db->bufferResults( $prev ); } - $this->outputLogStream( $wrapper ); # For page dumps... } else { $tables = array( 'page', 'revision' ); ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [49468] trunk/phase3/maintenance/archives/patch-log_search.sql
Revision: 49468 Author: aaron Date: 2009-04-14 15:38:51 + (Tue, 14 Apr 2009) Log Message: --- Follow up to r49454: redid indexing Modified Paths: -- trunk/phase3/maintenance/archives/patch-log_search.sql Modified: trunk/phase3/maintenance/archives/patch-log_search.sql === --- trunk/phase3/maintenance/archives/patch-log_search.sql 2009-04-14 15:26:08 UTC (rev 49467) +++ trunk/phase3/maintenance/archives/patch-log_search.sql 2009-04-14 15:38:51 UTC (rev 49468) @@ -4,6 +4,7 @@ -- The value of the ID ls_value varchar(255) NOT NULL, -- Key to log_id - ls_log_id int unsigned NOT NULL default 0 + ls_log_id int unsigned NOT NULL default 0, + PRIMARY KEY (ls_field,ls_value,ls_log_id) ); -CREATE INDEX /*i*/log_field_value ON /*_*/log_search (ls_field,ls_value,ls_log_id); +CREATE INDEX /*i*/ls_log_id ON /*_*/log_search (ls_log_id); ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [49523] trunk/extensions/FlaggedRevs/FlaggedRevs.class.php
Revision: 49523 Author: aaron Date: 2009-04-15 20:18:47 + (Wed, 15 Apr 2009) Log Message: --- Made getPrecedence() more robust Modified Paths: -- trunk/extensions/FlaggedRevs/FlaggedRevs.class.php Modified: trunk/extensions/FlaggedRevs/FlaggedRevs.class.php === --- trunk/extensions/FlaggedRevs/FlaggedRevs.class.php 2009-04-15 20:05:42 UTC (rev 49522) +++ trunk/extensions/FlaggedRevs/FlaggedRevs.class.php 2009-04-15 20:18:47 UTC (rev 49523) @@ -264,11 +264,15 @@ } /** -* Get global revision status precedence settings +* Get global revision status precedence setting +* or a specific one if given configuration flags +* @param int, config settings, optional * @return int */ - public static function getPrecedence() { + public static function getPrecedence( $config = null ) { global $wgFlaggedRevsPrecedence; + if( is_null($config) ) + $config = $wgFlaggedRevsPrecedence; switch( $wgFlaggedRevsPrecedence ) { case 2: ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [49524] trunk/extensions/FlaggedRevs/FlaggedRevs.class.php
Revision: 49524 Author: aaron Date: 2009-04-15 20:38:54 + (Wed, 15 Apr 2009) Log Message: --- Added some tag convenience functions Modified Paths: -- trunk/extensions/FlaggedRevs/FlaggedRevs.class.php Modified: trunk/extensions/FlaggedRevs/FlaggedRevs.class.php === --- trunk/extensions/FlaggedRevs/FlaggedRevs.class.php 2009-04-15 20:18:47 UTC (rev 49523) +++ trunk/extensions/FlaggedRevs/FlaggedRevs.class.php 2009-04-15 20:38:54 UTC (rev 49524) @@ -323,6 +323,22 @@ } return $flags; } + + /** +* Get minimum level tags for a tier +* @return array +*/ + public static function quickTags( $tier ) { + switch( $tier ) + { + case 2: + return self::quickPristineTags(); + case 1: + return self::quickQualityTags(); + default: + return self::quickSightedTags(); + } + } /** * Get minimum tags that are closest to the quality level @@ -1045,6 +1061,19 @@ } /** + * @param Array $flags + * @return int, flagging tier + */ + public static function getLevelTier( $flags ) { + if( self::isPristine($flags ) ) + return 2; + else if( self::isQuality($flags ) ) + return 1; + else + return 0; + } + + /** * Is this page in reviewable namespace? * @param Title, $title * @return bool ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [49529] trunk/extensions/FlaggedRevs/FlaggedRevs.class.php
Revision: 49529 Author: aaron Date: 2009-04-15 21:10:38 + (Wed, 15 Apr 2009) Log Message: --- Make r49523 actually work Modified Paths: -- trunk/extensions/FlaggedRevs/FlaggedRevs.class.php Modified: trunk/extensions/FlaggedRevs/FlaggedRevs.class.php === --- trunk/extensions/FlaggedRevs/FlaggedRevs.class.php 2009-04-15 21:07:30 UTC (rev 49528) +++ trunk/extensions/FlaggedRevs/FlaggedRevs.class.php 2009-04-15 21:10:38 UTC (rev 49529) @@ -273,7 +273,7 @@ global $wgFlaggedRevsPrecedence; if( is_null($config) ) $config = $wgFlaggedRevsPrecedence; - switch( $wgFlaggedRevsPrecedence ) + switch( $config ) { case 2: $select = FLAGGED_VIS_PRISTINE; ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [49530] trunk/extensions/FlaggedRevs
Revision: 49530 Author: aaron Date: 2009-04-15 21:19:34 + (Wed, 15 Apr 2009) Log Message: --- * Add autoreview checkbox * Don't invalidate if page config didn't change * Check 'review' and 'edit' rights for stabilization perm * Code cleanups Modified Paths: -- trunk/extensions/FlaggedRevs/language/Stabilization.i18n.php trunk/extensions/FlaggedRevs/specialpages/Stabilization_body.php Modified: trunk/extensions/FlaggedRevs/language/Stabilization.i18n.php === --- trunk/extensions/FlaggedRevs/language/Stabilization.i18n.php 2009-04-15 21:10:38 UTC (rev 49529) +++ trunk/extensions/FlaggedRevs/language/Stabilization.i18n.php 2009-04-15 21:19:34 UTC (rev 49530) @@ -46,6 +46,7 @@ 'stabilize_expiry_invalid' => 'Invalid expiration date.', 'stabilize_expiry_old' => 'This expiration time has already passed.', 'stabilize-expiring' => 'expires $1 (UTC)', + 'stabilization-review' => 'Review the current version', ); /** Message documentation (Message documentation) Modified: trunk/extensions/FlaggedRevs/specialpages/Stabilization_body.php === --- trunk/extensions/FlaggedRevs/specialpages/Stabilization_body.php 2009-04-15 21:10:38 UTC (rev 49529) +++ trunk/extensions/FlaggedRevs/specialpages/Stabilization_body.php 2009-04-15 21:19:34 UTC (rev 49530) @@ -48,6 +48,10 @@ return $wgOut->addHTML( wfMsgExt( 'stabilization-notcontent', array('parseinline'), $this->page->getPrefixedText() ) ); } + + # Users who cannot edit or review the page cannot set this + if( $this->isAllowed && !($this->page->userCan('edit') && $this->page->userCan('review')) ) + $this->isAllowed = false; # Watch checkbox $this->watchThis = $wgRequest->getCheck( 'wpWatchthis' ); @@ -60,6 +64,8 @@ $this->config = FlaggedRevs::getPageVisibilitySettings( $this->page, true ); $this->select = $this->config['select']; $this->override = $this->config['override']; + # Get auto-review option... + $this->reviewThis = $wgRequest->getBool( 'wpReviewthis', true ); # Get autoreview restrictions... $this->autoreview = $this->config['autoreview']; # Make user readable date for GET requests @@ -215,6 +221,7 @@ $watchLabel = wfMsgExt( 'watchthis', array('parseinline') ); $watchAttribs = array('accesskey' => wfMsg( 'accesskey-watch' ), 'id' => 'wpWatchthis'); $watchChecked = ( $wgUser->getOption( 'watchdefault' ) || $this->page->userIsWatching() ); + $reviewLabel = wfMsgExt( 'stabilization-review', array('parseinline') ); $form .= ' ' . @@ -235,6 +242,9 @@ ' . + Xml::check( 'wpReviewthis', $this->reviewThis, array('id'=>'wpReviewthis') ) . + "{$reviewLabel}" . + 'Â ' . Xml::check( 'wpWatchthis', $watchChecked, $watchAttribs ) . "skin->tooltipAndAccesskey( 'watch' ) . ">{$watchLabel}" . @@ -311,7 +321,6 @@ protected function submit() { global $wgOut, $wgUser, $wgContLang; - $changed = $reset = false; $defaultPrecedence = FlaggedRevs::getPrecedence(); $defaultOverride = FlaggedRevs::showStableByDefault(); @@ -364,15 +373,18 @@ 'fpc_override' => $this->override, 'fpc_level'=> $this->autoreview, 'fpc_expiry' => $expiry ), - __METHOD__ ); + __METHOD__ +
[MediaWiki-CVS] SVN: [49531] trunk/extensions/FlaggedRevs
Revision: 49531 Author: aaron Date: 2009-04-15 21:28:20 + (Wed, 15 Apr 2009) Log Message: --- * Fixed stable config expiration * Fixed silly JS bug with 'other time' Modified Paths: -- trunk/extensions/FlaggedRevs/FlaggedRevs.class.php trunk/extensions/FlaggedRevs/specialpages/Stabilization_body.php Modified: trunk/extensions/FlaggedRevs/FlaggedRevs.class.php === --- trunk/extensions/FlaggedRevs/FlaggedRevs.class.php 2009-04-15 21:19:34 UTC (rev 49530) +++ trunk/extensions/FlaggedRevs/FlaggedRevs.class.php 2009-04-15 21:28:20 UTC (rev 49531) @@ -1002,7 +1002,8 @@ if( !$expiry || $expiry < $now ) { $row = null; self::purgeExpiredConfigurations(); - $title->invalidateCache(); + self::titleLinksUpdate( $title ); // re-find stable version + $title->invalidateCache(); // purge squid/memcached } } if( !$row ) { Modified: trunk/extensions/FlaggedRevs/specialpages/Stabilization_body.php === --- trunk/extensions/FlaggedRevs/specialpages/Stabilization_body.php 2009-04-15 21:19:34 UTC (rev 49530) +++ trunk/extensions/FlaggedRevs/specialpages/Stabilization_body.php 2009-04-15 21:28:20 UTC (rev 49531) @@ -118,9 +118,7 @@ if( val == 'existing' ) document.getElementById('mwStabilize-expiry').value = ". Xml::encodeJsVar($this->oldExpiry)."; - else if( val == 'othertime' ) - document.getElementById('mwStabilize-expiry').value = ''; - else + else if( val != 'othertime' ) document.getElementById('mwStabilize-expiry').value = val; } " ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [49544] trunk/phase3/skins/common/shared.css
Revision: 49544 Author: aaron Date: 2009-04-16 00:55:44 + (Thu, 16 Apr 2009) Log Message: --- Tweak r48841: use 90% font instead Modified Paths: -- trunk/phase3/skins/common/shared.css Modified: trunk/phase3/skins/common/shared.css === --- trunk/phase3/skins/common/shared.css2009-04-16 00:18:36 UTC (rev 49543) +++ trunk/phase3/skins/common/shared.css2009-04-16 00:55:44 UTC (rev 49544) @@ -351,7 +351,7 @@ /* (show/hide) revision deletion links */ span.mw-revdelundel-link, strong.mw-revdelundel-link { - font-family: monospace; + font-size: 90%; } /* feed links */ ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [49546] trunk/extensions/FlaggedRevs
Revision: 49546 Author: aaron Date: 2009-04-16 01:14:21 + (Thu, 16 Apr 2009) Log Message: --- * Made patrol links respect $wgFlaggedRevsPatrolLevel better * Removed duplicate permission checks Modified Paths: -- trunk/extensions/FlaggedRevs/FlaggedRevs.class.php trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php Modified: trunk/extensions/FlaggedRevs/FlaggedRevs.class.php === --- trunk/extensions/FlaggedRevs/FlaggedRevs.class.php 2009-04-16 01:00:18 UTC (rev 49545) +++ trunk/extensions/FlaggedRevs/FlaggedRevs.class.php 2009-04-16 01:14:21 UTC (rev 49546) @@ -287,6 +287,15 @@ } return $select; } + + /** +* Get minimum tier for a revision to count as patrolled +* @return int +*/ + public static function getPatrolLevel() { + global $wgFlaggedRevsPatrolLevel; + return intval($wgFlaggedRevsPatrolLevel); + } /** * Get minimum sighted level tags Modified: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php === --- trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php 2009-04-16 01:00:18 UTC (rev 49545) +++ trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php 2009-04-16 01:14:21 UTC (rev 49546) @@ -1408,8 +1408,9 @@ public static function addToRCQuery( &$conds, &$tables, &$join_conds, $opts ) { global $wgUser; if( $wgUser->isAllowed('review') ) { - $tables[] = 'flaggedpages'; - $join_conds['flaggedpages'] = array( 'LEFT JOIN', 'fp_page_id = rc_cur_id' ); + $tables[] = 'flaggedpage_pending'; + $join_conds['flaggedpage_pending'] = array( 'LEFT JOIN', + 'fpp_page_id = rc_cur_id AND fpp_quality = '.FlaggedRevs::getPatrolLevel() ); } return true; } @@ -1472,14 +1473,12 @@ public static function addTochangeListLine( &$list, &$articlelink, &$s, &$rc, $unpatrolled, $watched ) { global $wgUser; - if( $rc->getTitle()->getNamespace() < 0 || !isset($rc->mAttribs['fp_stable']) ) + if( $rc->getTitle()->getNamespace() < 0 || !isset($rc->mAttribs['fpp_rev_id']) ) return true; // reviewed pages only - if( $unpatrolled && $wgUser->isAllowed('review') ) { - wfLoadExtensionMessages( 'FlaggedRevs' ); - $rlink = $list->skin->makeKnownLinkObj( $rc->getTitle(), wfMsg('revreview-reviewlink'), - 'oldid='.intval($rc->mAttribs['fp_stable']).'&diff=cur' ); - $articlelink .= " ($rlink)"; - } + wfLoadExtensionMessages( 'FlaggedRevs' ); + $rlink = $list->skin->makeKnownLinkObj( $rc->getTitle(), wfMsg('revreview-reviewlink'), + 'oldid='.intval($rc->mAttribs['fpp_rev_id']).'&diff=cur' ); + $articlelink .= " ($rlink)"; return true; } ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [49547] trunk/extensions/FlaggedRevs/maintenance/updateLinks.inc
Revision: 49547 Author: aaron Date: 2009-04-16 01:15:15 + (Thu, 16 Apr 2009) Log Message: --- lower $BATCH_SIZE Modified Paths: -- trunk/extensions/FlaggedRevs/maintenance/updateLinks.inc Modified: trunk/extensions/FlaggedRevs/maintenance/updateLinks.inc === --- trunk/extensions/FlaggedRevs/maintenance/updateLinks.inc2009-04-16 01:14:21 UTC (rev 49546) +++ trunk/extensions/FlaggedRevs/maintenance/updateLinks.inc2009-04-16 01:15:15 UTC (rev 49547) @@ -91,7 +91,7 @@ function update_flaggedpages( $start = null ) { echo "Populating and correcting flaggedpages/flaggedpage_config columns\n"; - $BATCH_SIZE = 200; + $BATCH_SIZE = 100; $db = wfGetDB( DB_MASTER ); ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [49550] trunk/extensions/FlaggedRevs/specialpages/Stabilization_body. php
Revision: 49550 Author: aaron Date: 2009-04-16 02:27:07 + (Thu, 16 Apr 2009) Log Message: --- double-check $this->isAllowed Modified Paths: -- trunk/extensions/FlaggedRevs/specialpages/Stabilization_body.php Modified: trunk/extensions/FlaggedRevs/specialpages/Stabilization_body.php === --- trunk/extensions/FlaggedRevs/specialpages/Stabilization_body.php 2009-04-16 02:20:55 UTC (rev 49549) +++ trunk/extensions/FlaggedRevs/specialpages/Stabilization_body.php 2009-04-16 02:27:07 UTC (rev 49550) @@ -90,7 +90,7 @@ } } // Show form or submit... - if( $isValid && $confirm ) { + if( $this->isAllowed && $isValid && $confirm ) { $this->submit(); } else { $this->showSettings(); ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [49554] trunk/phase3
Revision: 49554 Author: aaron Date: 2009-04-16 04:51:43 + (Thu, 16 Apr 2009) Log Message: --- Tweaked r49408: Improved hiding and changed 1 revision case handling Modified Paths: -- trunk/phase3/includes/DefaultSettings.php trunk/phase3/includes/LogPage.php trunk/phase3/includes/PageHistory.php trunk/phase3/skins/common/history.js Modified: trunk/phase3/includes/DefaultSettings.php === --- trunk/phase3/includes/DefaultSettings.php 2009-04-16 03:51:12 UTC (rev 49553) +++ trunk/phase3/includes/DefaultSettings.php 2009-04-16 04:51:43 UTC (rev 49554) @@ -1477,7 +1477,7 @@ * to ensure that client-side caches don't keep obsolete copies of global * styles. */ -$wgStyleVersion = '211'; +$wgStyleVersion = '212'; # Server-side caching: Modified: trunk/phase3/includes/LogPage.php === --- trunk/phase3/includes/LogPage.php 2009-04-16 03:51:12 UTC (rev 49553) +++ trunk/phase3/includes/LogPage.php 2009-04-16 04:51:43 UTC (rev 49554) @@ -91,7 +91,7 @@ $this->type, $this->action, $this->target, $this->comment, $this->params, $newId ); $rc->notifyRC2UDP(); } - return true; + return $newId; } /** @@ -358,6 +358,16 @@ return $this->saveContent(); } + + public function addRelations( $field, $values, $logid ) { + $data = array(); + foreach( $values as $value ) { + $data[] = array('ls_field' => $field,'ls_value' => $value,'ls_log_id' => $logid); + } + $dbw = wfGetDB( DB_MASTER ); + $dbw->insert( 'log_search', $data, __METHOD__ ); + return true; + } /** * Create a blob from a parameter array Modified: trunk/phase3/includes/PageHistory.php === --- trunk/phase3/includes/PageHistory.php 2009-04-16 03:51:12 UTC (rev 49553) +++ trunk/phase3/includes/PageHistory.php 2009-04-16 04:51:43 UTC (rev 49554) @@ -156,7 +156,7 @@ global $wgUser, $wgScript, $wgEnableHtmlDiff; $this->lastdate = ''; $s = wfMsgExt( 'histlegend', array( 'parse') ); - if( $wgUser->isAllowed('deleterevision') ) { + if( $this->linesonpage > 1 && $wgUser->isAllowed('deleterevision') ) { $revdel = SpecialPage::getTitleFor( 'Revisiondelete' ); $s .= Xml::openElement( 'form', array( @@ -284,7 +284,7 @@ if( $wgUser->isAllowed( 'deleterevision' ) ) { // Hide JS by default for non-JS browsing - $hidden = array( 'style' => 'visibility:hidden' ); + $hidden = array( 'style' => 'display:none' ); // If revision was hidden from sysops if( !$rev->userCan( Revision::DELETED_RESTRICTED ) ) { $del = Xml::check( 'deleterevisions', false, Modified: trunk/phase3/skins/common/history.js === --- trunk/phase3/skins/common/history.js2009-04-16 03:51:12 UTC (rev 49553) +++ trunk/phase3/skins/common/history.js2009-04-16 04:51:43 UTC (rev 49554) @@ -87,9 +87,7 @@ // Attach event handlers to the input elements on history page function histrowinit() { var hf = document.getElementById('pagehistory'); - if (!hf) { - return; - } + if (!hf) return; var df = document.getElementById('mw-history-revdeleteform'); if( df ) df.style.visibility = 'visible'; // Enable JS form var lis = hf.getElementsByTagName('li'); @@ -101,7 +99,7 @@ } var check = deleteCheck(lis[i]); if( df && check ) { - check.style.visibility = 'visible'; // Enable JS form + check.style.display = 'inline'; // Enable JS form } } diffcheck(); ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [49555] trunk/phase3/includes/LogPage.php
Revision: 49555 Author: aaron Date: 2009-04-16 04:53:43 + (Thu, 16 Apr 2009) Log Message: --- reverted change committed by mistake Modified Paths: -- trunk/phase3/includes/LogPage.php Modified: trunk/phase3/includes/LogPage.php === --- trunk/phase3/includes/LogPage.php 2009-04-16 04:51:43 UTC (rev 49554) +++ trunk/phase3/includes/LogPage.php 2009-04-16 04:53:43 UTC (rev 49555) @@ -91,7 +91,7 @@ $this->type, $this->action, $this->target, $this->comment, $this->params, $newId ); $rc->notifyRC2UDP(); } - return $newId; + return true; } /** @@ -358,16 +358,6 @@ return $this->saveContent(); } - - public function addRelations( $field, $values, $logid ) { - $data = array(); - foreach( $values as $value ) { - $data[] = array('ls_field' => $field,'ls_value' => $value,'ls_log_id' => $logid); - } - $dbw = wfGetDB( DB_MASTER ); - $dbw->insert( 'log_search', $data, __METHOD__ ); - return true; - } /** * Create a blob from a parameter array ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [49591] trunk/extensions/Drafts/Drafts.classes.php
Revision: 49591 Author: aaron Date: 2009-04-17 05:27:41 + (Fri, 17 Apr 2009) Log Message: --- * Made num() more consistent with get() * Improved index usage of num() slightly Modified Paths: -- trunk/extensions/Drafts/Drafts.classes.php Modified: trunk/extensions/Drafts/Drafts.classes.php === --- trunk/extensions/Drafts/Drafts.classes.php 2009-04-17 05:00:36 UTC (rev 49590) +++ trunk/extensions/Drafts/Drafts.classes.php 2009-04-17 05:27:41 UTC (rev 49591) @@ -36,9 +36,18 @@ ); // Checks if a specific title was given if ( $title !== null ) { - // Adds specific title to conditions - $where['draft_namespace'] = $title->getNamespace(); - $where['draft_title'] = $title->getDBKey(); + // Get page id from title + $pageId = $title->getArticleId(); + // Checks if page id exists + if ( $pageId ) { + // Adds specific page id to conditions + $where['draft_page'] = $pageId; + } else { + // Adds new page information to conditions + $where['draft_page'] = 0; // page not created yet + $where['draft_namespace'] = $title->getNamespace(); + $where['draft_title'] = $title->getDBKey(); + } } // Checks if specific user was given if ( $userID !== null ) { @@ -122,7 +131,7 @@ ); // Checks if specific title was given if ( $title !== null ) { - // Gets page id from title + // Get page id from title $pageId = $title->getArticleId(); // Checks if page id exists if ( $pageId ) { @@ -672,9 +681,9 @@ // Gets a draft token exists for the current user and article $existingRow = $dbw->selectField( 'drafts', 'draft_token', array( + 'draft_user' => $data['draft_user'], 'draft_namespace' => $data['draft_namespace'], 'draft_title' => $data['draft_title'], - 'draft_user' => $data['draft_user'], 'draft_token' => $data['draft_token'] ), __METHOD__ ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [49592] trunk/phase3/includes/specials/SpecialRevisiondelete.php
Revision: 49592 Author: aaron Date: 2009-04-17 06:14:50 + (Fri, 17 Apr 2009) Log Message: --- Tweak for bug 18450, commit the transaction before the purge is sent Modified Paths: -- trunk/phase3/includes/specials/SpecialRevisiondelete.php Modified: trunk/phase3/includes/specials/SpecialRevisiondelete.php === --- trunk/phase3/includes/specials/SpecialRevisiondelete.php2009-04-17 05:27:41 UTC (rev 49591) +++ trunk/phase3/includes/specials/SpecialRevisiondelete.php2009-04-17 06:14:50 UTC (rev 49592) @@ -1442,6 +1442,7 @@ */ function updatePage( $title ) { $title->invalidateCache(); + $this->dbw->commit(); // Commit the transaction before the purge is sent $title->purgeSquid(); $title->touchLinks(); // Extensions that require referencing previous revisions may need this ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [49594] trunk/extensions/AbuseFilter/AbuseFilter.class.php
Revision: 49594 Author: aaron Date: 2009-04-17 08:08:35 + (Fri, 17 Apr 2009) Log Message: --- profiling fix Modified Paths: -- trunk/extensions/AbuseFilter/AbuseFilter.class.php Modified: trunk/extensions/AbuseFilter/AbuseFilter.class.php === --- trunk/extensions/AbuseFilter/AbuseFilter.class.php 2009-04-17 07:18:09 UTC (rev 49593) +++ trunk/extensions/AbuseFilter/AbuseFilter.class.php 2009-04-17 08:08:35 UTC (rev 49594) @@ -837,9 +837,11 @@ $text = ExternalStore::insertToDefault( $text ); $flags[] = 'external'; - if (!$text) + if (!$text) { // Not mission-critical, just return nothing + wfProfileOut( __METHOD__ ); return null; + } } // Store to text table ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [49648] trunk/extensions/FlaggedRevs/FlaggedArticle.php
Revision: 49648 Author: aaron Date: 2009-04-19 19:34:22 + (Sun, 19 Apr 2009) Log Message: --- Bug 18512 &action=render now respects FlaggedRevs' default view Modified Paths: -- trunk/extensions/FlaggedRevs/FlaggedArticle.php Modified: trunk/extensions/FlaggedRevs/FlaggedArticle.php === --- trunk/extensions/FlaggedRevs/FlaggedArticle.php 2009-04-19 19:01:43 UTC (rev 49647) +++ trunk/extensions/FlaggedRevs/FlaggedArticle.php 2009-04-19 19:34:22 UTC (rev 49648) @@ -74,7 +74,7 @@ global $wgUser, $wgRequest; # This only applies to viewing content pages $action = $wgRequest->getVal( 'action', 'view' ); - if( ($action !='view' && $action !='purge') || !$this->isReviewable() ) + if( !self::isViewAction($action) || !$this->isReviewable() ) return false; # Does not apply to diffs/old revision. Explicit requests # for a certain stable version will be handled elsewhere. @@ -98,6 +98,15 @@ } return false; } + +/** +* Is this a view page action? +* @param $action string +* @returns bool +*/ + protected static function isViewAction( $action ) { + return ( $action == 'view' || $action == 'purge' || $action == 'render' ); + } /** * Is the stable version shown by default for this page? @@ -243,7 +252,7 @@ global $wgRequest, $wgOut, $wgUser, $wgLang; # Only trigger on article view for content pages, not for protect/delete/hist... $action = $wgRequest->getVal( 'action', 'view' ); - if( ($action !='view' && $action !='purge') || !$this->parent->exists() ) + if( !self::isViewAction($action) || !$this->parent->exists() ) return true; # Do not clutter up diffs any further and leave archived versions alone... if( $wgRequest->getVal('diff') || $wgRequest->getVal('oldid') ) { @@ -750,7 +759,7 @@ } # Check action and if page is protected $action = $wgRequest->getVal( 'action', 'view' ); - if( ($action !='view' && $action !='purge') ) { + if( !self::isViewAction($action) ) { return true; } $this->addQuickReview( $data, $wgRequest->getVal('diff'), false ); @@ -768,7 +777,7 @@ } # Check action and if page is protected $action = $wgRequest->getVal( 'action', 'view' ); - if( ($action !='view' && $action !='purge') ) { + if( !self::isViewAction($action) ) { return true; } if( $wgUser->isAllowed( 'feedback' ) ) { @@ -881,7 +890,7 @@ $draftTabCss = ''; $stableTabCss = 'selected'; // We are looking at the talk page or diffs/hist/oldids - } else if( !in_array($action,array('view','purge','edit')) || $skin->mTitle->isTalkPage() ) { + } else if( !(self::isViewAction($action) || $action=='edit') || $skin->mTitle->isTalkPage() ) { $draftTabCss = ''; $stableTabCss = ''; // We are looking at the current revision or in edit mode @@ -1564,8 +1573,9 @@ global $wgUser, $wgRequest; $action = $wgRequest->getVal( 'action', 'view' ); + if( $action == 'purge' ) return true; // already purging! # Only trigger on article view for content pages, not for protect/delete/hist - if( $action !='view' || !$wgUser->isAllowed( 'review' ) ) + if( !self::isViewAction($action) || !$wgUser->isAllowed( 'review' ) ) return true; if( !$this->parent->exists() || !$this->isReviewable() ) return true; ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [49684] trunk/phase3/includes/Wiki.php
Revision: 49684 Author: aaron Date: 2009-04-21 01:51:17 + (Tue, 21 Apr 2009) Log Message: --- Made DB profiling work by actually committing it to the DB Modified Paths: -- trunk/phase3/includes/Wiki.php Modified: trunk/phase3/includes/Wiki.php === --- trunk/phase3/includes/Wiki.php 2009-04-20 23:35:19 UTC (rev 49683) +++ trunk/phase3/includes/Wiki.php 2009-04-21 01:51:17 UTC (rev 49684) @@ -335,14 +335,16 @@ } /** -* Cleaning up by doing deferred updates, calling LBFactory and doing the output +* Cleaning up request by doing: +** deferred updates, DB transaction, and the output * * @param $deferredUpdates array of updates to do * @param $output OutputPage */ function finalCleanup( &$deferredUpdates, &$output ) { wfProfileIn( __METHOD__ ); - # Now commit any transactions, so that unreported errors after output() don't roll back the whole thing + # Now commit any transactions, so that unreported errors after + # output() don't roll back the whole DB transaction $factory = wfGetLBFactory(); $factory->commitMasterChanges(); # Output everything! @@ -350,8 +352,6 @@ # Do any deferred jobs $this->doUpdates( $deferredUpdates ); $this->doJobs(); - # Commit and close up! - $factory->shutdown(); wfProfileOut( __METHOD__ ); } @@ -422,6 +422,10 @@ */ function restInPeace() { wfLogProfilingData(); + # Commit and close up! + $factory = wfGetLBFactory(); + $factory->commitMasterChanges(); + $factory->shutdown(); wfDebug( "Request ended normally\n" ); } ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [49685] trunk/phase3/includes/specials
Revision: 49685 Author: aaron Date: 2009-04-21 04:43:22 + (Tue, 21 Apr 2009) Log Message: --- * Fixed unblocking of hidden names (bug 18543) * Added permission check Modified Paths: -- trunk/phase3/includes/specials/SpecialBlockip.php trunk/phase3/includes/specials/SpecialIpblocklist.php Modified: trunk/phase3/includes/specials/SpecialBlockip.php === --- trunk/phase3/includes/specials/SpecialBlockip.php 2009-04-21 01:51:17 UTC (rev 49684) +++ trunk/phase3/includes/specials/SpecialBlockip.php 2009-04-21 04:43:22 UTC (rev 49685) @@ -445,7 +445,7 @@ $log_action = 'reblock'; # Unset _deleted fields if requested if( $currentBlock->mHideName && !$this->BlockHideName ) { - $this->unsuppressUserName( $this->BlockAddress, $userId ); + self::unsuppressUserName( $this->BlockAddress, $userId ); } } } else { @@ -455,7 +455,7 @@ # Set *_deleted fields if requested if( $this->BlockHideName ) { - $this->suppressUserName( $this->BlockAddress, $userId ); + self::suppressUserName( $this->BlockAddress, $userId ); } if ( $this->BlockWatchUser && @@ -486,17 +486,17 @@ } } - private function suppressUserName( $name, $userId ) { + public static function suppressUserName( $name, $userId ) { $op = '|'; // bitwise OR - return $this->setUsernameBitfields( $name, $userId, $op ); + return self::setUsernameBitfields( $name, $userId, $op ); } - private function unsuppressUserName( $name, $userId ) { + public static function unsuppressUserName( $name, $userId ) { $op = '&'; // bitwise AND - return $this->setUsernameBitfields( $name, $userId, $op ); + return self::setUsernameBitfields( $name, $userId, $op ); } - private function setUsernameBitfields( $name, $userId, $op ) { + private static function setUsernameBitfields( $name, $userId, $op ) { if( $op !== '|' && $op !== '&' ) return false; // sanity check $dbw = wfGetDB( DB_MASTER ); $delUser = Revision::DELETED_USER | Revision::DELETED_RESTRICTED; @@ -509,8 +509,10 @@ # current bitfields with the inverse of Revision::DELETED_USER. The # username bit is made to 0 (x & 0 = 0), while others are unchanged (x & 1 = x). # The same goes for the sysop-restricted *_deleted bit. - if( $op == '&' ) $delUser = "~{$delUser}"; - if( $op == '&' ) $delAction = "~{$delAction}"; + if( $op == '&' ) { + $delUser = "~{$delUser}"; + $delAction = "~{$delAction}"; + } # Hide name from live edits $dbw->update( 'revision', array("rev_deleted = rev_deleted $op $delUser"), array('rev_user' => $userId), __METHOD__ ); Modified: trunk/phase3/includes/specials/SpecialIpblocklist.php === --- trunk/phase3/includes/specials/SpecialIpblocklist.php 2009-04-21 01:51:17 UTC (rev 49684) +++ trunk/phase3/includes/specials/SpecialIpblocklist.php 2009-04-21 04:43:22 UTC (rev 49685) @@ -162,7 +162,7 @@ * @return array array(message key, parameters) on failure, empty array on success */ - static function doUnblock(&$id, &$ip, &$reason, &$range = null) { + static function doUnblock(&$id, &$ip, &$reason, &$range = null, $blocker=null) { if ( $id ) { $block = Block::newFromID( $id ); if ( !$block ) { @@ -184,8 +184,7 @@ if ( !$block ) { return array('ipb_cant_unblock', htmlspecialchars($id)); } - if( $block->mRangeStart != $block->mRangeEnd - && !strstr( $ip, "/" ) ) { + if( $block->mRangeStart != $block-&
[MediaWiki-CVS] SVN: [49688] trunk/phase3/includes/diff/DifferenceEngine.php
Revision: 49688 Author: aaron Date: 2009-04-21 06:21:27 + (Tue, 21 Apr 2009) Log Message: --- * Workaround ugly Safari/Chrome handling of tags for hidden diffs (bug 18538) * A few code style tweaks Modified Paths: -- trunk/phase3/includes/diff/DifferenceEngine.php Modified: trunk/phase3/includes/diff/DifferenceEngine.php === --- trunk/phase3/includes/diff/DifferenceEngine.php 2009-04-21 06:10:26 UTC (rev 49687) +++ trunk/phase3/includes/diff/DifferenceEngine.php 2009-04-21 06:21:27 UTC (rev 49688) @@ -43,7 +43,9 @@ * @param $htmldiff boolean If set, output using HTMLDiff instead of raw wikicode diff * @param $unhide boolean If set, allow viewing deleted revs */ - function __construct( $titleObj = null, $old = 0, $new = 0, $rcid = 0, $refreshCache = false , $htmldiff = false, $unhide = false ) { + function __construct( $titleObj = null, $old = 0, $new = 0, $rcid = 0, + $refreshCache = false, $htmldiff = false, $unhide = false ) + { $this->mTitle = $titleObj; wfDebug("DifferenceEngine old '$old' new '$new' rcid '$rcid'\n"); @@ -192,12 +194,12 @@ $db = wfGetDB( DB_SLAVE ); $change = RecentChange::newFromConds( array( - // Add redundant user,timestamp condition so we can use the existing index - 'rc_user_text' => $this->mNewRev->getRawUserText(), - 'rc_timestamp' => $db->timestamp( $this->mNewRev->getTimestamp() ), - 'rc_this_oldid' => $this->mNewid, - 'rc_last_oldid' => $this->mOldid, - 'rc_patrolled' => 0 + // Redundant user,timestamp condition so we can use the existing index + 'rc_user_text' => $this->mNewRev->getRawUserText(), + 'rc_timestamp' => $db->timestamp( $this->mNewRev->getTimestamp() ), + 'rc_this_oldid' => $this->mNewid, + 'rc_last_oldid' => $this->mOldid, + 'rc_patrolled' => 0 ), __METHOD__ ); @@ -755,17 +757,21 @@ * Add the header to a diff body */ static function addHeader( $diff, $otitle, $ntitle, $multi = '' ) { - $header = " - - - - - + $colspan = 1; + $header = ""; + if( $diff ) { // Safari/Chrome show broken output if cols not used + $header .= " + + + + "; + $colspan = 2; + } + $header .= " - {$otitle} - {$ntitle} - - "; + {$otitle} + {$ntitle} + "; if ( $multi != '' ) $header .= "{$multi}"; @@ -825,7 +831,6 @@ $this->mNewtitle = "{$this->mPagetitle}"; $this->mNewtitle .= " (" . wfMsgHtml( $editable ? 'editold' : 'viewsourceold' ) . ")"; - } else { $newLink = $this->mNewPage->escapeLocalUrl( 'oldid=' . $this->mNewid ); $newEdit = $this->mNewPage->escapeLocalUrl( 'action=edit&oldid=' . $this->mNewid ); @@ -834,10 +839,10 @@ $this->mNewtitle = "{$this->mPagetitle}"; $this->mNewtitle .= " (" . wfMsgHtml( $editable ? 'editold' : 'viewsourceold' ) . ")"; } - if ( !$this->mNewRev->userCan(Revision::DELETED_TEXT) ) { + if( !$this->mNewRev->userCan(Revision::DELETED_TEXT) ) { $this->mNewtitle = "{$this->mPagetitle}"; } else if ( $this->mNewRev->isDeleted(Revision::DELETED_TEXT) ) { - $this->mNewtitle = ''.$this->mNewtitle.''; + $this->mNewtitle = "{$this->mNewtitle}"; } // Load the old revision object ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [49728] trunk/extensions/CodeReview
Revision: 49728 Author: aaron Date: 2009-04-22 05:17:17 + (Wed, 22 Apr 2009) Log Message: --- (bug 18444) Allow modification of default chunk size for low-use svn repositories Modified Paths: -- trunk/extensions/CodeReview/CodeReview.php trunk/extensions/CodeReview/svnImport.php Modified: trunk/extensions/CodeReview/CodeReview.php === --- trunk/extensions/CodeReview/CodeReview.php 2009-04-22 03:29:07 UTC (rev 49727) +++ trunk/extensions/CodeReview/CodeReview.php 2009-04-22 05:17:17 UTC (rev 49728) @@ -98,6 +98,9 @@ $wgSubversionProxy = false; $wgSubversionProxyTimeout = 30; // default 3 secs is too short :) +// What is the default SVN import chunk size? +$wgCodeReviewImportBatchSize = 400; + // Bump the version number every time you change a CodeReview .css/.js file $wgCodeReviewStyleVersion = 5; Modified: trunk/extensions/CodeReview/svnImport.php === --- trunk/extensions/CodeReview/svnImport.php 2009-04-22 03:29:07 UTC (rev 49727) +++ trunk/extensions/CodeReview/svnImport.php 2009-04-22 05:17:17 UTC (rev 49728) @@ -20,7 +20,7 @@ $svn = SubversionAdaptor::newFromRepo( $repo->getPath() ); $lastStoredRev = $repo->getLastStoredRev(); -$chunkSize = 400; +$chunkSize = $wgCodeReviewImportBatchSize; $startTime = microtime( true ); $revCount = 0; ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [49730] trunk/phase3/includes/specials/SpecialBlockip.php
Revision: 49730 Author: aaron Date: 2009-04-22 05:56:00 + (Wed, 22 Apr 2009) Log Message: --- fix silly typo Modified Paths: -- trunk/phase3/includes/specials/SpecialBlockip.php Modified: trunk/phase3/includes/specials/SpecialBlockip.php === --- trunk/phase3/includes/specials/SpecialBlockip.php 2009-04-22 05:46:20 UTC (rev 49729) +++ trunk/phase3/includes/specials/SpecialBlockip.php 2009-04-22 05:56:00 UTC (rev 49730) @@ -518,7 +518,7 @@ array('rev_user' => $userId), __METHOD__ ); # Hide name from deleted edits $dbw->update( 'archive', array("ar_deleted = ar_deleted $op $delUser"), - array('ar_user_text' => $userId), __METHOD__ ); + array('ar_user_text' => $name), __METHOD__ ); # Hide name from logs $dbw->update( 'logging', array("log_deleted = log_deleted $op $delUser"), array('log_user' => $userId, "log_type != 'suppress'"), __METHOD__ ); ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [49731] trunk/phase3/includes/specials/SpecialBlockip.php
Revision: 49731 Author: aaron Date: 2009-04-22 06:37:52 + (Wed, 22 Apr 2009) Log Message: --- * Added visibility to some functions * Whitespace/style/comment tweaks Modified Paths: -- trunk/phase3/includes/specials/SpecialBlockip.php Modified: trunk/phase3/includes/specials/SpecialBlockip.php === --- trunk/phase3/includes/specials/SpecialBlockip.php 2009-04-22 05:56:00 UTC (rev 49730) +++ trunk/phase3/includes/specials/SpecialBlockip.php 2009-04-22 06:37:52 UTC (rev 49731) @@ -11,13 +11,11 @@ */ function wfSpecialBlockip( $par ) { global $wgUser, $wgOut, $wgRequest; - # Can't block when the database is locked if( wfReadOnly() ) { $wgOut->readOnlyPage(); return; } - # Permission check if( !$wgUser->isAllowed( 'block' ) ) { $wgOut->permissionRequired( 'block' ); @@ -27,9 +25,9 @@ $ipb = new IPBlockForm( $par ); $action = $wgRequest->getVal( 'action' ); - if ( 'success' == $action ) { + if( 'success' == $action ) { $ipb->showSuccess(); - } else if ( $wgRequest->wasPosted() && 'submit' == $action && + } else if( $wgRequest->wasPosted() && 'submit' == $action && $wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ) ) ) { $ipb->doSubmit(); } else { @@ -44,9 +42,8 @@ */ class IPBlockForm { var $BlockAddress, $BlockExpiry, $BlockReason; -# var $BlockEmail; - function IPBlockForm( $par ) { + public function __construct( $par ) { global $wgRequest, $wgUser, $wgBlockAllowsUTEdit; $this->BlockAddress = $wgRequest->getVal( 'wpBlockAddress', $wgRequest->getVal( 'ip', $par ) ); @@ -70,7 +67,7 @@ $this->BlockReblock = $wgRequest->getBool( 'wpChangeBlock', false ); } - function showForm( $err ) { + public function showForm( $err ) { global $wgOut, $wgUser, $wgSysopUserBans; $wgOut->setPagetitle( wfMsg( 'blockip' ) ); @@ -90,17 +87,17 @@ $user = User::newFromName( $this->BlockAddress ); $alreadyBlocked = false; - if ( $err && $err[0] != 'ipb_already_blocked' ) { + if( $err && $err[0] != 'ipb_already_blocked' ) { $key = array_shift($err); $msg = wfMsgReal($key, $err); $wgOut->setSubtitle( wfMsgHtml( 'formerror' ) ); $wgOut->addHTML( Xml::tags( 'p', array( 'class' => 'error' ), $msg ) ); - } elseif ( $this->BlockAddress ) { + } elseif( $this->BlockAddress ) { $userId = 0; - if ( is_object( $user ) ) + if( is_object( $user ) ) $userId = $user->getId(); $currentBlock = Block::newFromDB( $this->BlockAddress, $userId ); - if ( !is_null($currentBlock) && !$currentBlock->mAuto && # The block exists and isn't an autoblock + if( !is_null($currentBlock) && !$currentBlock->mAuto && # The block exists and isn't an autoblock ( $currentBlock->mRangeStart == $currentBlock->mRangeEnd || # The block isn't a rangeblock # or if it is, the range is what we're about to block ( $currentBlock->mAddress == $this->BlockAddress ) ) ) { @@ -125,12 +122,11 @@ $scBlockExpiryOptions = wfMsgForContent( 'ipboptions' ); $showblockoptions = $scBlockExpiryOptions != '-'; - if (!$showblockoptions) - $mIpbother = $mIpbexpiry; + if( !$showblockoptions ) $mIpbother = $mIpbexpiry; $blockExpiryFormOptions = Xml::option( wfMsg( 'ipbotheroption' ), 'other' ); foreach (explode(',', $scBlockExpiryOptions) as $option) { - if ( strpos($option, ":") === false ) $option = "$option:$option"; + if( strpos($option, ":") === false ) $option = "$option:$option"; list($show, $value) = explode(":", $option); $show = htmlspecialchars($show); $value = htmlspecialchars($va
[MediaWiki-CVS] SVN: [49742] trunk/phase3/includes/specials
Revision: 49742 Author: aaron Date: 2009-04-23 00:50:54 + (Thu, 23 Apr 2009) Log Message: --- Change for bug 18383, suppress user/talk page on user suppression Modified Paths: -- trunk/phase3/includes/specials/SpecialBlockip.php trunk/phase3/includes/specials/SpecialRevisiondelete.php Modified: trunk/phase3/includes/specials/SpecialBlockip.php === --- trunk/phase3/includes/specials/SpecialBlockip.php 2009-04-22 23:52:00 UTC (rev 49741) +++ trunk/phase3/includes/specials/SpecialBlockip.php 2009-04-23 00:50:54 UTC (rev 49742) @@ -450,13 +450,12 @@ # Set *_deleted fields if requested if( $this->BlockHideName ) { - self::suppressUserName( $this->BlockAddress, $userId ); + self::suppressUserName( $this->BlockAddress, $userId, $reasonstr ); } - if( $this->BlockWatchUser && - # Only show watch link when this is no range block - $block->mRangeStart == $block->mRangeEnd) { - $wgUser->addWatch ( Title::makeTitle( NS_USER, $this->BlockAddress ) ); + # Only show watch link when this is no range block + if( $this->BlockWatchUser && $block->mRangeStart == $block->mRangeEnd ) { + $wgUser->addWatch( Title::makeTitle( NS_USER, $this->BlockAddress ) ); } # Block constructor sanitizes certain block options on insert @@ -481,7 +480,20 @@ } } - public static function suppressUserName( $name, $userId ) { + public static function suppressUserName( $name, $userId, $reason = '' ) { + $user = User::newFromName( $name, false ); + # Delete the user pages that exists + $title = $user->getUserPage(); + if( ($id = $title->getArticleID(GAID_FOR_UPDATE)) ) { + $article = new Article( $title ); + $article->doDeleteArticle( $reason, true /*suppress*/, $id ); + } + # Delete the user talk pages that exists + $title = $user->getTalkPage(); + if( $id = $title->getArticleID(GAID_FOR_UPDATE) ) { + $article = new Article( $title ); + $article->doDeleteArticle( $reason, true /*suppress*/, $id ); + } $op = '|'; // bitwise OR return self::setUsernameBitfields( $name, $userId, $op ); } Modified: trunk/phase3/includes/specials/SpecialRevisiondelete.php === --- trunk/phase3/includes/specials/SpecialRevisiondelete.php2009-04-22 23:52:00 UTC (rev 49741) +++ trunk/phase3/includes/specials/SpecialRevisiondelete.php2009-04-23 00:50:54 UTC (rev 49742) @@ -85,16 +85,15 @@ $this->showImages(); } else if( $this->deleteKey == 'logid' ) { $this->showLogItems(); - return; // no logs for now } - list($qc,$lim) = $this->getLogQueryCond(); + $qc = $this->getLogQueryCond(); # Show relevant lines from the deletion log $wgOut->addHTML( "" . htmlspecialchars( LogPage::logName( 'delete' ) ) . "\n" ); - LogEventsList::showLogExtract( $wgOut, 'delete', $this->page->getPrefixedText(), '', $lim, $qc ); + LogEventsList::showLogExtract( $wgOut, 'delete', $this->page->getPrefixedText(), '', 25, $qc ); # Show relevant lines from the suppression log if( $wgUser->isAllowed( 'suppressionlog' ) ) { $wgOut->addHTML( "" . htmlspecialchars( LogPage::logName( 'suppress' ) ) . "\n" ); - LogEventsList::showLogExtract( $wgOut, 'suppress', $this->page->getPrefixedText(), '', $lim, $qc ); + LogEventsList::showLogExtract( $wgOut, 'suppress', $this->page->getPrefixedText(), '', 25, $qc ); } } @@ -121,9 +120,7 @@ } private function getLogQueryCond() { - $ids = $safeIds = array(); - $limit = 25; // default - $conds = array( 'log_action' => 'revision' ); // revision delete logs + $logAction = 're
[MediaWiki-CVS] SVN: [49743] trunk/phase3/includes/specials/SpecialRevisiondelete.php
Revision: 49743 Author: aaron Date: 2009-04-23 00:52:35 + (Thu, 23 Apr 2009) Log Message: --- revert code from r49742 accidentally committed Modified Paths: -- trunk/phase3/includes/specials/SpecialRevisiondelete.php Modified: trunk/phase3/includes/specials/SpecialRevisiondelete.php === --- trunk/phase3/includes/specials/SpecialRevisiondelete.php2009-04-23 00:50:54 UTC (rev 49742) +++ trunk/phase3/includes/specials/SpecialRevisiondelete.php2009-04-23 00:52:35 UTC (rev 49743) @@ -85,15 +85,16 @@ $this->showImages(); } else if( $this->deleteKey == 'logid' ) { $this->showLogItems(); + return; // no logs for now } - $qc = $this->getLogQueryCond(); + list($qc,$lim) = $this->getLogQueryCond(); # Show relevant lines from the deletion log $wgOut->addHTML( "" . htmlspecialchars( LogPage::logName( 'delete' ) ) . "\n" ); - LogEventsList::showLogExtract( $wgOut, 'delete', $this->page->getPrefixedText(), '', 25, $qc ); + LogEventsList::showLogExtract( $wgOut, 'delete', $this->page->getPrefixedText(), '', $lim, $qc ); # Show relevant lines from the suppression log if( $wgUser->isAllowed( 'suppressionlog' ) ) { $wgOut->addHTML( "" . htmlspecialchars( LogPage::logName( 'suppress' ) ) . "\n" ); - LogEventsList::showLogExtract( $wgOut, 'suppress', $this->page->getPrefixedText(), '', 25, $qc ); + LogEventsList::showLogExtract( $wgOut, 'suppress', $this->page->getPrefixedText(), '', $lim, $qc ); } } @@ -120,7 +121,9 @@ } private function getLogQueryCond() { - $logAction = 'revision'; + $ids = $safeIds = array(); + $limit = 25; // default + $conds = array( 'log_action' => 'revision' ); // revision delete logs switch( $this->deleteKey ) { case 'oldid': $ids = $this->oldids; @@ -134,19 +137,25 @@ case 'fileid': $ids = $this->fileids; break; - case 'logid': - $ids = $this->logids; - $logAction = 'event'; - break; default: // bad type? - return array(); + return array($conds,$limit); } - // Revision delete logs for these item - $conds = array( 'log_action' => $logAction ); - $conds['ls_field'] = RevisionDeleter::getRelationType( $this->deleteKey ); - $conds['ls_value'] = $ids; - $conds[] = 'log_id = ls_log_id'; - return $conds; + // Just get the whole log if there are a lot if items + if( count($ids) > $limit ) + return array($conds,$limit); + // Digit chars only + foreach( $ids as $id ) { + if( preg_match( '/^\d+$/', $id, $m ) ) { + $safeIds[] = $m[0]; + } + } + // Format is + if( count($safeIds) ) { + $conds[] = "log_params RLIKE '^{$this->deleteKey}.*(^|\n|,)(".implode('|',$safeIds).")(,|\n|$)'"; + } else { + $conds = array('1=0'); + } + return array($conds,$limit); } private function secureOperation() { @@ -1532,41 +1541,18 @@ $param, $items = array() ) { // Put things hidden from sysops in the oversight log - $logType = ( ($nbitfield | $obitfield) & Revision::DELETED_RESTRICTED ) ? + $logtype = ( ($nbitfield | $obitfield) & Revision::DELETED_RESTRICTED ) ? 'suppress' : 'delete'; - // Log deletions show with a difference action message - $logAction = ( $param == 'logid' ) ? 'event' : 'revision'; - // Track what items changed here + $log = new LogPage( $logtype );
[MediaWiki-CVS] SVN: [49849] trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php
Revision: 49849 Author: aaron Date: 2009-04-25 00:46:28 + (Sat, 25 Apr 2009) Log Message: --- Parenthesis style tweak Modified Paths: -- trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php Modified: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php === --- trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php 2009-04-24 23:11:07 UTC (rev 49848) +++ trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php 2009-04-25 00:46:28 UTC (rev 49849) @@ -1348,7 +1348,7 @@ public static function onSkinAfterContent( &$data ) { global $wgOut; - if( $wgOut->isArticleRelated() && $fa = FlaggedArticle::getGlobalInstance() ) { + if( $wgOut->isArticleRelated() && ($fa = FlaggedArticle::getGlobalInstance()) ) { $fa->addReviewNotes( $data ); $fa->addReviewForm( $data ); $fa->addFeedbackForm( $data ); ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [49851] trunk/extensions/FlaggedRevs
Revision: 49851 Author: aaron Date: 2009-04-25 01:32:46 + (Sat, 25 Apr 2009) Log Message: --- Tweak for bug 17275: no need to lock other session reads just for consistent reads here Modified Paths: -- trunk/extensions/FlaggedRevs/FlaggedRevision.php trunk/extensions/FlaggedRevs/FlaggedRevs.class.php trunk/extensions/FlaggedRevs/specialpages/RevisionReview_body.php Modified: trunk/extensions/FlaggedRevs/FlaggedRevision.php === --- trunk/extensions/FlaggedRevs/FlaggedRevision.php2009-04-25 00:58:17 UTC (rev 49850) +++ trunk/extensions/FlaggedRevs/FlaggedRevision.php2009-04-25 01:32:46 UTC (rev 49851) @@ -69,8 +69,7 @@ # User master/slave as appropriate if( $flags & FR_FOR_UPDATE || $flags & FR_MASTER ) { $db = wfGetDB( DB_MASTER ); - if( $flags & FR_FOR_UPDATE ) - $options[] = 'FOR UPDATE'; + if( $flags & FR_FOR_UPDATE ) $options[] = 'FOR UPDATE'; } else { $db = wfGetDB( DB_SLAVE ); } @@ -86,7 +85,8 @@ 'fr_rev_id' => $revId, 'rev_id = fr_rev_id', 'rev_page = fr_page_id', - 'rev_deleted & '.Revision::DELETED_TEXT => 0 ), + 'rev_deleted & '.Revision::DELETED_TEXT => 0 + ), __METHOD__, $options ); @@ -125,7 +125,8 @@ $columns, array( 'fp_page_id' => $pageId, 'fr_page_id = fp_page_id', - 'fr_rev_id = fp_stable' ), + 'fr_rev_id = fp_stable' + ), __METHOD__ ); if( !$row ) return null; @@ -139,7 +140,7 @@ } $dbw = wfGetDB( DB_MASTER ); $options['ORDER BY'] = 'fr_rev_id DESC'; - if( $flags & FR_FOR_UPDATE ) $options[] = 'FOR UPDATE'; + if( $flags & FR_FOR_UPDATE ) $options[] = 'LOCK IN SHARE MODE'; # Look for the latest pristine revision... if( FlaggedRevs::pristineVersions() && $config['select'] != FLAGGED_VIS_LATEST ) { $prow = $dbw->selectRow( array('flaggedrevs','revision'), @@ -148,7 +149,8 @@ 'fr_quality = 2', 'rev_id = fr_rev_id', 'rev_page = fr_page_id', - 'rev_deleted & '.Revision::DELETED_TEXT => 0 ), + 'rev_deleted & '.Revision::DELETED_TEXT => 0 + ), __METHOD__, $options ); @@ -168,7 +170,8 @@ $newerClause, 'rev_id = fr_rev_id', 'rev_page = fr_page_id', - 'rev_deleted & '.Revision::DELETED_TEXT => 0 ), + 'rev_deleted & '.Revision::DELETED_TEXT => 0 + ), __METHOD__, $options ); @@ -181,7 +184,8 @@ array( 'fr_page_id' => $pageId, 'rev_id = fr_rev_id', 'rev_page = fr_page_id', - 'rev_deleted & '.Revision::DELETED_TEXT => 0 ), + 'rev_deleted & '.Revision::DELETED_TEXT => 0 + ), __METHOD__, $options ); Modified: trunk/extensions/FlaggedRevs/Fl
[MediaWiki-CVS] SVN: [49852] trunk/extensions/FlaggedRevs/FlaggedRevision.php
Revision: 49852 Author: aaron Date: 2009-04-25 02:06:39 + (Sat, 25 Apr 2009) Log Message: --- Limit locking in newFromTitle() too Modified Paths: -- trunk/extensions/FlaggedRevs/FlaggedRevision.php Modified: trunk/extensions/FlaggedRevs/FlaggedRevision.php === --- trunk/extensions/FlaggedRevs/FlaggedRevision.php2009-04-25 01:32:46 UTC (rev 49851) +++ trunk/extensions/FlaggedRevs/FlaggedRevision.php2009-04-25 02:06:39 UTC (rev 49852) @@ -69,7 +69,7 @@ # User master/slave as appropriate if( $flags & FR_FOR_UPDATE || $flags & FR_MASTER ) { $db = wfGetDB( DB_MASTER ); - if( $flags & FR_FOR_UPDATE ) $options[] = 'FOR UPDATE'; + if( $flags & FR_FOR_UPDATE ) $options[] = 'LOCK IN SHARE MODE'; } else { $db = wfGetDB( DB_SLAVE ); } ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [49866] trunk
Revision: 49866 Author: aaron Date: 2009-04-25 10:09:38 + (Sat, 25 Apr 2009) Log Message: --- * Added actionfailed message * Pass some flaggedrevs input vars by value Modified Paths: -- trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php trunk/extensions/FlaggedRevs/FlaggedRevs.php trunk/extensions/FlaggedRevs/flaggedrevs.js trunk/phase3/languages/messages/MessagesEn.php trunk/phase3/maintenance/language/messages.inc Modified: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php === --- trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php 2009-04-25 09:56:09 UTC (rev 49865) +++ trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php 2009-04-25 10:09:38 UTC (rev 49866) @@ -39,7 +39,8 @@ $ajaxReview = Xml::encodeJsVar( (object) array( 'sendingMsg' => wfMsgHtml('revreview-submitting'), 'sentMsg' => wfMsgHtml('revreview-finished'), - 'actioncomplete' => wfMsgHtml('actioncomplete') + 'actioncomplete' => wfMsgHtml('actioncomplete'), + 'actionfailed' => wfMsgHtml('actionfailed') ) ); @@ -790,8 +791,8 @@ /** * When an user makes a null-edit we sometimes want to review it... */ - public static function maybeNullEditReview( $article, $user, &$text, &$summary, &$m, &$a, &$b, - &$f, $rev, &$s, $baseId ) + public static function maybeNullEditReview( $article, $user, $text, $summary, $m, $a, $b, + $flags, $rev, &$status, $baseId ) { global $wgRequest; # Must be in reviewable namespace Modified: trunk/extensions/FlaggedRevs/FlaggedRevs.php === --- trunk/extensions/FlaggedRevs/FlaggedRevs.php2009-04-25 09:56:09 UTC (rev 49865) +++ trunk/extensions/FlaggedRevs/FlaggedRevs.php2009-04-25 10:09:38 UTC (rev 49866) @@ -266,7 +266,7 @@ $wgAvailableRights[] = 'stablesettings'; # Bump this number every time you change flaggedrevs.css/flaggedrevs.js -$wgFlaggedRevStyleVersion = 58; +$wgFlaggedRevStyleVersion = 59; $wgExtensionFunctions[] = 'efLoadFlaggedRevs'; Modified: trunk/extensions/FlaggedRevs/flaggedrevs.js === --- trunk/extensions/FlaggedRevs/flaggedrevs.js 2009-04-25 09:56:09 UTC (rev 49865) +++ trunk/extensions/FlaggedRevs/flaggedrevs.js 2009-04-25 10:09:38 UTC (rev 49866) @@ -235,7 +235,8 @@ wgAjaxReview = { sendingMsg: "Submitting...", sentMsg: "Submitted", - actioncomplete: "Action complete" + actioncomplete: "Action complete", + actionfailed: "Action failed" }; } @@ -349,8 +350,10 @@ } if( response.indexOf('') == 0 ) { wgAjaxReview.unlockForm(); + document.title = wgAjaxReview.actioncomplete; + } else { + document.title = wgAjaxReview.actionfailed; } - document.title = wgAjaxReview.actioncomplete; }; wgAjaxReview.onLoad = function() { Modified: trunk/phase3/languages/messages/MessagesEn.php === --- trunk/phase3/languages/messages/MessagesEn.php 2009-04-25 09:56:09 UTC (rev 49865) +++ trunk/phase3/languages/messages/MessagesEn.php 2009-04-25 10:09:38 UTC (rev 49866) @@ -2415,6 +2415,7 @@ 'confirmdeletetext' => 'You are about to delete a page along with all of its history. Please confirm that you intend to do this, that you understand the consequences, and that you are doing this in accordance with [[{{MediaWiki:Policy-url}}|the policy]].', 'actioncomplete' => 'Action complete', +'actionfailed' => 'Action failed', 'deletedtext'=> '"$1" has been deleted. See $2 for a record of recent deletions.', 'deletedarticle' => 'deleted "[[$1]]"', Modified: trunk/phase3/maintenance/language/messages.inc === --- trunk/phase3/maintenance/language/messages.inc 2009-04-25 09:56:09 UTC (rev 49865) +++ trunk/phase3/maintenance/language/messages.inc 2009-04-25 10:09:38 UTC (rev 49866) @@ -1635,6 +1635,7 @@ 'historywarning', 'confirmdeletetext', 'actioncomplete', + 'actionfailed', 'deletedtext', 'deletedarticle', 'suppressedarticle', ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [49889] trunk/phase3/includes/Article.php
Revision: 49889 Author: aaron Date: 2009-04-26 01:00:36 + (Sun, 26 Apr 2009) Log Message: --- Tweak for bug 17275: reduce autoreview transaction time by moving hook after RC stuff Modified Paths: -- trunk/phase3/includes/Article.php Modified: trunk/phase3/includes/Article.php === --- trunk/phase3/includes/Article.php 2009-04-25 21:44:25 UTC (rev 49888) +++ trunk/phase3/includes/Article.php 2009-04-26 01:00:36 UTC (rev 49889) @@ -1680,7 +1680,6 @@ $dbw->rollback(); } else { global $wgUseRCPatrol; - wfRunHooks( 'NewRevisionFromEditComplete', array($this, $revision, $baseRevId, $user) ); # Update recentchanges if( !( $flags & EDIT_SUPPRESS_RC ) ) { # Mark as patrolled if the user can do so @@ -1695,6 +1694,8 @@ PatrolLog::record( $rc, true ); } } + # Notify extensions of a new edit + wfRunHooks( 'NewRevisionFromEditComplete', array(&$this, $revision, $baseRevId, $user) ); $user->incEditCount(); $dbw->commit(); } @@ -1761,7 +1762,6 @@ # Update the page record with revision data $this->updateRevisionOn( $dbw, $revision, 0 ); - wfRunHooks( 'NewRevisionFromEditComplete', array($this, $revision, false, $user) ); # Update recentchanges if( !( $flags & EDIT_SUPPRESS_RC ) ) { global $wgUseRCPatrol, $wgUseNPPatrol; @@ -1775,6 +1775,8 @@ PatrolLog::record( $rc, true ); } } + # Notify extensions of a new page edit + wfRunHooks( 'NewRevisionFromEditComplete', array(&$this, $revision, false, $user) ); $user->incEditCount(); $dbw->commit(); ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [49895] trunk/extensions/FlaggedRevs
Revision: 49895 Author: aaron Date: 2009-04-26 10:51:33 + (Sun, 26 Apr 2009) Log Message: --- * Split up updateArticleOn() and fix some cases where tracking updates were not done as needed * Streamlined updateArticleOn() by removing count cache update Modified Paths: -- trunk/extensions/FlaggedRevs/FlaggedRevs.class.php trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php trunk/extensions/FlaggedRevs/maintenance/updateLinks.inc Modified: trunk/extensions/FlaggedRevs/FlaggedRevs.class.php === --- trunk/extensions/FlaggedRevs/FlaggedRevs.class.php 2009-04-26 06:49:25 UTC (rev 49894) +++ trunk/extensions/FlaggedRevs/FlaggedRevs.class.php 2009-04-26 10:51:33 UTC (rev 49895) @@ -783,9 +783,9 @@ * @param mixed $latest, the latest rev ID (optional) * Updates the flaggedpages fields */ - public static function updateArticleOn( $article, $rev, $latest=NULL ) { - if( !$article->getId() ) return true; // no bogus entries - $revId = $rev->getId(); + public static function updateStableVersion( $article, $rev, $latest = NULL ) { + if( !$article->getId() ) + return true; // no bogus entries # Get the latest revision ID $lastID = $latest ? $latest : $article->getTitle()->getLatestRevID(GAID_FOR_UPDATE); # Get the highest quality revision (not necessarily this one) @@ -801,6 +801,7 @@ array( 'ORDER BY' => 'fr_quality DESC', 'LIMIT' => 1 ) ); # Get the timestamp of the edit after the stable version (if any) + $revId = $rev->getId(); if( $lastID != $revId ) { # Get the latest revision ID $timestamp = $rev->getTimestamp(); @@ -825,19 +826,34 @@ __METHOD__ ); # Alter pending edit tracking table + self::updatePendingList( $article, $latest ); + return true; + } + + /** + * @param Article $article + * @param mixed $latest, the latest rev ID (optional) + * Updates the flaggedpage_pending table + */ + public static function updatePendingList( $article, $latest = NULL ) { $data = array(); $level = self::pristineVersions() ? 2 : 1; if( !self::qualityVersions() ) $level--; + # Get the latest revision ID + $lastID = $latest ? $latest : $article->getTitle()->getLatestRevID(GAID_FOR_UPDATE); + $pageId = $article->getId(); # Update pending times for each level + $dbw = wfGetDB( DB_MASTER ); while( $level >= 0 ) { # Get the latest revision of this level... $row = $dbw->selectRow( array('flaggedrevs','revision'), array( 'fr_rev_id', 'rev_timestamp' ), - array( 'fr_page_id' => $article->getId(), + array( 'fr_page_id' => $pageId, 'fr_quality' => $level, 'rev_id = fr_rev_id', 'rev_page = fr_page_id', - 'rev_deleted & '.Revision::DELETED_TEXT => 0 ), + 'rev_deleted & '.Revision::DELETED_TEXT => 0 + ), __METHOD__, array( 'ORDER BY' => 'fr_rev_id DESC', 'LIMIT' => 1 ) ); @@ -848,13 +864,13 @@ if( $lastID != $id ) { $nextTimestamp = $dbw->selectField( 'revision', 'rev_timestamp', - array( 'rev_page' => $article->getId(), + array( 'rev_page' => $pageId, "rev_timestamp > ".$dbw->addQuotes( $row->rev_timestamp ) ), __METHOD__, array( 'ORDER BY' => 'rev_timestamp ASC', 'LIMIT' => 1 ) ); $data[] = array( -
[MediaWiki-CVS] SVN: [49906] trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php
Revision: 49906 Author: aaron Date: 2009-04-26 15:59:43 + (Sun, 26 Apr 2009) Log Message: --- fixed typo from branch merge Modified Paths: -- trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php Modified: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php === --- trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php 2009-04-26 14:51:11 UTC (rev 49905) +++ trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php 2009-04-26 15:59:43 UTC (rev 49906) @@ -1220,7 +1220,7 @@ array( 'type' => 'toggle', 'section' => 'flaggedrevs', - 'label-message' => 'flaggedrevs-pref-watch', + 'label-message' => 'flaggedrevs-prefs-watch', ); } ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [49994] trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php
Revision: 49994 Author: aaron Date: 2009-04-28 04:00:26 + (Tue, 28 Apr 2009) Log Message: --- Minor cleanups Modified Paths: -- trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php Modified: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php === --- trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php 2009-04-28 03:03:48 UTC (rev 49993) +++ trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php 2009-04-28 04:00:26 UTC (rev 49994) @@ -905,7 +905,6 @@ $p['revertedEdits']++; FlaggedRevs::saveUserParams( $badrev->getRawUser(), $p ); } - } return true; } @@ -1238,7 +1237,7 @@ * @param string $t timestamp of the log entry * @return bool true */ - public static function reviewLogLine( $type='', $action='', $title=null, $paramArray=array(), &$c='', &$r='' ) { + public static function reviewLogLine( $type='', $action='', $title=null, $paramArray=array(), &$c, &$r ) { $actionsValid = array('approve','approve2','approve-a','approve2-a','unapprove','unapprove2'); # Show link to page with oldid=x if( $type == 'review' && in_array($action,$actionsValid) && is_object($title) && isset($paramArray[0]) ) { @@ -1576,6 +1575,7 @@ public static function onParserTestTables( &$tables ) { $tables[] = 'flaggedpages'; $tables[] = 'flaggedrevs'; + $tables[] = 'flaggedpage_pending'; $tables[] = 'flaggedpage_config'; $tables[] = 'flaggedtemplates'; $tables[] = 'flaggedimages'; ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [50043] trunk/extensions/FlaggedRevs
Revision: 50043 Author: aaron Date: 2009-04-29 15:14:04 + (Wed, 29 Apr 2009) Log Message: --- Cleaned up addToHistLine() perms and $skin var cruft. Modified Paths: -- trunk/extensions/FlaggedRevs/FlaggedRevs.class.php trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php Modified: trunk/extensions/FlaggedRevs/FlaggedRevs.class.php === --- trunk/extensions/FlaggedRevs/FlaggedRevs.class.php 2009-04-29 13:43:37 UTC (rev 50042) +++ trunk/extensions/FlaggedRevs/FlaggedRevs.class.php 2009-04-29 15:14:04 UTC (rev 50043) @@ -1150,10 +1150,16 @@ * @param Row $row, from history page * @returns array (string,string) */ - public static function markHistoryRow( $title, $row, $skin ) { - if( isset($row->fr_quality) && isset($row->fr_flags) ) { + public static function markHistoryRow( $title, $row ) { + global $wgUser; + if( !isset($row->fr_quality) ) { + return array("",""); // not reviewed + } + $css = FlaggedRevsXML::getQualityColor( $row->fr_quality ); + if( $row->rev_deleted & Revision::DELETED_USER ) { + $link = ""; + } else { wfLoadExtensionMessages( 'FlaggedRevs' ); - $css = FlaggedRevsXML::getQualityColor( $row->fr_quality ); $user = User::whois( $row->fr_user ); // FIXME: o(N) $flags = explode(',',$row->fr_flags); if( in_array('auto',$flags) ) { @@ -1164,8 +1170,6 @@ $st = $title->getPrefixedDBkey(); $link = "[" . wfMsgExt($msg,array('parseinline'),$st,$row->rev_id,$user) . "]"; - } else { - return array("",""); } return array($link,$css); } Modified: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php === --- trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php 2009-04-29 13:43:37 UTC (rev 50042) +++ trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php 2009-04-29 15:14:04 UTC (rev 50043) @@ -1418,15 +1418,14 @@ } public static function addToHistLine( &$history, $row, &$s ) { - global $wgUser; if( $row->rev_deleted & Revision::DELETED_TEXT ) return true; // Don't bother showing notice for deleted revs - $skin = $wgUser->getSkin(); # Add link to stable version of *this* rev, if any - list($link,$class) = FlaggedRevs::markHistoryRow( $history->getArticle()->getTitle(), $row, $skin ); - if( $link ) { - $s = "$s $link"; - } + list($link,$class) = FlaggedRevs::markHistoryRow( $history->getArticle()->getTitle(), $row ); + # Style the row as needed + if( $class ) $s = "$s"; + # Add stable old version link + if( $link ) $s .= " $link"; return true; } ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [50070] trunk
Revision: 50070 Author: aaron Date: 2009-04-30 07:19:49 + (Thu, 30 Apr 2009) Log Message: --- Tweaked account hiding & renaming limits Modified Paths: -- trunk/extensions/Renameuser/SpecialRenameuser.php trunk/phase3/includes/specials/SpecialBlockip.php Modified: trunk/extensions/Renameuser/SpecialRenameuser.php === --- trunk/extensions/Renameuser/SpecialRenameuser.php 2009-04-30 06:00:01 UTC (rev 50069) +++ trunk/extensions/Renameuser/SpecialRenameuser.php 2009-04-30 07:19:49 UTC (rev 50070) @@ -32,8 +32,8 @@ * The maximum number of edits a user can have and still be allowed renaming, * set it to 0 to disable the limit. */ -define( 'RENAMEUSER_CONTRIBLIMIT', 200 ); -define( 'RENAMEUSER_CONTRIBJOB', 1 ); +define( 'RENAMEUSER_CONTRIBLIMIT', 100 ); +define( 'RENAMEUSER_CONTRIBJOB', 5000 ); # Add a new log type global $wgLogTypes, $wgLogNames, $wgLogHeaders, $wgLogActions; Modified: trunk/phase3/includes/specials/SpecialBlockip.php === --- trunk/phase3/includes/specials/SpecialBlockip.php 2009-04-30 06:00:01 UTC (rev 50069) +++ trunk/phase3/includes/specials/SpecialBlockip.php 2009-04-30 07:19:49 UTC (rev 50070) @@ -42,6 +42,8 @@ */ class IPBlockForm { var $BlockAddress, $BlockExpiry, $BlockReason; + // The maximum number of edits a user can have and still be hidden + const HIDEUSER_CONTRIBLIMIT = 1000; public function __construct( $par ) { global $wgRequest, $wgUser, $wgBlockAllowsUTEdit; @@ -397,7 +399,7 @@ } else if( $expiry !== 'infinity' ) { // Bad expiry. return array('ipb_expiry_temp'); - } else if( User::edits($userId) > 3000 ) { + } else if( User::edits($userId) > self::HIDEUSER_CONTRIBLIMIT ) { // Typically, the user should have a handful of edits. // Disallow hiding users with many edits for performance. return array('ipb_hide_invalid'); ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [50096] trunk/extensions/ConfirmAccount/SpecialConfirmAccount.php
Revision: 50096 Author: aaron Date: 2009-05-01 06:33:08 + (Fri, 01 May 2009) Log Message: --- Add default tables on update.php Modified Paths: -- trunk/extensions/ConfirmAccount/SpecialConfirmAccount.php Modified: trunk/extensions/ConfirmAccount/SpecialConfirmAccount.php === --- trunk/extensions/ConfirmAccount/SpecialConfirmAccount.php 2009-05-01 06:31:08 UTC (rev 50095) +++ trunk/extensions/ConfirmAccount/SpecialConfirmAccount.php 2009-05-01 06:33:08 UTC (rev 50096) @@ -218,15 +218,19 @@ $base = dirname(__FILE__); if( $wgDBtype == 'mysql' ) { + $wgExtNewTables[] = array('account_requests', "$base/confirmaccount.sql" ); + $wgExtNewFields[] = array('account_requests', 'acr_filename', "$base/archives/patch-acr_filename.sql" ); - + $wgExtNewTables[] = array('account_credentials', "$base/archives/patch-account_credentials.sql" ); $wgExtNewFields[] = array('account_requests', 'acr_areas', "$base/archives/patch-acr_areas.sql" ); $wgExtNewIndexes[] = array('account_requests', 'acr_email', "$base/archives/patch-email-index.sql" ); } else if( $wgDBtype == 'postgres' ) { + $wgExtNewTables[] = array('account_requests', "$base/confirmaccount.pg.sql" ); + $wgExtPGNewFields[] = array('account_requests', 'acr_held', "TIMESTAMPTZ" ); $wgExtPGNewFields[] = array('account_requests', 'acr_filename', "TEXT" ); $wgExtPGNewFields[] = array('account_requests', 'acr_storage_key', "TEXT" ); ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [50103] trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php
Revision: 50103 Author: aaron Date: 2009-05-01 12:41:36 + (Fri, 01 May 2009) Log Message: --- Move auto-watch option to watchlist section Modified Paths: -- trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php Modified: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php === --- trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php 2009-05-01 10:31:55 UTC (rev 50102) +++ trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php 2009-05-01 12:41:36 UTC (rev 50103) @@ -1218,7 +1218,7 @@ $preferences['flaggedrevswatch'] = array( 'type' => 'toggle', - 'section' => 'flaggedrevs', + 'section' => 'watchlist', 'label-message' => 'flaggedrevs-prefs-watch', ); } ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [50117] trunk/extensions/FlaggedRevs/maintenance/updateStats.inc
Revision: 50117 Author: aaron Date: 2009-05-02 06:19:35 + (Sat, 02 May 2009) Log Message: --- force index broken on new wikis due to index renaming of revision table Modified Paths: -- trunk/extensions/FlaggedRevs/maintenance/updateStats.inc Modified: trunk/extensions/FlaggedRevs/maintenance/updateStats.inc === --- trunk/extensions/FlaggedRevs/maintenance/updateStats.inc2009-05-02 06:15:20 UTC (rev 50116) +++ trunk/extensions/FlaggedRevs/maintenance/updateStats.inc2009-05-02 06:19:35 UTC (rev 50117) @@ -167,7 +167,7 @@ 'GROUP BY' => 'rev_id', // stats are for each edit and ID is unique 'ORDER BY' => 'rev_id ASC', // slight bias avoidance, if any 'LIMIT' => $size, // sample size - 'USE INDEX' => array('revision' => array('PRIMARY','rev_id'),'flaggedrevs' => 'PRIMARY','logging' => 'page_time') + 'USE INDEX' => array('flaggedrevs' => 'PRIMARY','logging' => 'page_time') ), array( // Assumes title unchanged (reasonable). Double-check NS though. 'page' => array('INNER JOIN',array('page_id = rev_page','page_namespace' => $wgFlaggedRevsNamespaces)), ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [50128] trunk/phase3/includes/LogEventsList.php
Revision: 50128 Author: aaron Date: 2009-05-02 13:42:51 + (Sat, 02 May 2009) Log Message: --- Fixed total log breakage due to type safety issues Modified Paths: -- trunk/phase3/includes/LogEventsList.php Modified: trunk/phase3/includes/LogEventsList.php === --- trunk/phase3/includes/LogEventsList.php 2009-05-02 13:39:48 UTC (rev 50127) +++ trunk/phase3/includes/LogEventsList.php 2009-05-02 13:42:51 UTC (rev 50128) @@ -546,7 +546,7 @@ private function limitType( $types ) { global $wgLogRestrictions, $wgUser; // If $types is not an array, make it an array - $types = (array)$types; + $types = ($types === '') ? array() : (array)$types; // Don't even show header for private logs; don't recognize it... foreach ( $types as $type ) { if( isset( $wgLogRestrictions[$type] ) && !$wgUser->isAllowed($wgLogRestrictions[$type]) ) { @@ -560,7 +560,7 @@ if( $hideLogs !== false ) { $this->mConds[] = $hideLogs; } - if( $types ) { + if( count($types) > 0 ) { $this->type = $types; $this->mConds['log_type'] = $types; } ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [50131] trunk/phase3/includes/LogEventsList.php
Revision: 50131 Author: aaron Date: 2009-05-02 14:34:45 + (Sat, 02 May 2009) Log Message: --- Fixed dropdown selector display and other log type issues due to string -> array conversion Modified Paths: -- trunk/phase3/includes/LogEventsList.php Modified: trunk/phase3/includes/LogEventsList.php === --- trunk/phase3/includes/LogEventsList.php 2009-05-02 14:24:11 UTC (rev 50130) +++ trunk/phase3/includes/LogEventsList.php 2009-05-02 14:34:45 UTC (rev 50131) @@ -60,7 +60,7 @@ /** * Show options for the log list -* @param $type String +* @param $types string or Array * @param $user String * @param $page String * @param $pattern String @@ -69,32 +69,38 @@ * @param $filter: array * @param $tagFilter: array? */ - public function showOptions( $type = '', $user = '', $page = '', $pattern = '', $year = '', - $month = '', $filter = null, $tagFilter='' ) + public function showOptions( $types=array(), $user='', $page='', $pattern='', $year='', + $month = '', $filter = null, $tagFilter='' ) { global $wgScript, $wgMiserMode; $action = htmlspecialchars( $wgScript ); $title = SpecialPage::getTitleFor( 'Log' ); $special = htmlspecialchars( $title->getPrefixedDBkey() ); + // For B/C, we take strings, but make sure they are converted... + $types = ($types === '') ? array() : (array)$types; $tagSelector = ChangeTags::buildTagFilterSelector( $tagFilter ); $this->out->addHTML( "" . Xml::element( 'legend', array(), wfMsg( 'log' ) ) . Xml::hidden( 'title', $special ) . "\n" . - $this->getTypeMenu( $type ) . "\n" . + $this->getTypeMenu( $types ) . "\n" . $this->getUserInput( $user ) . "\n" . $this->getTitleInput( $page ) . "\n" . ( !$wgMiserMode ? ($this->getTitlePattern( $pattern )."\n") : "" ) . "" . Xml::dateMenu( $year, $month ) . "\n" . ( $tagSelector ? Xml::tags( 'p', null, implode( 'Â ', $tagSelector ) ) :'' ). "\n" . - ( $filter ? "".$this->getFilterLinks( $type, $filter )."\n" : "" ) . "\n" . + ( $filter ? "".$this->getFilterLinks( $filter )."\n" : "" ) . "\n" . Xml::submitButton( wfMsg( 'allpagessubmit' ) ) . "\n" . "" ); } - private function getFilterLinks( $logType, $filter ) { + /** +* @param $filter Array +* @return String: Formatted HTML +*/ + private function getFilterLinks( $filter ) { global $wgTitle, $wgLang; // show/hide links $messages = array( wfMsgHtml( 'show' ), wfMsgHtml( 'hide' ) ); @@ -128,10 +134,10 @@ } /** -* @param $queryType String +* @param $queryTypes Array * @return String: Formatted HTML */ - private function getTypeMenu( $queryType ) { + private function getTypeMenu( $queryTypes ) { global $wgLogRestrictions, $wgUser; $html = "\n"; @@ -148,6 +154,8 @@ // Second pass to sort by name ksort($typesByName); + // Note the query type + $queryType = count($queryTypes) == 1 ? $queryTypes[0] : ''; // Third pass generates sorted XHTML content foreach( $typesByName as $text => $type ) { $selected = ($type == $queryType); @@ -427,17 +435,17 @@ /** * Quick function to show a short log extract * @param $out OutputPage -* @param $type String +* @param $types String or Array * @param $page String * @param $user String * @param $lim Integer * @param $conds Array */ - public static function showLogExtract( $out, $type='', $page='', $user='', $lim=0, $conds=array() ) { + public static function showLogExtract( $out, $types=array(), $page='', $user='', $lim=
[MediaWiki-CVS] SVN: [50178] trunk/phase3/includes/specials/SpecialDeletedContributions.php
Revision: 50178 Author: aaron Date: 2009-05-04 13:40:09 + (Mon, 04 May 2009) Log Message: --- (bug 18666) Add show/hide links to deletedcontribs Modified Paths: -- trunk/phase3/includes/specials/SpecialDeletedContributions.php Modified: trunk/phase3/includes/specials/SpecialDeletedContributions.php === --- trunk/phase3/includes/specials/SpecialDeletedContributions.php 2009-05-04 13:32:50 UTC (rev 50177) +++ trunk/phase3/includes/specials/SpecialDeletedContributions.php 2009-05-04 13:40:09 UTC (rev 50178) @@ -106,10 +106,9 @@ * @todo This would probably look a lot nicer in a table. */ function formatRow( $row ) { + global $wgUser, $wgLang; wfProfileIn( __METHOD__ ); - global $wgLang; - $sk = $this->getSkin(); $rev = new Revision( array( @@ -164,8 +163,23 @@ $mflag = ''; } + if( $wgUser->isAllowed( 'deleterevision' ) ) { + // If revision was hidden from sysops + if( !$rev->userCan( Revision::DELETED_RESTRICTED ) ) { + $del = Xml::tags( 'span', array( 'class'=>'mw-revdelundel-link' ), + '(' . $this->message['rev-delundel'] . ')' ) . ' '; + // Otherwise, show the link... + } else { + $query = array( 'target' => $page->getPrefixedDbkey(), + 'artimestamp' => $rev->getTimestamp() ); + $del = $this->mSkin->revDeleteLink( $query, + $rev->isDeleted( Revision::DELETED_RESTRICTED ) ) . ' '; + } + } else { + $del = ''; + } - $ret = "{$link} ($last) ({$dellog}) ({$reviewlink}) . . {$mflag} {$pagelink} {$comment}"; + $ret = "{$del}{$link} ({$last}) ({$dellog}) ({$reviewlink}) . . {$mflag} {$pagelink} {$comment}"; if( $rev->isDeleted( Revision::DELETED_TEXT ) ) { $ret .= ' ' . wfMsgHtml( 'deletedrev' ); } ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [50177] trunk/phase3/includes/specials/SpecialContributions.php
Revision: 50177 Author: aaron Date: 2009-05-04 13:32:50 + (Mon, 04 May 2009) Log Message: --- (bug 18666) Add show/hide to contribs Modified Paths: -- trunk/phase3/includes/specials/SpecialContributions.php Modified: trunk/phase3/includes/specials/SpecialContributions.php === --- trunk/phase3/includes/specials/SpecialContributions.php 2009-05-04 13:30:57 UTC (rev 50176) +++ trunk/phase3/includes/specials/SpecialContributions.php 2009-05-04 13:32:50 UTC (rev 50177) @@ -473,7 +473,7 @@ * @todo This would probably look a lot nicer in a table. */ function formatRow( $row ) { - global $wgLang, $wgContLang; + global $wgUser, $wgLang, $wgContLang; wfProfileIn( __METHOD__ ); $sk = $this->getSkin(); @@ -532,8 +532,23 @@ } else { $mflag = ''; } + + if( $wgUser->isAllowed( 'deleterevision' ) ) { + // If revision was hidden from sysops + if( !$rev->userCan( Revision::DELETED_RESTRICTED ) ) { + $del = Xml::tags( 'span', array( 'class'=>'mw-revdelundel-link' ), + '(' . $this->message['rev-delundel'] . ')' ) . ' '; + // Otherwise, show the link... + } else { + $query = array( 'target' => $page->getPrefixedDbkey(), 'oldid' => $rev->getId() ); + $del = $this->mSkin->revDeleteLink( $query, + $rev->isDeleted( Revision::DELETED_RESTRICTED ) ) . ' '; + } + } else { + $del = ''; + } - $ret = "{$d} {$histlink} {$difftext} {$nflag}{$mflag} {$link}{$userlink} {$comment} {$topmarktext}"; + $ret = "{$del}{$d} {$histlink} {$difftext} {$nflag}{$mflag} {$link}{$userlink} {$comment} {$topmarktext}"; if( $rev->isDeleted( Revision::DELETED_TEXT ) ) { $ret .= ' ' . wfMsgHtml( 'deletedrev' ); } ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [50175] trunk
Revision: 50175 Author: aaron Date: 2009-05-04 13:14:54 + (Mon, 04 May 2009) Log Message: --- *(bug 18676) Fixed nonsensical cache invalidation on revision delete Modified Paths: -- trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php trunk/extensions/FlaggedRevs/FlaggedRevs.php trunk/phase3/includes/specials/SpecialRevisiondelete.php Modified: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php === --- trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php 2009-05-04 12:57:18 UTC (rev 50174) +++ trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php 2009-05-04 13:14:54 UTC (rev 50175) @@ -145,14 +145,23 @@ return true; } + /** + * Update flaggedrevs tracking tables + */ public static function onArticleDelete( &$article, &$user, $reason, $id ) { $dbw = wfGetDB( DB_MASTER ); - $dbw->delete( 'flaggedpage_config', - array( 'fpc_page_id' => $article->getID() ), - __METHOD__ - ); + $dbw->delete( 'flaggedpage_config', array( 'fpc_page_id' => $id ), __METHOD__ ); + $dbw->delete( 'flaggedpage_pending', array( 'fpp_page_id' => $id ), __METHOD__ ); return true; } + + /** + * Update stable version selection + */ + public static function onRevisionDelete( &$title ) { + FlaggedRevs::titleLinksUpdate( $title ); + return true; + } /** * Inject stable links on LinksUpdate Modified: trunk/extensions/FlaggedRevs/FlaggedRevs.php === --- trunk/extensions/FlaggedRevs/FlaggedRevs.php2009-05-04 12:57:18 UTC (rev 50174) +++ trunk/extensions/FlaggedRevs/FlaggedRevs.php2009-05-04 13:14:54 UTC (rev 50175) @@ -361,6 +361,7 @@ $wgHooks['LinksUpdate'][] = 'FlaggedRevsHooks::extraLinksUpdate'; # Clear dead config rows $wgHooks['ArticleDeleteComplete'][] = 'FlaggedRevsHooks::onArticleDelete'; +$wgHooks['ArticleRevisionVisiblitySet'][] = 'FlaggedRevsHooks::onRevisionDelete'; # Check on undelete/merge for changes to stable version $wgHooks['ArticleMergeComplete'][] = 'FlaggedRevsHooks::updateFromMerge'; $wgHooks['ArticleRevisionUndeleted'][] = 'FlaggedRevsHooks::updateFromRestore'; Modified: trunk/phase3/includes/specials/SpecialRevisiondelete.php === --- trunk/phase3/includes/specials/SpecialRevisiondelete.php2009-05-04 12:57:18 UTC (rev 50174) +++ trunk/phase3/includes/specials/SpecialRevisiondelete.php2009-05-04 13:14:54 UTC (rev 50175) @@ -1444,7 +1444,6 @@ $title->invalidateCache(); $this->dbw->commit(); // Commit the transaction before the purge is sent $title->purgeSquid(); - $title->touchLinks(); // Extensions that require referencing previous revisions may need this wfRunHooks( 'ArticleRevisionVisiblitySet', array( &$title ) ); } ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [50187] trunk/phase3/includes/specials/SpecialUndelete.php
Revision: 50187 Author: aaron Date: 2009-05-04 17:45:01 + (Mon, 04 May 2009) Log Message: --- (bug 18666) Add show/hide to deleted diffs Modified Paths: -- trunk/phase3/includes/specials/SpecialUndelete.php Modified: trunk/phase3/includes/specials/SpecialUndelete.php === --- trunk/phase3/includes/specials/SpecialUndelete.php 2009-05-04 17:23:12 UTC (rev 50186) +++ trunk/phase3/includes/specials/SpecialUndelete.php 2009-05-04 17:45:01 UTC (rev 50187) @@ -875,6 +875,22 @@ $targetPage = $rev->getTitle(); $targetQuery = 'oldid=' . $rev->getId(); } + // Add show/hide link if available + if( $wgUser->isAllowed( 'deleterevision' ) ) { + // If revision was hidden from sysops + if( !$rev->userCan( Revision::DELETED_RESTRICTED ) ) { + $del = ' ' . Xml::tags( 'span', array( 'class'=>'mw-revdelundel-link' ), + '(' . wfMsgHtml('rev-delundel') . ')' ); + // Otherwise, show the link... + } else { + $query = array( 'target' => $this->mTargetObj->getPrefixedDbkey(), + 'artimestamp' => $rev->getTimestamp() ); + $del = ' ' . $sk->revDeleteLink( $query, + $rev->isDeleted( Revision::DELETED_RESTRICTED ) ); + } + } else { + $del = ''; + } return '' . $sk->makeLinkObj( $targetPage, @@ -887,7 +903,7 @@ $sk->revUserTools( $rev ) . '' . '' . '' . - $sk->revComment( $rev ) . '' . + $sk->revComment( $rev ) . $del . '' . ''; } ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [50250] trunk/extensions/FlaggedRevs/FlaggedRevision.php
Revision: 50250 Author: aaron Date: 2009-05-06 02:57:30 + (Wed, 06 May 2009) Log Message: --- Break some lines Modified Paths: -- trunk/extensions/FlaggedRevs/FlaggedRevision.php Modified: trunk/extensions/FlaggedRevs/FlaggedRevision.php === --- trunk/extensions/FlaggedRevs/FlaggedRevision.php2009-05-05 23:27:47 UTC (rev 50249) +++ trunk/extensions/FlaggedRevs/FlaggedRevision.php2009-05-06 02:57:30 UTC (rev 50250) @@ -378,7 +378,8 @@ public function getTemplateVersions() { $templates = array(); $dbr = wfGetDB( DB_SLAVE ); - $res = $dbr->select( 'flaggedtemplates', '*', array('ft_rev_id' => $this->getRevId()), __METHOD__ ); + $res = $dbr->select( 'flaggedtemplates', '*', + array('ft_rev_id' => $this->getRevId()), __METHOD__ ); while( $row = $res->fetchObject() ) { if( !isset($templates[$row->ft_namespace]) ) { $templates[$row->ft_namespace] = array(); @@ -394,7 +395,8 @@ public function getFileVersions() { $files = array(); $dbr = wfGetDB( DB_SLAVE ); - $res = $dbr->select( 'flaggedimages', '*', array('fi_rev_id' => $this->getRevId()), __METHOD__ ); + $res = $dbr->select( 'flaggedimages', '*', + array('fi_rev_id' => $this->getRevId()), __METHOD__ ); while( $row = $res->fetchObject() ) { $files[$row->fi_name] = $row->fi_img_sha1; } ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [50296] trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php
Revision: 50296 Author: aaron Date: 2009-05-07 02:28:55 + (Thu, 07 May 2009) Log Message: --- Make sure 'view' link always shows the revision Modified Paths: -- trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php Modified: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php === --- trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php 2009-05-07 01:20:24 UTC (rev 50295) +++ trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php 2009-05-07 02:28:55 UTC (rev 50296) @@ -1261,7 +1261,8 @@ $r = '(' . wfMsgHtml('review-logentry-diff') . ')'; } $r .= ' (' . $wgUser->getSkin()->makeKnownLinkObj( $title, - wfMsgHtml('review-logentry-id',$paramArray[0]), "oldid={$paramArray[0]}&diff=prev") . ')'; + wfMsgHtml('review-logentry-id',$paramArray[0]), + "oldid={$paramArray[0]}&diff=prev&diffonly=0") . ')'; } return true; } ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [50297] trunk/extensions/FlaggedRevs
Revision: 50297 Author: aaron Date: 2009-05-07 02:55:56 + (Thu, 07 May 2009) Log Message: --- Line breaks & formatting tweaks Modified Paths: -- trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php trunk/extensions/FlaggedRevs/FlaggedRevs.php Modified: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php === --- trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php 2009-05-07 02:28:55 UTC (rev 50296) +++ trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php 2009-05-07 02:55:56 UTC (rev 50297) @@ -986,9 +986,12 @@ if( $article->getTitle()->isContentPage() ) { $pages = explode( ',', trim($p['uniqueContentPages']) ); // page IDs # Don't let this get bloated for no reason - if( count($pages) < $wgFlaggedRevsAutopromote['uniqueContentPages'] && !in_array($article->getId(),$pages) ) { + if( count($pages) < $wgFlaggedRevsAutopromote['uniqueContentPages'] + && !in_array($article->getId(),$pages) ) + { $pages[] = $article->getId(); - $p['uniqueContentPages'] = preg_replace('/^,/','',implode(',',$pages)); // clear any garbage + // Clear out any formatting garbage + $p['uniqueContentPages'] = preg_replace('/^,/','',implode(',',$pages)); } $p['totalContentEdits'] += 1; $changed = true; @@ -1246,7 +1249,9 @@ * @param string $t timestamp of the log entry * @return bool true */ - public static function reviewLogLine( $type='', $action='', $title=null, $paramArray=array(), &$c, &$r ) { + public static function reviewLogLine( $type='', $action='', $title=null, + $paramArray=array(), &$c, &$r ) + { $actionsValid = array('approve','approve2','approve-a','approve2-a','unapprove','unapprove2'); # Show link to page with oldid=x if( $type == 'review' && in_array($action,$actionsValid) && is_object($title) && isset($paramArray[0]) ) { @@ -1542,9 +1547,11 @@ if( empty($wgTitle) || $wgTitle->getNamespace() !== NS_SPECIAL ) { return true; // nothing to do here } + if( !$wgUser->isAllowed('review') ) + return true; // not relevant to user $watchlist = SpecialPage::getTitleFor( 'Watchlist' ); $recentchanges = SpecialPage::getTitleFor( 'Recentchanges' ); - if( $wgUser->isAllowed('review') && ($wgTitle->equals($watchlist) || $wgTitle->equals($recentchanges)) ) { + if( $wgTitle->equals($watchlist) || $wgTitle->equals($recentchanges) ) { $dbr = wfGetDB( DB_SLAVE ); $watchedOutdated = $dbr->selectField( array('watchlist','page','flaggedpages'), '1', array( 'wl_user' => $wgUser->getId(), @@ -1559,8 +1566,10 @@ wfMsgExt('flaggedrevs-watched-pending',array('parseinline')) . ""; # Otherwise, give a notice if there is a large backlog in general } else { - $pages = $dbr->estimateRowCount( 'page', '*', array('page_namespace' => $wgFlaggedRevsNamespaces), __METHOD__ ); - $unreviewed = $dbr->estimateRowCount( 'flaggedpages', '*', 'fp_pending_since IS NOT NULL', __METHOD__ ); + $pages = $dbr->estimateRowCount( 'page', '*', + array('page_namespace' => $wgFlaggedRevsNamespaces), __METHOD__ ); + $unreviewed = $dbr->estimateRowCount( 'flaggedpages', '*', + 'fp_pending_since IS NOT NULL', __METHOD__ ); if( ($unreviewed/$pages) > .02 ) { wfLoadExtensionMessages( 'FlaggedRevs' ); $notice .= "" . @@ -1576,7 +1585,9 @@ $table
[MediaWiki-CVS] SVN: [50298] trunk/extensions/FlaggedRevs/specialpages/RatingHistory_body. php
Revision: 50298 Author: aaron Date: 2009-05-07 03:09:00 + (Thu, 07 May 2009) Log Message: --- Don't show users in ratinghist page if less that two people Modified Paths: -- trunk/extensions/FlaggedRevs/specialpages/RatingHistory_body.php Modified: trunk/extensions/FlaggedRevs/specialpages/RatingHistory_body.php === --- trunk/extensions/FlaggedRevs/specialpages/RatingHistory_body.php 2009-05-07 02:55:56 UTC (rev 50297) +++ trunk/extensions/FlaggedRevs/specialpages/RatingHistory_body.php 2009-05-07 03:09:00 UTC (rev 50298) @@ -620,6 +620,8 @@ ); // Output multi-column list $total = $res->numRows(); + if( $total < 2 ) + return ''; // don't give away votes that easily $columns = 4; $count = 0; $html = ""; ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [50316] trunk/phase3
Revision: 50316 Author: aaron Date: 2009-05-07 18:30:26 + (Thu, 07 May 2009) Log Message: --- Removed StartProfiler.php from SVN control and added StartProfiler.sample file. The sample file can be moved to the former name to set profiling. MW will fall back to ProfilerStub.php as usual if there is no StartProfiler.php. Modified Paths: -- trunk/phase3/includes/WebStart.php Added Paths: --- trunk/phase3/StartProfiler.sample Removed Paths: - trunk/phase3/StartProfiler.php Property Changed: trunk/phase3/ Property changes on: trunk/phase3 ___ Modified: svn:ignore - LocalSettings.php AdminSettings.php StartProfiler.php favicon.ico *~ .classpath .project project.index .metadata* .settings static* + *~ .classpath .metadata* .project .settings AdminSettings.php LocalSettings.php StartProfiler.php favicon.ico project.index static* Deleted: trunk/phase3/StartProfiler.php === --- trunk/phase3/StartProfiler.php 2009-05-07 16:51:45 UTC (rev 50315) +++ trunk/phase3/StartProfiler.php 2009-05-07 18:30:26 UTC (rev 50316) @@ -1,22 +0,0 @@ -https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [50447] trunk/phase3/maintenance/archives/patch-log_search.sql
Revision: 50447 Author: aaron Date: 2009-05-10 18:06:00 + (Sun, 10 May 2009) Log Message: --- Tweak comment Modified Paths: -- trunk/phase3/maintenance/archives/patch-log_search.sql Modified: trunk/phase3/maintenance/archives/patch-log_search.sql === --- trunk/phase3/maintenance/archives/patch-log_search.sql 2009-05-10 17:45:02 UTC (rev 50446) +++ trunk/phase3/maintenance/archives/patch-log_search.sql 2009-05-10 18:06:00 UTC (rev 50447) @@ -1,5 +1,5 @@ CREATE TABLE /*_*/log_search ( - -- The type of ID (rev ID, log ID, timestamp, other) + -- The type of ID (rev ID, log ID, rev timestamp, username) ls_field varbinary(32) NOT NULL, -- The value of the ID ls_value varchar(255) NOT NULL, ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [50566] trunk/extensions/FlaggedRevs/FlaggedArticle.php
Revision: 50566 Author: aaron Date: 2009-05-13 21:52:52 + (Wed, 13 May 2009) Log Message: --- break some long lines here Modified Paths: -- trunk/extensions/FlaggedRevs/FlaggedArticle.php Modified: trunk/extensions/FlaggedRevs/FlaggedArticle.php === --- trunk/extensions/FlaggedRevs/FlaggedArticle.php 2009-05-13 21:36:13 UTC (rev 50565) +++ trunk/extensions/FlaggedRevs/FlaggedArticle.php 2009-05-13 21:52:52 UTC (rev 50566) @@ -76,10 +76,12 @@ $action = $wgRequest->getVal( 'action', 'view' ); if( !self::isViewAction($action) || !$this->isReviewable() ) return false; - # Does not apply to diffs/old revision. Explicit requests - # for a certain stable version will be handled elsewhere. - if( $wgRequest->getVal('oldid') || $wgRequest->getVal('diff') || $wgRequest->getVal('stableid') ) + # Does not apply to diffs/old revision... + if( $wgRequest->getVal('oldid') || $wgRequest->getVal('diff') ) return false; + # Explicit requests for a certain stable version handled elsewhere... + if( $wgRequest->getVal('stableid') ) + return false; # Check user preferences if( $wgUser->getOption('flaggedrevsstable') ) return !( $wgRequest->getIntOrNull('stable') === 0 ); @@ -235,7 +237,8 @@ if( !FlaggedRevs::useSimpleUI() && !empty($flags) ) { $tag .= " " . FlaggedRevsXML::ratingToggle() . "" . - wfMsgHtml('revreview-oldrating') . FlaggedRevsXML::addTagRatings( $flags ) . ''; + wfMsgHtml('revreview-oldrating') . + FlaggedRevsXML::addTagRatings( $flags ) . ''; } $tag = "$tag"; $wgOut->addHTML( $tag ); @@ -348,7 +351,8 @@ $msg = $quality ? 'revreview-quick-quality-old' : 'revreview-quick-basic-old'; $html = "{$prot}" . wfMsgExt( $msg, array('parseinline'), $frev->getRevId(), $time ); - $tag .= FlaggedRevsXML::prettyRatingBox( $frev, $html, $revsSince, true, false, $old ); + $tag .= FlaggedRevsXML::prettyRatingBox( $frev, $html, $revsSince, + true, false, $old ); // Standard UI } else { $msg = $quality ? 'revreview-quality-old' : 'revreview-basic-old'; @@ -413,18 +417,21 @@ } $tooltip = wfMsgHtml($tooltip); $msgHTML = "{$prot}$msgHTML"; - $tag .= FlaggedRevsXML::prettyRatingBox( $frev, $msgHTML, $revsSince, $synced, $synced, $old ); + $tag .= FlaggedRevsXML::prettyRatingBox( $frev, $msgHTML, $revsSince, + $synced, $synced, $old ); // Standard UI } else { if( $synced ) { $msg = $quality ? 'revreview-quality-same' : 'revreview-basic-same'; $class = $quality ? 'fr-icon-quality' : 'fr-icon-stable'; $tooltip = $quality ? 'revreview-quality-title' : 'revreview-stable-title'; - $msgHTML = wfMsgExt( $msg, array('parseinline'), $frev->getRevId(), $time, $revsSince ); + $msgHTML = wfMsgExt( $msg, array('parseinline'), $frev->getRevId(), + $time, $revsSince ); } else { $msg = $quality ? 'revreview-newest-quality' : 'revreview-newest-basic';
[MediaWiki-CVS] SVN: [50567] trunk/phase3
Revision: 50567 Author: aaron Date: 2009-05-13 22:03:32 + (Wed, 13 May 2009) Log Message: --- [schema change] Use new log_search table to replace ugly code from r48839. Maintenance script added to populate the table with revisiondelete log items. Modified Paths: -- trunk/phase3/includes/LogEventsList.php trunk/phase3/includes/LogPage.php trunk/phase3/includes/specials/SpecialRevisiondelete.php trunk/phase3/maintenance/tables.sql trunk/phase3/maintenance/updaters.inc Added Paths: --- trunk/phase3/maintenance/populateLogSearch.php Modified: trunk/phase3/includes/LogEventsList.php === --- trunk/phase3/includes/LogEventsList.php 2009-05-13 21:52:52 UTC (rev 50566) +++ trunk/phase3/includes/LogEventsList.php 2009-05-13 22:03:32 UTC (rev 50567) @@ -651,22 +651,29 @@ } public function getQueryInfo() { + $tables = array( 'logging', 'user' ); $this->mConds[] = 'user_id = log_user'; + $index = array(); + # Add log_search table if there are conditions on it + if( array_key_exists('ls_field',$this->mConds) ) { + $tables[] = 'log_search'; + $index = array( 'log_search' => 'PRIMARY', 'logging' => 'PRIMARY' ); # Don't use the wrong logging index - if( $this->title || $this->pattern || $this->user ) { - $index = array( 'USE INDEX' => array( 'logging' => array('page_time','user_time') ) ); + } else if( $this->title || $this->pattern || $this->user ) { + $index = array( 'logging' => array('page_time','user_time') ); } else if( $this->types ) { - $index = array( 'USE INDEX' => array( 'logging' => 'type_time' ) ); + $index = array( 'logging' => 'type_time' ); } else { - $index = array( 'USE INDEX' => array( 'logging' => 'times' ) ); + $index = array( 'logging' => 'times' ); } $info = array( - 'tables' => array( 'logging', 'user' ), + 'tables' => $tables, 'fields' => array( 'log_type', 'log_action', 'log_user', 'log_namespace', 'log_title', 'log_params', 'log_comment', 'log_id', 'log_deleted', 'log_timestamp', 'user_name', 'user_editcount' ), 'conds' => $this->mConds, - 'options' => $index, - 'join_conds' => array( 'user' => array( 'INNER JOIN', 'user_id=log_user' ) ), + 'options' => array( 'USE INDEX' => $index ), + 'join_conds' => array( 'user' => array( 'INNER JOIN', 'user_id=log_user' ), + 'log_search' => array( 'INNER JOIN', 'ls_log_id=log_id' ) ), ); ChangeTags::modifyDisplayQuery( $info['tables'], $info['fields'], $info['conds'], Modified: trunk/phase3/includes/LogPage.php === --- trunk/phase3/includes/LogPage.php 2009-05-13 21:52:52 UTC (rev 50566) +++ trunk/phase3/includes/LogPage.php 2009-05-13 22:03:32 UTC (rev 50567) @@ -91,7 +91,7 @@ $this->type, $this->action, $this->target, $this->comment, $this->params, $newId ); $rc->notifyRC2UDP(); } - return true; + return $newId; } /** @@ -373,6 +373,22 @@ return $this->saveContent(); } + + /** +* Add relations to log_search table +* @static +*/ + public function addRelations( $field, $values, $logid ) { + if( empty($values) ) + return false; // nothing + $data = array(); + foreach( $values as $value ) { + $data[] = array('ls_field' => $field,'ls_value' => $value,'l
[MediaWiki-CVS] SVN: [50568] trunk/phase3/includes/specials/SpecialRevisiondelete.php
Revision: 50568 Author: aaron Date: 2009-05-13 22:22:09 + (Wed, 13 May 2009) Log Message: --- Give failure message rather than assuming field 0 for trying to set field 8 (just suppressing a rev but not hiding anything) Modified Paths: -- trunk/phase3/includes/specials/SpecialRevisiondelete.php Modified: trunk/phase3/includes/specials/SpecialRevisiondelete.php === --- trunk/phase3/includes/specials/SpecialRevisiondelete.php2009-05-13 22:03:32 UTC (rev 50567) +++ trunk/phase3/includes/specials/SpecialRevisiondelete.php2009-05-13 22:22:09 UTC (rev 50568) @@ -851,7 +851,7 @@ $dbw = wfGetDB( DB_MASTER ); // Don't allow simply locking the interface for no reason if( $bitfield == Revision::DELETED_RESTRICTED ) { - $bitfield = 0; + return false; } $deleter = new RevisionDeleter( $dbw ); // By this point, only one of the below should be set ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [50597] trunk/phase3
Revision: 50597 Author: aaron Date: 2009-05-14 19:49:33 + (Thu, 14 May 2009) Log Message: --- Tweaks to r50567: * Improved exception handling * Removed redundant ls_log_id cond * Added log_type to getLogQueryCond() * Don't show duplicate rows in log results * populateLogSearch now handles an older log_param format Modified Paths: -- trunk/phase3/includes/LogEventsList.php trunk/phase3/includes/LogPage.php trunk/phase3/includes/specials/SpecialRevisiondelete.php trunk/phase3/maintenance/populateLogSearch.php Modified: trunk/phase3/includes/LogEventsList.php === --- trunk/phase3/includes/LogEventsList.php 2009-05-14 18:33:46 UTC (rev 50596) +++ trunk/phase3/includes/LogEventsList.php 2009-05-14 19:49:33 UTC (rev 50597) @@ -653,11 +653,13 @@ public function getQueryInfo() { $tables = array( 'logging', 'user' ); $this->mConds[] = 'user_id = log_user'; + $groupBy = false; $index = array(); # Add log_search table if there are conditions on it if( array_key_exists('ls_field',$this->mConds) ) { $tables[] = 'log_search'; $index = array( 'log_search' => 'PRIMARY', 'logging' => 'PRIMARY' ); + $groupBy = 'ls_log_id'; # Don't use the wrong logging index } else if( $this->title || $this->pattern || $this->user ) { $index = array( 'logging' => array('page_time','user_time') ); @@ -666,16 +668,22 @@ } else { $index = array( 'logging' => 'times' ); } + $options = array( 'USE INDEX' => $index ); + # Don't show duplicate rows when using log_search + if( $groupBy ) $options['GROUP BY'] = $groupBy; $info = array( - 'tables' => $tables, - 'fields' => array( 'log_type', 'log_action', 'log_user', 'log_namespace', 'log_title', 'log_params', - 'log_comment', 'log_id', 'log_deleted', 'log_timestamp', 'user_name', 'user_editcount' ), - 'conds' => $this->mConds, - 'options' => array( 'USE INDEX' => $index ), - 'join_conds' => array( 'user' => array( 'INNER JOIN', 'user_id=log_user' ), - 'log_search' => array( 'INNER JOIN', 'ls_log_id=log_id' ) ), + 'tables' => $tables, + 'fields' => array( 'log_type', 'log_action', 'log_user', 'log_namespace', + 'log_title', 'log_params', 'log_comment', 'log_id', 'log_deleted', + 'log_timestamp', 'user_name', 'user_editcount' ), + 'conds' => $this->mConds, + 'options'=> $options, + 'join_conds' => array( + 'user' => array( 'INNER JOIN', 'user_id=log_user' ), + 'log_search' => array( 'INNER JOIN', 'ls_log_id=log_id' ) + ) ); - + # Add ChangeTags filter query ChangeTags::modifyDisplayQuery( $info['tables'], $info['fields'], $info['conds'], $info['join_conds'], $info['options'], $this->mTagFilter ); Modified: trunk/phase3/includes/LogPage.php === --- trunk/phase3/includes/LogPage.php 2009-05-14 18:33:46 UTC (rev 50596) +++ trunk/phase3/includes/LogPage.php 2009-05-14 19:49:33 UTC (rev 50597) @@ -379,7 +379,7 @@ * @static */ public function addRelations( $field, $values, $logid ) { - if( empty($values) ) + if( !strlen($field) || empty($values) ) return false; // nothing $data = array(); foreach( $values as $value ) { Modified: trunk/phase3/includes/specials/SpecialRevision
[MediaWiki-CVS] SVN: [50620] trunk/phase3/maintenance/populateLogSearch.inc
Revision: 50620 Author: aaron Date: 2009-05-15 05:25:46 + (Fri, 15 May 2009) Log Message: --- Add newline to echo call Modified Paths: -- trunk/phase3/maintenance/populateLogSearch.inc Modified: trunk/phase3/maintenance/populateLogSearch.inc === --- trunk/phase3/maintenance/populateLogSearch.inc 2009-05-15 04:07:43 UTC (rev 50619) +++ trunk/phase3/maintenance/populateLogSearch.inc 2009-05-15 05:25:46 UTC (rev 50620) @@ -42,7 +42,7 @@ $field = RevisionDeleter::getRelationType($params[0]); } if( $field == null ) { - echo "Invalid param type for $row->log_id"; + echo "Invalid param type for $row->log_id\n"; continue; // skip this row } $items = explode(',',$params[1]); ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [50638] trunk/extensions/CheckUser
Revision: 50638 Author: aaron Date: 2009-05-15 18:04:00 + (Fri, 15 May 2009) Log Message: --- bug 18613 Make filling in the "reason" field for CheckUser checks compulsory Modified Paths: -- trunk/extensions/CheckUser/CheckUser.i18n.php trunk/extensions/CheckUser/CheckUser_body.php Modified: trunk/extensions/CheckUser/CheckUser.i18n.php === --- trunk/extensions/CheckUser/CheckUser.i18n.php 2009-05-15 17:58:46 UTC (rev 50637) +++ trunk/extensions/CheckUser/CheckUser.i18n.php 2009-05-15 18:04:00 UTC (rev 50638) @@ -60,6 +60,7 @@ 'checkuser-block-failure'=> '\'\'\'No users blocked.\'\'\'', 'checkuser-block-limit' => 'Too many users selected.', 'checkuser-block-noreason' => 'You must give a reason for the blocks.', + 'checkuser-noreason' => 'You must give a reason for this query.', 'checkuser-accounts' => '$1 new {{PLURAL:$1|account|accounts}}', 'checkuser-too-many' => 'Too many results, please narrow down the CIDR. Here are the IPs used (5000 max, sorted by address):', Modified: trunk/extensions/CheckUser/CheckUser_body.php === --- trunk/extensions/CheckUser/CheckUser_body.php 2009-05-15 17:58:46 UTC (rev 50637) +++ trunk/extensions/CheckUser/CheckUser_body.php 2009-05-15 18:04:00 UTC (rev 50638) @@ -245,7 +245,8 @@ if( !empty( $safeUsers ) ) { $n = count( $safeUsers ); $ulist = $wgLang->listToText( $safeUsers ); - $wgOut->addWikiText( wfMsgExt( 'checkuser-block-success', 'parsemag', $ulist, $wgLang->formatNum( $n ) ) ); + $wgOut->addWikiText( wfMsgExt( 'checkuser-block-success', 'parsemag', + $ulist, $wgLang->formatNum( $n ) ) ); } else { $wgOut->addWikiText( wfMsgExt( 'checkuser-block-failure', 'parsemag' ) ); } @@ -317,7 +318,13 @@ $wgOut->addHTML( $s ); return; } - + + # Demand that a reason be given + if( !$reason ) { + $wgOut->addWikiText( wfMsgExt('checkuser-noreason',array('parsemag')) ); + return; + } + # Record check... if( !$this->addLogEntry( 'userips', 'user', $user, $reason, $user_id ) ) { $wgOut->addHTML( ''.wfMsgHtml('checkuser-log-fail').'' ); } @@ -438,6 +445,11 @@ if( $xfor ) { $logType .= '-xff'; } + # Demand that a reason be given + if( !$reason ) { + $wgOut->addWikiText( wfMsgExt('checkuser-noreason',array('parsemag')) ); + return; + } # Record check... if( !$this->addLogEntry( $logType, 'ip', $ip, $reason ) ) { $wgOut->addWikiMsg( 'checkuser-log-fail' ); @@ -582,6 +594,11 @@ return; } + # Demand that a reason be given + if( !$reason ) { + $wgOut->addWikiText( wfMsgExt('checkuser-noreason',array('parsemag')) ); + return; + } # Record check... if( !$this->addLogEntry( 'useredits', 'user', $user, $reason, $user_id ) ) { $wgOut->addHTML( ''.wfMsgHtml('checkuser-log-fail').'' ); @@ -700,6 +717,11 @@ if( $xfor ) { $logType .= '-xff'; } + # Demand that a reason be given + if( !$reason ) { + $wgOut->addWikiText( wfMsgExt('checkuser-noreason',array('parsemag')) ); + return; + } # Log the check... if( !$this->addLogEntry( $logType, 'ip', $ip, $reason ) ) { $wgOut->addHTML( ''.wfMsgHtml('checkuser-log-fail').'' ); ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [50749] trunk/phase3/includes/Article.php
Revision: 50749 Author: aaron Date: 2009-05-18 20:21:12 + (Mon, 18 May 2009) Log Message: --- Removed unused broken line Modified Paths: -- trunk/phase3/includes/Article.php Modified: trunk/phase3/includes/Article.php === --- trunk/phase3/includes/Article.php 2009-05-18 20:20:58 UTC (rev 50748) +++ trunk/phase3/includes/Article.php 2009-05-18 20:21:12 UTC (rev 50749) @@ -3617,7 +3617,6 @@ $poTemplates = array(); foreach ( $parserOutput->getTemplates() as $ns => $templates ) { foreach ( $templates as $dbk => $id ) { - $key = $row->tl_namespace . ':'. $row->tl_title; $poTemplates["$ns:$dbk"] = true; } } ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [50754] trunk/extensions/FlaggedRevs/FlaggedArticle.php
Revision: 50754 Author: aaron Date: 2009-05-18 21:07:01 + (Mon, 18 May 2009) Log Message: --- (bug 18744) Suppress useless review link for deleted revs Modified Paths: -- trunk/extensions/FlaggedRevs/FlaggedArticle.php Modified: trunk/extensions/FlaggedRevs/FlaggedArticle.php === --- trunk/extensions/FlaggedRevs/FlaggedArticle.php 2009-05-18 20:58:00 UTC (rev 50753) +++ trunk/extensions/FlaggedRevs/FlaggedArticle.php 2009-05-18 21:07:01 UTC (rev 50754) @@ -1309,12 +1309,16 @@ if( !$this->isDiffFromStable ) { return false; // only safe to assume current if diff-to-stable } - $id = $this->parent->getTitle()->getLatestRevID(GAID_FOR_UPDATE); + $rev = Revision::newFromTitle( $this->parent->getTitle() ); + $id = $rev->getId(); + } else { + $rev = Revision::newFromTitle( $this->parent->getTitle(), $id ); } + # Load required messages wfLoadExtensionMessages( 'FlaggedRevs' ); - # Must be a valid non-printable output - if( !$id || $wgOut->isPrintable() ) { + # Must be a valid non-printable output and revision must be public + if( $wgOut->isPrintable() || !$rev || $rev->isDeleted(Revision::DELETED_TEXT) ) { return false; } $useCurrent = false; ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [50757] trunk/phase3/includes/Linker.php
Revision: 50757 Author: aaron Date: 2009-05-18 22:15:12 + (Mon, 18 May 2009) Log Message: --- Fixed bug in r49227; use raw function now Modified Paths: -- trunk/phase3/includes/Linker.php Modified: trunk/phase3/includes/Linker.php === --- trunk/phase3/includes/Linker.php2009-05-18 21:56:08 UTC (rev 50756) +++ trunk/phase3/includes/Linker.php2009-05-18 22:15:12 UTC (rev 50757) @@ -1384,7 +1384,7 @@ * @return string HTML */ function revComment( Revision $rev, $local = false, $isPublic = false ) { - if( $rev->getComment() == "" ) return ""; + if( $rev->getRawComment() == "" ) return ""; if( $rev->isDeleted( Revision::DELETED_COMMENT ) && $isPublic ) { $block = " " . wfMsgHtml( 'rev-deleted-comment' ) . ""; } else if( $rev->userCan( Revision::DELETED_COMMENT ) ) { ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [50788] trunk/phase3/includes
Revision: 50788 Author: aaron Date: 2009-05-19 19:19:41 + (Tue, 19 May 2009) Log Message: --- (bug 17060) Renders edit comments the same for all users wrt to revdelete Modified Paths: -- trunk/phase3/includes/LogEventsList.php trunk/phase3/includes/PageHistory.php Modified: trunk/phase3/includes/LogEventsList.php === --- trunk/phase3/includes/LogEventsList.php 2009-05-19 18:53:27 UTC (rev 50787) +++ trunk/phase3/includes/LogEventsList.php 2009-05-19 19:19:41 UTC (rev 50788) @@ -654,7 +654,6 @@ $tables = array( 'logging', 'user' ); $this->mConds[] = 'user_id = log_user'; $groupBy = false; - $index = array(); # Add log_search table if there are conditions on it if( array_key_exists('ls_field',$this->mConds) ) { $tables[] = 'log_search'; Modified: trunk/phase3/includes/PageHistory.php === --- trunk/phase3/includes/PageHistory.php 2009-05-19 18:53:27 UTC (rev 50787) +++ trunk/phase3/includes/PageHistory.php 2009-05-19 19:19:41 UTC (rev 50788) @@ -373,14 +373,11 @@ function revLink( $rev ) { global $wgLang; $date = $wgLang->timeanddate( wfTimestamp(TS_MW, $rev->getTimestamp()), true ); - if( $rev->userCan( Revision::DELETED_TEXT ) ) { + if( !$rev->isDeleted( Revision::DELETED_TEXT ) ) { $link = $this->mSkin->makeKnownLinkObj( $this->mTitle, $date, "oldid=" . $rev->getId() ); } else { - $link = $date; + $link = "$date"; } - if( $rev->isDeleted( Revision::DELETED_TEXT ) ) { - $link = "$link"; - } return $link; } ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [50995] trunk/extensions/FlaggedRevs/specialpages/RatingHistory_body. php
Revision: 50995 Author: aaron Date: 2009-05-26 00:07:50 + (Tue, 26 May 2009) Log Message: --- Removed error suppression Modified Paths: -- trunk/extensions/FlaggedRevs/specialpages/RatingHistory_body.php Modified: trunk/extensions/FlaggedRevs/specialpages/RatingHistory_body.php === --- trunk/extensions/FlaggedRevs/specialpages/RatingHistory_body.php 2009-05-25 21:58:51 UTC (rev 50994) +++ trunk/extensions/FlaggedRevs/specialpages/RatingHistory_body.php 2009-05-26 00:07:50 UTC (rev 50995) @@ -160,11 +160,11 @@ Xml::closeElement( 'div' ) . "\n"; } break; - default: + default: // use html table if( $exists ) { - $fp = @fopen( $filePath, 'r' ); + $fp = fopen( $filePath, 'r' ); $table = fread( $fp, filesize($filePath) ); - @fclose( $fp ); + fclose( $fp ); $html .= '' . wfMsgHtml("readerfeedback-$tag") . '' . $table . "\n"; } else if( $table = $this->makeHTMLTable( $tag, $filePath ) ) { $html .= '' . wfMsgHtml("readerfeedback-$tag") . '' . $table . "\n"; @@ -237,9 +237,9 @@ $chart .= "\n"; $chart .= Xml::closeElement( 'div' ); // Write to file for cache - $fp = @fopen( $filePath, 'w' ); - @fwrite( $fp, $chart ); - @fclose( $fp ); + $fp = fopen( $filePath, 'w' ); + fwrite( $fp, $chart ); + fclose( $fp ); return $chart; } ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [50996] trunk/extensions/FlaggedRevs
Revision: 50996 Author: aaron Date: 2009-05-26 00:24:30 + (Tue, 26 May 2009) Log Message: --- Replace some hard-coded integers with constants Modified Paths: -- trunk/extensions/FlaggedRevs/FlaggedRevision.php trunk/extensions/FlaggedRevs/FlaggedRevs.class.php trunk/extensions/FlaggedRevs/FlaggedRevs.php Modified: trunk/extensions/FlaggedRevs/FlaggedRevision.php === --- trunk/extensions/FlaggedRevs/FlaggedRevision.php2009-05-26 00:07:50 UTC (rev 50995) +++ trunk/extensions/FlaggedRevs/FlaggedRevision.php2009-05-26 00:24:30 UTC (rev 50996) @@ -146,7 +146,7 @@ $prow = $dbw->selectRow( array('flaggedrevs','revision'), $columns, array( 'fr_page_id' => $pageId, - 'fr_quality = 2', + 'fr_quality = '.FR_PRISTINE, 'rev_id = fr_rev_id', 'rev_page = fr_page_id', 'rev_deleted & '.Revision::DELETED_TEXT => 0 @@ -166,7 +166,7 @@ $qrow = $dbw->selectRow( array('flaggedrevs','revision'), $columns, array( 'fr_page_id' => $pageId, - 'fr_quality = 1', + 'fr_quality = '.FR_QUALITY, $newerClause, 'rev_id = fr_rev_id', 'rev_page = fr_page_id', Modified: trunk/extensions/FlaggedRevs/FlaggedRevs.class.php === --- trunk/extensions/FlaggedRevs/FlaggedRevs.class.php 2009-05-26 00:07:50 UTC (rev 50995) +++ trunk/extensions/FlaggedRevs/FlaggedRevs.class.php 2009-05-26 00:24:30 UTC (rev 50996) @@ -275,10 +275,10 @@ $config = $wgFlaggedRevsPrecedence; switch( $config ) { - case 2: + case FR_PRISTINE: $select = FLAGGED_VIS_PRISTINE; break; - case 1: + case FR_QUALITY: $select = FLAGGED_VIS_QUALITY; break; default: @@ -340,9 +340,9 @@ public static function quickTags( $tier ) { switch( $tier ) { - case 2: + case FR_PRISTINE: return self::quickPristineTags(); - case 1: + case FR_QUALITY: return self::quickQualityTags(); default: return self::quickSightedTags(); @@ -360,7 +360,7 @@ # Find the maximum auto-review quality level $qal = min($wgFlaggedRevsAutoReview-1,$quality); # Pristine auto-review? - if( $qal == 2 ) { + if( $qal == FR_PRISTINE ) { $flags = self::quickPristineTags(); # If tags are available and user can set them, we are done... if( RevisionReview::userCanSetFlags( $flags, array(), $config ) ) { @@ -369,7 +369,7 @@ $qal--; } # Quality auto-review? - if( $qal == 1 ) { + if( $qal == FR_QUALITY ) { $flags = self::quickQualityTags(); # If tags are available and user can set them, we are done... if( RevisionReview::userCanSetFlags( $flags, array(), $config ) ) { @@ -378,7 +378,7 @@ $qal--; } # Sighted auto-review? - if( $qal == 0 ) { + if( $qal == FR_SIGHTED ) { $flags = self::quickSightedTags(); # If tags are available and user can set them, we are done... if( RevisionReview::userCanSetFlags( $flags, array(), $config ) ) { @@ -837,8 +837,9 @@ */ public static function updatePendingList( $article, $latest = NULL ) { $data = array(); - $level = self::pristineVersions() ? 2 : 1; - if( !self::qualityVersions() ) $level--; + $level = s
[MediaWiki-CVS] SVN: [50998] trunk/extensions/FlaggedRevs
Revision: 50998 Author: aaron Date: 2009-05-26 00:46:29 + (Tue, 26 May 2009) Log Message: --- Merged some tag functions for simplicity Modified Paths: -- trunk/extensions/FlaggedRevs/FlaggedRevs.class.php trunk/extensions/FlaggedRevs/maintenance/reviewAllPages.inc Modified: trunk/extensions/FlaggedRevs/FlaggedRevs.class.php === --- trunk/extensions/FlaggedRevs/FlaggedRevs.class.php 2009-05-26 00:43:34 UTC (rev 50997) +++ trunk/extensions/FlaggedRevs/FlaggedRevs.class.php 2009-05-26 00:46:29 UTC (rev 50998) @@ -2,6 +2,7 @@ class FlaggedRevs { protected static $dimensions = array(); + protected static $minSL = array(); protected static $minQL = array(); protected static $minPL = array(); protected static $feedbackTags = array(); @@ -55,6 +56,7 @@ } self::$minQL[$tag] = max($minQL,1); self::$minPL[$tag] = max($minPL,1); + self::$minSL[$tag] = 1; } foreach( $wgFlaggedRevsFeedbackTags as $tag => $weight ) { # Tag names used as part of file names. "Overall" tag is a @@ -296,57 +298,27 @@ global $wgFlaggedRevsPatrolLevel; return intval($wgFlaggedRevsPatrolLevel); } - - /** -* Get minimum sighted level tags -* @return array -*/ - public static function quickSightedTags() { - $flags = array(); - foreach( self::getDimensions() as $tag => $minQL ) { - $flags[$tag] = 1; - } - return $flags; - } - - /** -* Get minimum sighted level tags -* @return array -*/ - public static function quickQualityTags() { - $flags = array(); - foreach( self::getDimensions() as $tag => $minQL ) { - $flags[$tag] = self::$minQL[$tag]; - } - return $flags; - } - - /** -* Get minimum sighted level tags -* @return array -*/ - public static function quickPristineTags() { - $flags = array(); - foreach( self::getDimensions() as $tag => $minQL ) { - $flags[$tag] = self::$minPL[$tag]; - } - return $flags; - } /** * Get minimum level tags for a tier * @return array */ public static function quickTags( $tier ) { - switch( $tier ) + self::load(); + switch( $tier ) // select reference levels { case FR_PRISTINE: - return self::quickPristineTags(); + $minLevels = self::$minPL; case FR_QUALITY: - return self::quickQualityTags(); + $minLevels = self::$minQL; default: - return self::quickSightedTags(); + $minLevels = self::$minSL; } + $flags = array(); + foreach( self::getDimensions() as $tag => $x ) { + $flags[$tag] = $minLevels[$tag]; + } + return $flags; } /** @@ -366,7 +338,7 @@ if( RevisionReview::userCanSetFlags( $flags, array(), $config ) ) { return $flags; } - $qal--; + $qal = FR_QUALITY; // try lower level } # Quality auto-review? if( $qal == FR_QUALITY ) { @@ -375,7 +347,7 @@ if( RevisionReview::userCanSetFlags( $flags, array(), $config ) ) { return $flags; } - $qal--; + $qal = FR_SIGHTED; // try lower level } # Sighted auto-review? if( $qal == FR_SIGHTED ) { Modified: trunk/extensions/FlaggedRevs/maintenance/reviewAllPages.inc === --- trunk/extensions/FlaggedRevs/maintenance/reviewAllPages.inc 2009-05-26 00:43:34 UTC (rev 50997) +++ trunk/extensions/FlaggedRevs/maintenance/reviewAllPages.inc 2009-05-26 00:46:29 UTC (rev 50998) @@ -21,7 +21,7 @@ $blockEnd = $start + $BATCH_SIZE - 1; $count = 0; $changed = 0; - $flags = FlaggedRevs::quickSightedTags(); // Assume basic flagging level + $flags = FlaggedRevs::quickTags( FR_SIGHTED ); // Assume basic level while( $blockEnd <= $end ) { echo "...doing page
[MediaWiki-CVS] SVN: [50999] trunk/extensions/FlaggedRevs/FlaggedArticle.php
Revision: 50999 Author: aaron Date: 2009-05-26 00:47:53 + (Tue, 26 May 2009) Log Message: --- Escape revreview-locked-title messages Modified Paths: -- trunk/extensions/FlaggedRevs/FlaggedArticle.php Modified: trunk/extensions/FlaggedRevs/FlaggedArticle.php === --- trunk/extensions/FlaggedRevs/FlaggedArticle.php 2009-05-26 00:46:29 UTC (rev 50998) +++ trunk/extensions/FlaggedRevs/FlaggedArticle.php 2009-05-26 00:47:53 UTC (rev 50999) @@ -297,10 +297,10 @@ // Is the page config altered? if( $this->isPageLocked() ) { $prot = ""; + wfMsgHtml('revreview-locked-title')."\">"; } else if( $this->isPageUnlocked() ) { $prot = ""; + wfMsgHtml('revreview-unlocked-title')."\">"; } // Is there no stable version? if( is_null($frev) ) { @@ -623,10 +623,10 @@ // Is the page config altered? if( $this->isPageLocked() ) { $prot = ""; + wfMsgHtml('revreview-locked-title')."\">"; } else if( $this->isPageUnlocked() ) { $prot = ""; + wfMsgHtml('revreview-unlocked-title')."\">"; } # Streamlined UI if( FlaggedRevs::useSimpleUI() ) { ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [51004] trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php
Revision: 51004 Author: aaron Date: 2009-05-26 09:23:29 + (Tue, 26 May 2009) Log Message: --- Simplified reviewLogLine() Modified Paths: -- trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php Modified: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php === --- trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php 2009-05-26 09:13:08 UTC (rev 51003) +++ trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php 2009-05-26 09:23:29 UTC (rev 51004) @@ -1243,31 +1243,26 @@ * @param string $type * @param string $action * @param object $title - * @param array $paramArray - * @param string $c - * @param string $r user tool links - * @param string $t timestamp of the log entry + * @param array $params * @return bool true */ - public static function reviewLogLine( $type='', $action='', $title=null, - $paramArray=array(), &$c, &$r ) - { + public static function reviewLogLine( $type='', $action='', $title=null, $params=array() ) { $actionsValid = array('approve','approve2','approve-a','approve2-a','unapprove','unapprove2'); # Show link to page with oldid=x - if( $type == 'review' && in_array($action,$actionsValid) && is_object($title) && isset($paramArray[0]) ) { + if( $type == 'review' && in_array($action,$actionsValid) && is_object($title) && isset($params[0]) ) { global $wgUser; # Load required messages wfLoadExtensionMessages( 'FlaggedRevs' ); # Don't show diff if param missing or rev IDs are the same - if( !empty($paramArray[1]) && $paramArray[0] != $paramArray[1] ) { + if( !empty($params[1]) && $params[0] != $params[1] ) { $r = '(' . $wgUser->getSkin()->makeKnownLinkObj( $title, wfMsgHtml('review-logentry-diff'), - "oldid={$paramArray[1]}&diff={$paramArray[0]}") . ') '; + "oldid={$params[1]}&diff={$params[0]}") . ') '; } else { $r = '(' . wfMsgHtml('review-logentry-diff') . ')'; } $r .= ' (' . $wgUser->getSkin()->makeKnownLinkObj( $title, - wfMsgHtml('review-logentry-id',$paramArray[0]), - "oldid={$paramArray[0]}&diff=prev&diffonly=0") . ')'; + wfMsgHtml('review-logentry-id',$params[0]), + "oldid={$params[0]}&diff=prev&diffonly=0") . ')'; } return true; } ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [51009] trunk/phase3/includes
Revision: 51009 Author: aaron Date: 2009-05-26 12:29:16 + (Tue, 26 May 2009) Log Message: --- (bug 18772) Removed redundant 'deletedrev' message instances Modified Paths: -- trunk/phase3/includes/ChangesList.php trunk/phase3/includes/PageHistory.php trunk/phase3/includes/specials/SpecialContributions.php trunk/phase3/includes/specials/SpecialDeletedContributions.php trunk/phase3/includes/specials/SpecialRevisiondelete.php trunk/phase3/includes/specials/SpecialUndelete.php Modified: trunk/phase3/includes/ChangesList.php === --- trunk/phase3/includes/ChangesList.php 2009-05-26 11:44:19 UTC (rev 51008) +++ trunk/phase3/includes/ChangesList.php 2009-05-26 12:29:16 UTC (rev 51009) @@ -447,10 +447,6 @@ # For subclasses $this->insertExtra( $s, $rc, $classes ); - # Mark revision as deleted if so - if( !$rc->mAttribs['rc_log_type'] && $this->isDeleted($rc,Revision::DELETED_TEXT) ) { - $s .= ' ' . wfMsgHtml( 'deletedrev' ) . ''; - } # How many users watch this page if( $rc->numberofWatchingusers > 0 ) { $s .= ' ' . wfMsgExt( 'number_of_watching_users_RCview', @@ -865,11 +861,6 @@ $this->insertRollback( $r, $rcObj ); # Tags $this->insertTags( $r, $rcObj, $classes ); - - # Mark revision as deleted - if( !$rc_log_type && $this->isDeleted($rcObj,Revision::DELETED_TEXT) ) { - $r .= ' ' . wfMsgHtml( 'deletedrev' ) . ''; - } $r .= "\n"; } Modified: trunk/phase3/includes/PageHistory.php === --- trunk/phase3/includes/PageHistory.php 2009-05-26 11:44:19 UTC (rev 51008) +++ trunk/phase3/includes/PageHistory.php 2009-05-26 12:29:16 UTC (rev 51009) @@ -320,19 +320,18 @@ if( $notificationtimestamp && ($row->rev_timestamp >= $notificationtimestamp) ) { $s .= ' ' . wfMsgHtml( 'updatedmarker' ) . ''; } - if( $rev->isDeleted( Revision::DELETED_TEXT ) ) { - $s .= ' ' . wfMsgHtml( 'deletedrev' ) . ''; - } $tools = array(); if( !is_null( $next ) && is_object( $next ) ) { if( $latest && $this->mTitle->userCan( 'rollback' ) && $this->mTitle->userCan( 'edit' ) ) { - $tools[] = ''.$this->mSkin->buildRollbackLink( $rev ).''; + $tools[] = ''. + $this->mSkin->buildRollbackLink( $rev ).''; } - if( $this->mTitle->quickUserCan( 'edit' ) && !$rev->isDeleted( Revision::DELETED_TEXT ) && - !$next->rev_deleted & Revision::DELETED_TEXT ) + if( $this->mTitle->quickUserCan( 'edit' ) + && !$rev->isDeleted( Revision::DELETED_TEXT ) + && !$next->rev_deleted & Revision::DELETED_TEXT ) { # Create undo tooltip for the first (=latest) line only $undoTooltip = $latest Modified: trunk/phase3/includes/specials/SpecialContributions.php === --- trunk/phase3/includes/specials/SpecialContributions.php 2009-05-26 11:44:19 UTC (rev 51008) +++ trunk/phase3/includes/specials/SpecialContributions.php 2009-05-26 12:29:16 UTC (rev 51009) @@ -554,9 +554,6 @@ } $ret = "{$del}{$d} {$histlink} {$difftext} {$nflag}{$mflag} {$link}{$userlink} {$comment} {$topmarktext}"; - if( $rev->isDeleted( Revision::DELETED_TEXT ) ) { - $ret .= ' ' . wfMsgHtml( 'deletedrev' ); - } # Tags, if any. list($tagSummary, $newClasses) = ChangeTags::formatSummaryRow( $row->ts_tags, 'contributions' ); Modified: trunk/phase3/includes/specials/SpecialDeletedContributions.php ===
[MediaWiki-CVS] SVN: [51040] trunk/extensions/CheckUser
Revision: 51040 Author: aaron Date: 2009-05-27 01:47:12 + (Wed, 27 May 2009) Log Message: --- Added $wgCheckUserForceSummary and removed some code duplication from r50638 Modified Paths: -- trunk/extensions/CheckUser/CheckUser.php trunk/extensions/CheckUser/CheckUser_body.php Modified: trunk/extensions/CheckUser/CheckUser.php === --- trunk/extensions/CheckUser/CheckUser.php2009-05-26 21:25:26 UTC (rev 51039) +++ trunk/extensions/CheckUser/CheckUser.php2009-05-27 01:47:12 UTC (rev 51040) @@ -33,6 +33,8 @@ # Mass block limits $wgCheckUserMaxBlocks = 200; +$wgCheckUserForceSummary = false; + $wgCheckUserStyleVersion = 4; # Recent changes data hook Modified: trunk/extensions/CheckUser/CheckUser_body.php === --- trunk/extensions/CheckUser/CheckUser_body.php 2009-05-26 21:25:26 UTC (rev 51039) +++ trunk/extensions/CheckUser/CheckUser_body.php 2009-05-27 01:47:12 UTC (rev 51040) @@ -92,6 +92,8 @@ if( $wgRequest->wasPosted() ) { if( $wgRequest->getVal('action') === 'block' ) { $this->doMassUserBlock( $users, $blockreason, $tag, $talkTag ); + } else if( !$this->checkReason($reason) ) { + $wgOut->addWikiText( wfMsgExt('checkuser-noreason',array('parsemag')) ); } else if( $checktype=='subuserips' ) { $this->doUserIPsRequest( $name, $reason, $period ); } else if( $xff && $checktype=='subipedits' ) { @@ -288,6 +290,11 @@ } return wfMsgExt('checkuser-nomatch','parse'); } + + protected function checkReason( $reason ) { + global $wgCheckUserForceSummary; + return ( !$wgCheckUserForceSummary || strlen($reason) ); + } /** * @param string $ip @@ -318,12 +325,7 @@ $wgOut->addHTML( $s ); return; } - - # Demand that a reason be given - if( !$reason ) { - $wgOut->addWikiText( wfMsgExt('checkuser-noreason',array('parsemag')) ); - return; - } + # Record check... if( !$this->addLogEntry( 'userips', 'user', $user, $reason, $user_id ) ) { $wgOut->addHTML( ''.wfMsgHtml('checkuser-log-fail').'' ); @@ -445,11 +447,6 @@ if( $xfor ) { $logType .= '-xff'; } - # Demand that a reason be given - if( !$reason ) { - $wgOut->addWikiText( wfMsgExt('checkuser-noreason',array('parsemag')) ); - return; - } # Record check... if( !$this->addLogEntry( $logType, 'ip', $ip, $reason ) ) { $wgOut->addWikiMsg( 'checkuser-log-fail' ); @@ -594,11 +591,6 @@ return; } - # Demand that a reason be given - if( !$reason ) { - $wgOut->addWikiText( wfMsgExt('checkuser-noreason',array('parsemag')) ); - return; - } # Record check... if( !$this->addLogEntry( 'useredits', 'user', $user, $reason, $user_id ) ) { $wgOut->addHTML( ''.wfMsgHtml('checkuser-log-fail').'' ); @@ -717,11 +709,6 @@ if( $xfor ) { $logType .= '-xff'; } - # Demand that a reason be given - if( !$reason ) { - $wgOut->addWikiText( wfMsgExt('checkuser-noreason',array('parsemag')) ); - return; - } # Log the check... if( !$this->addLogEntry( $logType, 'ip', $ip, $reason ) ) { $wgOut->addHTML( ''.wfMsgHtml('checkuser-log-fail').'' ); ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [51041] trunk/phase3/includes/EditPage.php
Revision: 51041 Author: aaron Date: 2009-05-27 02:19:58 + (Wed, 27 May 2009) Log Message: --- (bug 18747) Show only page deletion log extracts, not revisiondelete ones Modified Paths: -- trunk/phase3/includes/EditPage.php Modified: trunk/phase3/includes/EditPage.php === --- trunk/phase3/includes/EditPage.php 2009-05-27 01:47:12 UTC (rev 51040) +++ trunk/phase3/includes/EditPage.php 2009-05-27 02:19:58 UTC (rev 51041) @@ -2448,7 +2448,8 @@ protected function showLogs( $out ) { global $wgUser; $loglist = new LogEventsList( $wgUser->getSkin(), $out ); - $pager = new LogPager( $loglist, array('move', 'delete'), false, $this->mTitle->getPrefixedText() ); + $pager = new LogPager( $loglist, array('move', 'delete'), false, + $this->mTitle->getPrefixedText(), '', array('log_action'=>'delete') ); $count = $pager->getNumRows(); if ( $count > 0 ) { $pager->mLimit = 10; ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [51060] trunk/phase3/includes/specials/SpecialBlockip.php
Revision: 51060 Author: aaron Date: 2009-05-27 13:46:46 + (Wed, 27 May 2009) Log Message: --- reverted r49742 per CR; also it doesn't handle subpages anyway Modified Paths: -- trunk/phase3/includes/specials/SpecialBlockip.php Modified: trunk/phase3/includes/specials/SpecialBlockip.php === --- trunk/phase3/includes/specials/SpecialBlockip.php 2009-05-27 13:45:48 UTC (rev 51059) +++ trunk/phase3/includes/specials/SpecialBlockip.php 2009-05-27 13:46:46 UTC (rev 51060) @@ -467,7 +467,7 @@ # Set *_deleted fields if requested if( $this->BlockHideName ) { - self::suppressUserName( $this->BlockAddress, $userId, $reasonstr ); + self::suppressUserName( $this->BlockAddress, $userId ); } # Only show watch link when this is no range block @@ -497,20 +497,7 @@ } } - public static function suppressUserName( $name, $userId, $reason = '' ) { - $user = User::newFromName( $name, false ); - # Delete the user pages that exists - $title = $user->getUserPage(); - if( ($id = $title->getArticleID(GAID_FOR_UPDATE)) ) { - $article = new Article( $title ); - $article->doDeleteArticle( $reason, true /*suppress*/, $id ); - } - # Delete the user talk pages that exists - $title = $user->getTalkPage(); - if( $id = $title->getArticleID(GAID_FOR_UPDATE) ) { - $article = new Article( $title ); - $article->doDeleteArticle( $reason, true /*suppress*/, $id ); - } + public static function suppressUserName( $name, $userId ) { $op = '|'; // bitwise OR return self::setUsernameBitfields( $name, $userId, $op ); } ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [51104] trunk/extensions/FlaggedRevs
Revision: 51104 Author: aaron Date: 2009-05-28 08:21:20 + (Thu, 28 May 2009) Log Message: --- Minor S&R code cleanup Modified Paths: -- trunk/extensions/FlaggedRevs/FlaggedArticle.php trunk/extensions/FlaggedRevs/FlaggedRevision.php trunk/extensions/FlaggedRevs/FlaggedRevs.class.php trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php trunk/extensions/FlaggedRevs/FlaggedRevs.php trunk/extensions/FlaggedRevs/FlaggedRevsXML.php trunk/extensions/FlaggedRevs/api/ApiReview.php trunk/extensions/FlaggedRevs/maintenance/updateLinks.inc trunk/extensions/FlaggedRevs/specialpages/LikedPages_body.php trunk/extensions/FlaggedRevs/specialpages/OldReviewedPages_body.php trunk/extensions/FlaggedRevs/specialpages/ProblemPages_body.php trunk/extensions/FlaggedRevs/specialpages/QualityOversight_body.php trunk/extensions/FlaggedRevs/specialpages/RatingHistory_body.php trunk/extensions/FlaggedRevs/specialpages/ReaderFeedback_body.php trunk/extensions/FlaggedRevs/specialpages/RevisionReview_body.php trunk/extensions/FlaggedRevs/specialpages/Stabilization_body.php trunk/extensions/FlaggedRevs/specialpages/StablePages_body.php trunk/extensions/FlaggedRevs/svggraph/svgGraph.php Modified: trunk/extensions/FlaggedRevs/FlaggedArticle.php === --- trunk/extensions/FlaggedRevs/FlaggedArticle.php 2009-05-28 04:27:32 UTC (rev 51103) +++ trunk/extensions/FlaggedRevs/FlaggedArticle.php 2009-05-28 08:21:20 UTC (rev 51104) @@ -18,7 +18,7 @@ global $wgArticle, $wgTitle; if( !empty( $wgArticle ) ) { return self::getInstance( $wgArticle ); - } else if( !empty( $wgTitle ) ) { + } elseif( !empty( $wgTitle ) ) { return self::getTitleInstance( $wgTitle ); } return null; @@ -95,7 +95,7 @@ # Viewer sees stable by default return !( $wgRequest->getIntOrNull('stable') === 0 ); # We are explicity requesting the stable version? - } else if( $wgRequest->getIntOrNull('stable') === 1 ) { + } elseif( $wgRequest->getIntOrNull('stable') === 1 ) { return true; } return false; @@ -172,7 +172,7 @@ global $wgFlaggedRevsReviewForDefault; if( !FlaggedRevs::isPageReviewable( $this->parent->getTitle() ) ) { return false; - } else if( !$titleOnly && $wgFlaggedRevsReviewForDefault && !$this->showStableByDefault() ) { + } elseif( !$titleOnly && $wgFlaggedRevsReviewForDefault && !$this->showStableByDefault() ) { return false; } return true; @@ -187,7 +187,7 @@ global $wgFlaggedRevsReviewForDefault; if( FlaggedRevs::isPagePatrollable( $this->parent->getTitle() ) ) { return true; - } else if( !$titleOnly && $wgFlaggedRevsReviewForDefault && !$this->showStableByDefault() ) { + } elseif( !$titleOnly && $wgFlaggedRevsReviewForDefault && !$this->showStableByDefault() ) { return true; } return false; @@ -298,7 +298,7 @@ if( $this->isPageLocked() ) { $prot = ""; - } else if( $this->isPageUnlocked() ) { + } elseif( $this->isPageUnlocked() ) { $prot = ""; } @@ -378,7 +378,7 @@ $pcache = false; // Looking at some specific old revision (&oldid=x) or if FlaggedRevs is not // set to override given the relevant conditions (like &action=protect). - } else if( !$stable && !$this->pageOverride() ) { + } elseif( !$stable && !$this->pageOverride() ) { $revsSince = FlaggedRevs::getRevCountSince( $this->parent, $srev->getRevId() ); $synced = false; # We only care about syncing if not viewing an old stable version @@ -479,7 +479,7 @@ if( $synced ) { # uses messages 'revreview-quality-same', 'revreview-basic-same' $msg .= '-same'; - } else if( $revsSince == 0 ) { + } elseif( $revsSince == 0 ) { # uses messages '
[MediaWiki-CVS] SVN: [51179] trunk/extensions/CheckUser/checkuser.js
Revision: 51179 Author: aaron Date: 2009-05-30 06:55:40 + (Sat, 30 May 2009) Log Message: --- (bug 17018) Made IP validation more robust. Also fixed bug that were no range was given if the last ip-like item was invalid. Modified Paths: -- trunk/extensions/CheckUser/checkuser.js Modified: trunk/extensions/CheckUser/checkuser.js === --- trunk/extensions/CheckUser/checkuser.js 2009-05-30 05:14:24 UTC (rev 51178) +++ trunk/extensions/CheckUser/checkuser.js 2009-05-30 06:55:40 UTC (rev 51179) @@ -27,33 +27,39 @@ var bin_prefix = 0; var prefix_cidr = 0; var prefix = new String( "" ); - // Go through each IP in the list, get it's binary form, and track - // the largest binary prefix among them + // Go through each IP in the list, get it's binary form, and + // track the largest binary prefix among them... for( var i=0; i 255 ) continue; // bad IP! + if( bloc > 255 ) { + invalid = true; // bad IP! + break; // bad IP! + } bin_block = bloc.toString(2); // concat bin with binary form of bloc while( bin_block.length < 8 ) { bin_block = "0" + bin_block; // pad out as needed } bin += bin_block; } + if( invalid ) continue; // move to next IP + prefix = ''; // Rebuild formatted bin_prefix for each IP // Apply any valid CIDRs if( cidr ) { cidr = cidr.match( /\d+$/ )[0]; // get rid of slash @@ -119,7 +125,10 @@ var blocs = ip.split(':'); for( var x=0; x<=7; x++ ) { bloc = blocs[x] ? blocs[x] : "0"; - if( bloc > "" ) continue; // bad IP! + if( bloc > "" ) { + invalid = true; // bad IP! + break; // bad IP! + } int_block = hex2int( bloc ); // convert hex -> int bin_block = int_block.toString(2); // concat bin with binary form of bloc while( bin_block.length < 16 ) { @@ -127,6 +136,8 @@ } bin += bin_block; } + if( invalid ) continue; // move to next IP + prefix = ''; // Rebuild formatted bin_prefix for each IP // Apply any valid CIDRs if( cidr ) { cidr = cidr.match( /\d+$/ )[0]; // get rid of slash ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [51194] trunk/extensions/FlaggedRevs/language/Stabilization.i18n.php
Revision: 51194 Author: aaron Date: 2009-05-30 12:16:27 + (Sat, 30 May 2009) Log Message: --- fix common typo Modified Paths: -- trunk/extensions/FlaggedRevs/language/Stabilization.i18n.php Modified: trunk/extensions/FlaggedRevs/language/Stabilization.i18n.php === --- trunk/extensions/FlaggedRevs/language/Stabilization.i18n.php 2009-05-30 11:36:20 UTC (rev 51193) +++ trunk/extensions/FlaggedRevs/language/Stabilization.i18n.php 2009-05-30 12:16:27 UTC (rev 51194) @@ -13,7 +13,7 @@ 'stabilization-text' => '\'\'\'Change the settings below to adjust how the stable version of [[:$1|$1]] is selected and displayed.\'\'\' When changing the \'\'stable version selection\'\' configuration to use "quality" or "pristine" revisions by default, -be sure to check if there actually are such revisions in the page, otherwise the change will have little affect.', +be sure to check if there actually are such revisions in the page, otherwise the change will have little effect.', 'stabilization-perm' => 'Your account does not have permission to change the stable version configuration. Here are the current settings for [[:$1|$1]]:', 'stabilization-page' => 'Page name:', ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [51268] trunk/extensions/ConfirmAccount/RequestAccount_body.php
Revision: 51268 Author: aaron Date: 2009-06-01 03:52:45 + (Mon, 01 Jun 2009) Log Message: --- (bug 19035) Fatal error: Class 'UploadBase' not found Modified Paths: -- trunk/extensions/ConfirmAccount/RequestAccount_body.php Modified: trunk/extensions/ConfirmAccount/RequestAccount_body.php === --- trunk/extensions/ConfirmAccount/RequestAccount_body.php 2009-06-01 00:51:49 UTC (rev 51267) +++ trunk/extensions/ConfirmAccount/RequestAccount_body.php 2009-06-01 03:52:45 UTC (rev 51268) @@ -479,7 +479,7 @@ wfDebug ( "\n\nmime: <$mime> extension: <$extension>\n\n" ); # check mime type against file extension - if ( !UploadBase::verifyExtension( $mime, $extension ) ) { + if ( !UploadForm::verifyExtension( $mime, $extension ) ) { return new WikiErrorMsg( 'uploadcorrupt' ); } ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [51269] trunk/extensions/FlaggedRevs
Revision: 51269 Author: aaron Date: 2009-06-01 04:30:36 + (Mon, 01 Jun 2009) Log Message: --- *Reverted r49852 and removed locking reads (bug 17275) *Fixed r50998, dangling references to removed functions were still there Modified Paths: -- trunk/extensions/FlaggedRevs/FlaggedRevision.php trunk/extensions/FlaggedRevs/FlaggedRevs.class.php trunk/extensions/FlaggedRevs/maintenance/reviewAllPages.inc trunk/extensions/FlaggedRevs/specialpages/RevisionReview_body.php Modified: trunk/extensions/FlaggedRevs/FlaggedRevision.php === --- trunk/extensions/FlaggedRevs/FlaggedRevision.php2009-06-01 03:52:45 UTC (rev 51268) +++ trunk/extensions/FlaggedRevs/FlaggedRevision.php2009-06-01 04:30:36 UTC (rev 51269) @@ -69,7 +69,7 @@ # User master/slave as appropriate if( $flags & FR_FOR_UPDATE || $flags & FR_MASTER ) { $db = wfGetDB( DB_MASTER ); - if( $flags & FR_FOR_UPDATE ) $options[] = 'LOCK IN SHARE MODE'; + if( $flags & FR_FOR_UPDATE ) $options[] = 'FOR UPDATE'; } else { $db = wfGetDB( DB_SLAVE ); } @@ -140,7 +140,7 @@ } $dbw = wfGetDB( DB_MASTER ); $options['ORDER BY'] = 'fr_rev_id DESC'; - if( $flags & FR_FOR_UPDATE ) $options[] = 'LOCK IN SHARE MODE'; + if( $flags & FR_FOR_UPDATE ) $options[] = 'FOR UPDATE'; # Look for the latest pristine revision... if( FlaggedRevs::pristineVersions() && $config['select'] != FLAGGED_VIS_LATEST ) { $prow = $dbw->selectRow( array('flaggedrevs','revision'), Modified: trunk/extensions/FlaggedRevs/FlaggedRevs.class.php === --- trunk/extensions/FlaggedRevs/FlaggedRevs.class.php 2009-06-01 03:52:45 UTC (rev 51268) +++ trunk/extensions/FlaggedRevs/FlaggedRevs.class.php 2009-06-01 04:30:36 UTC (rev 51269) @@ -333,7 +333,7 @@ $qal = min($wgFlaggedRevsAutoReview-1,$quality); # Pristine auto-review? if( $qal == FR_PRISTINE ) { - $flags = self::quickPristineTags(); + $flags = self::quickTags( FR_PRISTINE ); # If tags are available and user can set them, we are done... if( RevisionReview::userCanSetFlags( $flags, array(), $config ) ) { return $flags; @@ -342,7 +342,7 @@ } # Quality auto-review? if( $qal == FR_QUALITY ) { - $flags = self::quickQualityTags(); + $flags = self::quickTags( FR_QUALITY ); # If tags are available and user can set them, we are done... if( RevisionReview::userCanSetFlags( $flags, array(), $config ) ) { return $flags; @@ -351,7 +351,7 @@ } # Sighted auto-review? if( $qal == FR_SIGHTED ) { - $flags = self::quickSightedTags(); + $flags = self::quickTags( FR_SIGHTED ); # If tags are available and user can set them, we are done... if( RevisionReview::userCanSetFlags( $flags, array(), $config ) ) { return $flags; @@ -1413,7 +1413,7 @@ # If we know that this is now the new stable version # (which it probably is), save it to the cache... - $sv = FlaggedRevision::newFromStable( $article->getTitle(), FR_FOR_UPDATE/*consistent*/ ); + $sv = FlaggedRevision::newFromStable( $article->getTitle(), FR_MASTER/*consistent*/ ); if( $sv && $sv->getRevId() == $rev->getId() ) { # Update stable cache self::updatePageCache( $article, $poutput ); Modified: trunk/extensions/FlaggedRevs/maintenance/reviewAllPages.inc === --- trunk/extensions/FlaggedRevs/maintenance/reviewAllPages.inc 2009-06-01 03:52:45 UTC (rev 51268) +++ trunk/extensions/FlaggedRevs/maintenance/reviewAllPages.inc 2009-06-01 04:30:36 UTC (rev 51269) @@ -33,7 +33,7 @@ $title = Title::makeTitle( $row->page_namespace, $row->page_title ); $rev = Revision::newFromId( $row->page_latest ); # Is it already reviewed? - $frev = FlaggedRevision::newFr