Property changes on: trunk/phase3/extensions |
___________________________________________________________________ |
Added: svn:ignore |
1 | 1 | + AbsenteeLandlord |
ActiveAbstract |
AdvancedRandom |
Aggregator |
AjaxQueryPages |
AjaxShowEditors |
AjaxTest |
AntiSpoof |
APC |
Asksql |
AssertEdit |
auth |
AuthorProtect |
Autoincrement |
AutomaticGroups |
Babel |
BackAndForth |
BadImage |
Blahtex |
BlockTitles |
BoardVote |
BookInformation |
BotQuery |
BreadCrumbs |
Cache404 |
Call |
CategoryIntersection |
CategoryStepper |
CategoryTree |
catfeed |
CentralAuth |
CentralNotice |
ChangeAuthor |
CharInsert |
CheckUser |
Chemistry |
Citation |
Cite |
cldr |
CleanChanges |
Click |
Collection |
CommentPages |
CommentSpammer |
Configure |
ConfirmAccount |
ConfirmEdit |
ContactPage |
ContributionScores |
Contributionseditcount |
Contributors |
ContributorsAddon |
CountEdits |
CreateBox |
CrossNamespaceLinks |
Crosswiki |
CrowdAuthentication |
Data |
DataTransfer |
DeletedContributions |
Desysop |
DidYouMean |
DisableSpecialPages |
DismissableSiteNotice |
DoubleWiki |
DPLforum |
DumpHTML |
Duplicator |
DynamicPageList |
DynamicPageList2 |
Editcount |
EditMessages |
EditOwn |
EditSubpages |
EditUser |
ee |
EmailAddressImage |
EmailArticle |
ErrorHandler |
Eval |
examples |
ExpandTemplates |
experimental |
ExtensionLoader |
Farmer |
FastStringSearch |
FCKeditor |
Filepath |
FileSearch |
FindSpam |
FixedImage |
FlaggedRevs |
FootNote |
ForcePreview |
FormatDates |
FormatEmail |
FormPreloadPostCache |
Gadgets |
geo |
geoserver |
gis |
GiveRollback |
GlobalBlocking |
GlobalUsage |
Gnuplot |
googleAnalytics |
GoogleMaps |
GoToCategory |
GroupPortal |
HTMLets |
HTTPRedirect |
I18nTags |
Icon |
icpagent |
ImageMap |
Imagetabs |
ImageTagging |
ImportFreeImages |
ImportUsers |
inputbox |
InspectCache |
InstantCommons |
interact |
intersection |
Interwiki |
Invitations |
JIRA |
LabeledSectionTransclusion |
LanguageSelector |
LatexDoc |
LdapAuthentication |
LinkSearch |
LiquidThreads |
ListChangedArticles |
LocalFileLink |
Lockdown |
Logo |
LookupUser |
LuceneSearch |
MagicNoNumberedHeadings |
Maintenance |
Makebot |
MakeDBError |
Makesysop |
MathStatFunctions |
MediaFunctions |
Memorize |
MetavidWiki |
METIS |
Mibbit |
MicroID |
MiniDonation |
MinimumNameLength |
MiniPreview |
MogileClient |
MultiBoilerplate |
Multilang |
MultiUpload |
MWBlocker |
MWSearch |
NavigationPopups |
NetworkAuth |
NewestPages |
News |
Newuserlog |
NewUserMessage |
NewUserNotif |
Nogomatch |
NopurgeRC |
normal |
Nuke |
OAI |
OggHandler |
OnlineStatus |
OpenID |
Oversight |
PageBy |
PageCSS |
PageNotice |
ParserDiffTest |
ParserFunctions |
PasswordReset |
Patroller |
PdfHandler |
pecl-proctitle |
php |
phpbbData |
Player |
PNGHandler |
Poem |
Polyglot |
Postcomment |
PovWatch |
Preloader |
PrivateNamespaces |
ProfileMonitor |
ProofreadPage |
ProtectSection |
Purge |
PurgeCache |
purgetab |
Quiz |
RandomImage |
RandomInCategory |
Randomrootpage |
RDF |
redircite |
regexBlock |
Renameuser |
RenderHash |
ReplaceText |
Resign |
Review |
RightFunctions |
rss |
sampleskin |
ScanSet |
Seealso |
SelectCategory |
SemanticCalendar |
SemanticDrilldown |
SemanticForms |
SemanticMediaWiki |
ShowProcesslist |
SignDocument |
SimpleAntiSpam |
SimplifiedRegex |
SisterSites |
SiteMatrix |
SkinPerNamespace |
SkinPerPage |
skins |
SmoothGallery |
SocialProfile |
Sort |
SpamBlacklist |
SpamDiffTool |
SpamRegex |
SpecialFileList |
SpecialForm |
SpecialTalk |
StableVersion |
StalePages |
StaticWiki |
StringFunctions |
SubpageList |
SubPageList3 |
SyntaxHighlight_GeSHi |
SyntaxHighlight_vim |
Syslog |
TalkHere |
Tasks |
TemplateLink |
Throttle |
tidy |
TidyTab |
timeline |
TitleBlacklist |
TitleKey |
Todo |
TodoTasks |
Tooltip |
Translate |
transliterate |
TreeAndMenu |
UnicodeConverter |
UsageStatistics |
UserContactLinks |
UserImages |
Userip |
UserMerge |
UsernameBlacklist |
UserRightsNotif |
Vote |
Watchers |
WatchSubpages |
WebStore |
WhiteList |
WhoIsWatching |
WhosOnline |
Wikidata |
wikidiff |
wikidiff2 |
wikiforum |
wikihiero |
WikiMiniAtlas |
wikiwyg |
WiktionaryInflection |
Woopra |
YouTubeAuthSub |
zhdaemon |
Index: trunk/phase3/includes/ProtectionForm.php |
— | — | @@ -91,8 +91,7 @@ |
92 | 92 | global $wgRequest, $wgOut; |
93 | 93 | if( $wgRequest->wasPosted() ) { |
94 | 94 | if( $this->save() ) { |
95 | | - $article = new Article( $this->mTitle ); |
96 | | - $q = $article->isRedirect() ? 'redirect=no' : ''; |
| 95 | + $q = $this->mArticle->isRedirect() ? 'redirect=no' : ''; |
97 | 96 | $wgOut->redirect( $this->mTitle->getFullUrl( $q ) ); |
98 | 97 | } |
99 | 98 | } else { |
— | — | @@ -190,17 +189,10 @@ |
191 | 190 | |
192 | 191 | } |
193 | 192 | |
194 | | - # They shouldn't be able to do this anyway, but just to make sure, ensure that cascading restrictions aren't being applied |
195 | | - # to a semi-protected page. |
196 | | - global $wgGroupPermissions; |
| 193 | + # NOTE : verification of cascading protection in semi-protection mode |
| 194 | + # is in Article::updateRestriction() |
197 | 195 | |
198 | | - $edit_restriction = $this->mRestrictions['edit']; |
199 | | - |
200 | | - if ($this->mCascade && ($edit_restriction != 'protect') && |
201 | | - !(isset($wgGroupPermissions[$edit_restriction]['protect']) && $wgGroupPermissions[$edit_restriction]['protect'] ) ) |
202 | | - $this->mCascade = false; |
203 | | - |
204 | | - if ($this->mTitle->exists()) { |
| 196 | + if( $this->mTitle->exists() ){ |
205 | 197 | $ok = $this->mArticle->updateRestrictions( $this->mRestrictions, $this->mReason, $this->mCascade, $expiry ); |
206 | 198 | } else { |
207 | 199 | $ok = $this->mTitle->updateTitleProtection( $this->mRestrictions['create'], $this->mReason, $expiry ); |
— | — | @@ -379,7 +371,15 @@ |
380 | 372 | $script = 'var wgCascadeableLevels='; |
381 | 373 | $CascadeableLevels = array(); |
382 | 374 | foreach( $wgRestrictionLevels as $key ) { |
383 | | - if ( (isset($wgGroupPermissions[$key]['protect']) && $wgGroupPermissions[$key]['protect']) || $key == 'protect' ) { |
| 375 | + $canCascade = true; |
| 376 | + $check = $key == 'sysop' ? 'protect' : $key; |
| 377 | + foreach( $wgGroupPermissions as $group => $rights ){ |
| 378 | + if( isset( $rights[$check] ) && $rights[$check] && !( isset( $rights['protect'] ) && $rights['protect'] ) ){ |
| 379 | + $canCascade = false; |
| 380 | + break; |
| 381 | + } |
| 382 | + } |
| 383 | + if( $key != '' && $canCascade ) { |
384 | 384 | $CascadeableLevels[] = "'" . Xml::escapeJsString( $key ) . "'"; |
385 | 385 | } |
386 | 386 | } |
Index: trunk/phase3/includes/Article.php |
— | — | @@ -16,26 +16,26 @@ |
17 | 17 | /**@{{ |
18 | 18 | * @private |
19 | 19 | */ |
20 | | - var $mComment; //!< |
21 | | - var $mContent; //!< |
22 | | - var $mContentLoaded; //!< |
23 | | - var $mCounter; //!< |
24 | | - var $mForUpdate; //!< |
25 | | - var $mGoodAdjustment; //!< |
26 | | - var $mLatest; //!< |
27 | | - var $mMinorEdit; //!< |
28 | | - var $mOldId; //!< |
29 | | - var $mRedirectedFrom; //!< |
30 | | - var $mRedirectUrl; //!< |
31 | | - var $mRevIdFetched; //!< |
32 | | - var $mRevision; //!< |
33 | | - var $mTimestamp; //!< |
34 | | - var $mTitle; //!< |
35 | | - var $mTotalAdjustment; //!< |
36 | | - var $mTouched; //!< |
37 | | - var $mUser; //!< |
38 | | - var $mUserText; //!< |
39 | | - var $mRedirectTarget; //!< |
| 20 | + var $mComment; //!< |
| 21 | + var $mContent; //!< |
| 22 | + var $mContentLoaded; //!< |
| 23 | + var $mCounter; //!< |
| 24 | + var $mForUpdate; //!< |
| 25 | + var $mGoodAdjustment; //!< |
| 26 | + var $mLatest; //!< |
| 27 | + var $mMinorEdit; //!< |
| 28 | + var $mOldId; //!< |
| 29 | + var $mRedirectedFrom; //!< |
| 30 | + var $mRedirectUrl; //!< |
| 31 | + var $mRevIdFetched; //!< |
| 32 | + var $mRevision; //!< |
| 33 | + var $mTimestamp; //!< |
| 34 | + var $mTitle; //!< |
| 35 | + var $mTotalAdjustment; //!< |
| 36 | + var $mTouched; //!< |
| 37 | + var $mUser; //!< |
| 38 | + var $mUserText; //!< |
| 39 | + var $mRedirectTarget; //!< |
40 | 40 | var $mIsRedirect; |
41 | 41 | /**@}}*/ |
42 | 42 | |
— | — | @@ -543,9 +543,9 @@ |
544 | 544 | */ |
545 | 545 | function isRedirect( $text = false ) { |
546 | 546 | if ( $text === false ) { |
547 | | - if ( $this->mDataLoaded ) |
| 547 | + if ( $this->mDataLoaded ) |
548 | 548 | return $this->mIsRedirect; |
549 | | - |
| 549 | + |
550 | 550 | // Apparently loadPageData was never called |
551 | 551 | $this->loadContent(); |
552 | 552 | $titleObj = Title::newFromRedirect( $this->fetchContent() ); |
— | — | @@ -924,14 +924,14 @@ |
925 | 925 | $this->viewUpdates(); |
926 | 926 | wfProfileOut( __METHOD__ ); |
927 | 927 | } |
928 | | - |
| 928 | + |
929 | 929 | protected function viewRedirect( $target, $overwriteSubtitle = true, $forceKnown = false ) { |
930 | 930 | global $wgParser, $wgOut, $wgContLang, $wgStylePath, $wgUser; |
931 | | - |
| 931 | + |
932 | 932 | # Display redirect |
933 | 933 | $imageDir = $wgContLang->isRTL() ? 'rtl' : 'ltr'; |
934 | 934 | $imageUrl = $wgStylePath.'/common/images/redirect' . $imageDir . '.png'; |
935 | | - |
| 935 | + |
936 | 936 | if( $overwriteSubtitle ) { |
937 | 937 | $wgOut->setSubtitle( wfMsgHtml( 'redirectpagesub' ) ); |
938 | 938 | } |
— | — | @@ -943,7 +943,7 @@ |
944 | 944 | |
945 | 945 | $wgOut->addHTML( '<img src="'.$imageUrl.'" alt="#REDIRECT " />' . |
946 | 946 | '<span class="redirectText">'.$link.'</span>' ); |
947 | | - |
| 947 | + |
948 | 948 | } |
949 | 949 | |
950 | 950 | function addTrackbacks() { |
— | — | @@ -1451,7 +1451,7 @@ |
1452 | 1452 | |
1453 | 1453 | # Update page |
1454 | 1454 | $ok = $this->updateRevisionOn( $dbw, $revision, $lastRevision ); |
1455 | | - |
| 1455 | + |
1456 | 1456 | wfRunHooks( 'NewRevisionFromEditComplete', array($this, $revision, $baseRevId) ); |
1457 | 1457 | |
1458 | 1458 | if( !$ok ) { |
— | — | @@ -1523,7 +1523,7 @@ |
1524 | 1524 | |
1525 | 1525 | # Update the page record with revision data |
1526 | 1526 | $this->updateRevisionOn( $dbw, $revision, 0 ); |
1527 | | - |
| 1527 | + |
1528 | 1528 | wfRunHooks( 'NewRevisionFromEditComplete', array($this, $revision, false) ); |
1529 | 1529 | |
1530 | 1530 | if( !( $flags & EDIT_SUPPRESS_RC ) ) { |
— | — | @@ -1835,11 +1835,18 @@ |
1836 | 1836 | } |
1837 | 1837 | $comment = $wgContLang->ucfirst( wfMsgForContent( $comment_type, $this->mTitle->getPrefixedText() ) ); |
1838 | 1838 | |
| 1839 | + # Check if all groups that have required right to edit also can protect pages |
| 1840 | + # Otherwise, people who cannot normally protect can "protect" pages via transclusion |
1839 | 1841 | foreach( $limit as $action => $restrictions ) { |
1840 | | - # Check if the group level required to edit also can protect pages |
1841 | | - # Otherwise, people who cannot normally protect can "protect" pages via transclusion |
1842 | | - $cascade = ( $cascade && isset($wgGroupPermissions[$restrictions]['protect']) && |
1843 | | - $wgGroupPermissions[$restrictions]['protect'] ); |
| 1842 | + # 'sysop' is checked as 'protect', so it is always allowed |
| 1843 | + if ($cascade && ( $restrictions != 'sysop' ) ){ |
| 1844 | + foreach( $wgGroupPermissions as $group => $rights ){ |
| 1845 | + if( isset( $rights[$restrictions] ) && $rights[$restrictions] && !( isset( $rights['protect'] ) && $rights['protect'] ) ){ |
| 1846 | + $cascade = false; |
| 1847 | + break( 2 ); |
| 1848 | + } |
| 1849 | + } |
| 1850 | + } |
1844 | 1851 | } |
1845 | 1852 | |
1846 | 1853 | $cascade_description = ''; |
— | — | @@ -1881,9 +1888,9 @@ |
1882 | 1889 | 'page_latest' => $nullRevId |
1883 | 1890 | ), array( /* WHERE */ |
1884 | 1891 | 'page_id' => $id |
1885 | | - ), 'Article::protect' |
| 1892 | + ), __METHOD__ |
1886 | 1893 | ); |
1887 | | - |
| 1894 | + |
1888 | 1895 | wfRunHooks( 'NewRevisionFromEditComplete', array($this, $nullRevision, false) ); |
1889 | 1896 | wfRunHooks( 'ArticleProtectComplete', array( &$this, &$wgUser, $limit, $reason ) ); |
1890 | 1897 | |
— | — | @@ -2244,7 +2251,7 @@ |
2245 | 2252 | function doDelete( $reason, $suppress = false ) { |
2246 | 2253 | global $wgOut, $wgUser; |
2247 | 2254 | wfDebug( __METHOD__."\n" ); |
2248 | | - |
| 2255 | + |
2249 | 2256 | $id = $this->getId(); |
2250 | 2257 | |
2251 | 2258 | if (wfRunHooks('ArticleDelete', array(&$this, &$wgUser, &$reason))) { |
— | — | @@ -2516,14 +2523,14 @@ |
2517 | 2524 | if( empty( $summary ) ){ |
2518 | 2525 | $summary = wfMsgForContent( 'revertpage' ); |
2519 | 2526 | } |
2520 | | - |
| 2527 | + |
2521 | 2528 | # Allow the custom summary to use the same args as the default message |
2522 | 2529 | $args = array( |
2523 | 2530 | $target->getUserText(), $from, $s->rev_id, |
2524 | 2531 | $wgLang->timeanddate(wfTimestamp(TS_MW, $s->rev_timestamp), true), |
2525 | 2532 | $current->getId(), $wgLang->timeanddate($current->getTimestamp()) |
2526 | 2533 | ); |
2527 | | - $summary = wfMsgReplaceArgs( $summary, $args ); |
| 2534 | + $summary = wfMsgReplaceArgs( $summary, $args ); |
2528 | 2535 | |
2529 | 2536 | # Save |
2530 | 2537 | $flags = EDIT_UPDATE; |
— | — | @@ -2611,7 +2618,7 @@ |
2612 | 2619 | . $wgUser->getSkin()->userToolLinks( $target->getUser(), $target->getUserText() ); |
2613 | 2620 | $wgOut->addHtml( wfMsgExt( 'rollback-success', array( 'parse', 'replaceafter' ), $old, $new ) ); |
2614 | 2621 | $wgOut->returnToMain( false, $this->mTitle ); |
2615 | | - |
| 2622 | + |
2616 | 2623 | if( !$wgRequest->getBool( 'hidediff', false ) ) { |
2617 | 2624 | $de = new DifferenceEngine( $this->mTitle, $current->getId(), 'next', false, true ); |
2618 | 2625 | $de->showDiff( '', '' ); |
— | — | @@ -2983,7 +2990,7 @@ |
2984 | 2991 | $revision->insertOn( $dbw ); |
2985 | 2992 | $this->updateRevisionOn( $dbw, $revision ); |
2986 | 2993 | $dbw->commit(); |
2987 | | - |
| 2994 | + |
2988 | 2995 | wfRunHooks( 'NewRevisionFromEditComplete', array($this, $revision, false) ); |
2989 | 2996 | |
2990 | 2997 | wfProfileOut( __METHOD__ ); |
Index: trunk/phase3/includes/Title.php |
— | — | @@ -1219,15 +1219,10 @@ |
1220 | 1220 | $right = 'protect'; |
1221 | 1221 | } |
1222 | 1222 | if( '' != $right && !$user->isAllowed( $right ) ) { |
1223 | | - //Users with 'editprotected' permission can edit protected pages |
1224 | | - if( $action=='edit' && $user->isAllowed( 'editprotected' ) ) { |
1225 | | - //Users with 'editprotected' permission cannot edit protected pages |
1226 | | - //with cascading option turned on. |
1227 | | - if($this->mCascadeRestriction) { |
1228 | | - $errors[] = array( 'protectedpagetext', $right ); |
1229 | | - } else { |
1230 | | - //Nothing, user can edit! |
1231 | | - } |
| 1223 | + // Users with 'editprotected' permission can edit protected |
| 1224 | + // pages if protection is not with cascading option turned on. |
| 1225 | + if( $action=='edit' && $user->isAllowed( 'editprotected' ) && !$this->areRestrictionsCascading() ) { |
| 1226 | + // Nothing, user can edit! |
1232 | 1227 | } else { |
1233 | 1228 | $errors[] = array( 'protectedpagetext', $right ); |
1234 | 1229 | } |
— | — | @@ -1626,7 +1621,7 @@ |
1627 | 1622 | |
1628 | 1623 | wfProfileIn( __METHOD__ ); |
1629 | 1624 | |
1630 | | - $dbr = wfGetDb( DB_SLAVE ); |
| 1625 | + $dbr = wfGetDB( DB_SLAVE ); |
1631 | 1626 | |
1632 | 1627 | if ( $this->getNamespace() == NS_IMAGE ) { |
1633 | 1628 | $tables = array ('imagelinks', 'page_restrictions'); |
— | — | @@ -1927,7 +1922,7 @@ |
1928 | 1923 | if ($this->mLatestID !== false) |
1929 | 1924 | return $this->mLatestID; |
1930 | 1925 | |
1931 | | - $db = ($flags & GAID_FOR_UPDATE) ? wfGetDB(DB_MASTER) : wfGetDB(DB_SLAVE); |
| 1926 | + $db = ($flags & GAID_FOR_UPDATE) ? wfGetDB( DB_MASTER ) : wfGetDB( DB_SLAVE ); |
1932 | 1927 | return $this->mLatestID = $db->selectField( 'revision', |
1933 | 1928 | "max(rev_id)", |
1934 | 1929 | array('rev_page' => $this->getArticleID($flags)), |