Index: trunk/phase3/includes/Parser.php |
— | — | @@ -3054,11 +3054,13 @@ |
3055 | 3055 | $doNumberHeadings = $this->mOptions->getNumberHeadings(); |
3056 | 3056 | $doShowToc = true; |
3057 | 3057 | $forceTocHere = false; |
3058 | | - if( !$this->mTitle->userCanEdit() ) { |
3059 | | - $showEditLink = 0; |
3060 | | - } else { |
3061 | | - $showEditLink = $this->mOptions->getEditSection(); |
3062 | | - } |
| 3058 | + |
| 3059 | + # Show section editing links if the user can edit the page and has |
| 3060 | + # the appropriate preference set |
| 3061 | + $user =& $this->mOptions->getUser(); |
| 3062 | + $perm = $user->isAllowed( 'edit' ) && $this->mTitle->userCanEdit(); |
| 3063 | + $pref = $this->mOptions->getEditSection(); |
| 3064 | + $showEditLink = $perm && $pref; |
3063 | 3065 | |
3064 | 3066 | # Inhibit editsection links if requested in the page |
3065 | 3067 | $esw =& MagicWord::get( MAG_NOEDITSECTION ); |
— | — | @@ -4219,6 +4221,7 @@ |
4220 | 4222 | var $mAllowSpecialInclusion; # Allow inclusion of special pages |
4221 | 4223 | var $mTidy; # Ask for tidy cleanup |
4222 | 4224 | var $mInterfaceMessage; # Which lang to call for PLURAL and GRAMMAR |
| 4225 | + var $mUser; # User being parsed for |
4223 | 4226 | |
4224 | 4227 | function getUseTeX() { return $this->mUseTeX; } |
4225 | 4228 | function getUseDynamicDates() { return $this->mUseDynamicDates; } |
— | — | @@ -4232,6 +4235,7 @@ |
4233 | 4236 | function getAllowSpecialInclusion() { return $this->mAllowSpecialInclusion; } |
4234 | 4237 | function getTidy() { return $this->mTidy; } |
4235 | 4238 | function getInterfaceMessage() { return $this->mInterfaceMessage; } |
| 4239 | + function getUser() { return $this->mUser; } |
4236 | 4240 | |
4237 | 4241 | function setUseTeX( $x ) { return wfSetVar( $this->mUseTeX, $x ); } |
4238 | 4242 | function setUseDynamicDates( $x ) { return wfSetVar( $this->mUseDynamicDates, $x ); } |
— | — | @@ -4274,6 +4278,7 @@ |
4275 | 4279 | $user =& $userInput; |
4276 | 4280 | } |
4277 | 4281 | |
| 4282 | + $this->mUser =& $user; |
4278 | 4283 | $this->mUseTeX = $wgUseTeX; |
4279 | 4284 | $this->mUseDynamicDates = $wgUseDynamicDates; |
4280 | 4285 | $this->mInterwikiMagic = $wgInterwikiMagic; |
— | — | @@ -4283,7 +4288,7 @@ |
4284 | 4289 | $this->mSkin =& $user->getSkin(); |
4285 | 4290 | wfProfileOut( $fname.'-skin' ); |
4286 | 4291 | $this->mDateFormat = $user->getOption( 'date' ); |
4287 | | - $this->mEditSection = true; |
| 4292 | + $this->mEditSection = $user->getOption( 'editsection' ); |
4288 | 4293 | $this->mNumberHeadings = $user->getOption( 'numberheadings' ); |
4289 | 4294 | $this->mAllowSpecialInclusion = $wgAllowSpecialInclusion; |
4290 | 4295 | $this->mTidy = false; |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -266,6 +266,7 @@ |
267 | 267 | Special:Statistics |
268 | 268 | * (bug 5949) Update to Indonesian localisation (id) |
269 | 269 | * (bug 5862) Update of Belarusian translation (be) |
| 270 | +* (bug 5651) Disable section editing links for users who can't edit |
270 | 271 | |
271 | 272 | == Compatibility == |
272 | 273 | |