Index: branches/werdna/restrictions-separation/maintenance/archives/patch-page_restrictions.sql |
— | — | @@ -19,8 +19,4 @@ |
20 | 20 | KEY pr_typelevel (pr_type,pr_level), |
21 | 21 | KEY pr_level (pr_level), |
22 | 22 | KEY pr_cascade (pr_cascade) |
23 | | -) TYPE=InnoDB; |
24 | | - |
25 | | -ALTER TABLE /*$wgDBprefix*/page |
26 | | - ALTER COLUMN page_restrictions |
27 | | - SET DEFAULT ''; |
\ No newline at end of file |
| 23 | +) TYPE=InnoDB; |
\ No newline at end of file |
Index: branches/werdna/restrictions-separation/includes/ProtectionForm.php |
— | — | @@ -25,7 +25,7 @@ |
26 | 26 | class ProtectionForm { |
27 | 27 | var $mRestrictions = array(); |
28 | 28 | var $mReason = ''; |
29 | | - var $mCascade = 0; |
| 29 | + var $mCascade = false; |
30 | 30 | |
31 | 31 | function ProtectionForm( &$article ) { |
32 | 32 | global $wgRequest, $wgUser; |
— | — | @@ -151,6 +151,8 @@ |
152 | 152 | $out .= "</tbody>\n"; |
153 | 153 | $out .= "</table>\n"; |
154 | 154 | |
| 155 | + global $wgEnableCascadingProtection; |
| 156 | + |
155 | 157 | if ($wgEnableCascadingProtection) |
156 | 158 | $out .= $this->buildCascadeInput(); |
157 | 159 | |
— | — | @@ -214,8 +216,8 @@ |
215 | 217 | function buildCascadeInput() { |
216 | 218 | $id = 'mwProtect-cascade'; |
217 | 219 | $ci = wfCheckLabel( wfMsg( 'protect-cascade' ), $id, $id, $this->mCascade, array ()); |
218 | | - $id = 'mwProtect-cascadeonly'; |
219 | | - $ci .= wfCheckLabel( wfMsg( 'protect-cascadeonly' ), $id, $id, $this->mCascade, array ()); |
| 220 | + |
| 221 | + return $ci; |
220 | 222 | } |
221 | 223 | |
222 | 224 | function buildSubmit() { |
Index: branches/werdna/restrictions-separation/includes/Article.php |
— | — | @@ -1649,6 +1649,7 @@ |
1650 | 1650 | $updated = Article::flattenRestrictions( $limit ); |
1651 | 1651 | |
1652 | 1652 | $changed = ( $current != $updated ); |
| 1653 | + $changed = $changed || ($this->mTitle->getRestrictionCascadingFlags() != $cascade); |
1653 | 1654 | $protect = ( $updated != '' ); |
1654 | 1655 | |
1655 | 1656 | # If nothing's changed, do nothing |
— | — | @@ -1671,8 +1672,7 @@ |
1672 | 1673 | if ($restrictions != '' ) { |
1673 | 1674 | $dbw->replace( 'page_restrictions', array( 'pr_pagetype'), |
1674 | 1675 | array( 'pr_page' => $id, 'pr_type' => $action |
1675 | | - , 'pr_level' => $restrictions, 'pr_cascade' => $cascade ), __METHOD__ |
1676 | | -); |
| 1676 | + , 'pr_level' => $restrictions, 'pr_cascade' => $cascade ), __METHOD__ ); |
1677 | 1677 | } else { |
1678 | 1678 | $dbw->delete( 'page_restrictions', array( 'pr_page' => $id, |
1679 | 1679 | 'pr_type' => $action ), __METHOD__ ); |
Index: branches/werdna/restrictions-separation/includes/OutputPage.php |
— | — | @@ -319,7 +319,7 @@ |
320 | 320 | addWikiTextTitle( $text, $title, $linestart, true ); |
321 | 321 | } |
322 | 322 | |
323 | | - private function addWikiTextTitle($text, &$title, $linestart, $tidy = false) { |
| 323 | + public function addWikiTextTitle($text, &$title, $linestart, $tidy = false) { |
324 | 324 | global $wgParser; |
325 | 325 | |
326 | 326 | $fname = 'OutputPage:addWikiTextTitle'; |
Index: branches/werdna/restrictions-separation/includes/Title.php |
— | — | @@ -1118,7 +1118,7 @@ |
1119 | 1119 | } |
1120 | 1120 | |
1121 | 1121 | if ( ( $this->isCascadeProtectedPage() ) || |
1122 | | - ($this->getNamespace == NS_IMAGE && $this->isCascadeProtectedImage() ) ) { |
| 1122 | + ($this->getNamespace() == NS_IMAGE && $this->isCascadeProtectedImage() ) ) { |
1123 | 1123 | # We /could/ use the protection level on the source page, but it's fairly ugly |
1124 | 1124 | # as we have to establish a precedence hierarchy for pages included by multiple |
1125 | 1125 | # cascade-protected pages. So just restrict it to people with 'protect' permission, |