This needs more work before going into trunk, which you'll remember is *what is live at any given time* except when we've got a problem going on.
* Add accesskey 's' and tooltip to 'upload file' button at Special:Upload
* Introduced 'SkinAfterBottomScripts' hook; see docs/hooks.txt for
more information
-* (bug 10347) Give notice when a page is viewed that is protected. Does not
- show for cascade protection however.
== Bugfixes since 1.10 ==
* Resizing transparent GIF images with GD now retains transparency by skipping
resampling
* (bug 11065) Fix regression in handling of wiki-formatted EXIF metadata
-* (bug 10347) Add subtitle message to indicate that the page being viewed is
- protected.
* Double encoding broke Special:Newpages for some languages
* Adding a newline before the statistics footer, to prevent parsing problems
* Preventing the TOC from appearing in Special:Statistics
}
}
- if ( $this->mTitle->isProtected() ) {
- $editrestr = $this->mTitle->getRestrictions('edit');
- $this->addProtectionNotice( $editrestr );
- }
-
$outputDone = false;
wfRunHooks( 'ArticleViewHeader', array( &$this, &$outputDone, &$pcache ) );
if ( $pcache ) {
wfProfileOut( __METHOD__ );
}
- /*
- * Output a notice that a page is protected. Only give details for edit
- * restrictions. Cares only about the first permission in the arrays, which is
- * part of a larger shitty inconsistency about requiring several permissions...
- * @param Array $editrestr, edit restrictions
- */
- function addProtectionNotice( $editrestr ) {
- global $wgOut;
-
- if( empty($editrestr) )
- return;
-
- $permission = $editrestr[0];
- $permission = ($permission=='sysop') ? 'protect' : $permission;
-
- $editGroups = '';
- # Get groups that have each right
- if( $permission ) {
- $editGroups = $wgOut->getGroupsWithPermission( $permission );
- $editGroups = implode( ', ', $editGroups );
- }
- # Use general messages if no groups found for a type
- if( !$editGroups ) {
- $msg = wfMsgExt( 'protected-subtitle', array('parsemag'), $editrestr );
- } else {
- $msg = wfMsgExt( 'protected-subtitle-edit', array('parsemag'), $editGroups, $editrestr );
- }
- if( $wgOut->getSubtitle() )
- $msg = " $msg";
-
- $wgOut->setSubtitle( $wgOut->getSubtitle() . $msg );
- }
-
function addTrackbacks() {
global $wgOut, $wgUser;
* @param string $permission key required
*/
public function permissionRequired( $permission ) {
- global $wgUser;
+ global $wgGroupPermissions, $wgUser;
$this->setPageTitle( wfMsg( 'badaccess' ) );
$this->setHTMLTitle( wfMsg( 'errorpagetitle' ) );
$this->setArticleRelated( false );
$this->mBodytext = '';
- $groups = $this->getGroupsWithPermission( $permission );
- $n = count( $groups );
- $groups = implode( ', ', $groups );
- switch( $n ) {
- case 0:
- case 1:
- case 2:
- $message = wfMsgHtml( "badaccess-group$n", $groups );
- break;
- default:
- $message = wfMsgHtml( 'badaccess-groups', $groups );
- }
- $this->addHtml( $message );
- $this->returnToMain( false );
- }
-
- /**
- * Return an array of the groups in (UI name form) that have a permission
- *
- * @param string $permission key required
- */
- public function getGroupsWithPermission( $permission ) {
- global $wgUser, $wgGroupPermissions;
-
$groups = array();
foreach( $wgGroupPermissions as $key => $value ) {
if( isset( $value[$permission] ) && $value[$permission] == true ) {
}
}
}
- return $groups;
+ $n = count( $groups );
+ $groups = implode( ', ', $groups );
+ switch( $n ) {
+ case 0:
+ case 1:
+ case 2:
+ $message = wfMsgHtml( "badaccess-group$n", $groups );
+ break;
+ default:
+ $message = wfMsgHtml( 'badaccess-groups', $groups );
+ }
+ $this->addHtml( $message );
+ $this->returnToMain( false );
}
/**
'namespaceprotected' => "Du hast keine Berechtigung, die Seite in dem '''$1'''-Namensraum zu bearbeiten.",
'customcssjsprotected' => 'Du bist nicht berechtigt diese Seite zu bearbeiten, da sie zu den persönlichen Einstellungen eines anderen Benutzers gehört.',
'ns-specialprotected' => 'Seiten im {{ns:special}}-Namensraum können nicht bearbeitet werden.',
-'protected-subtitle' => '(Diese Seite ist geschützt)',
-'protected-subtitle-same' => '(Diese Seite ist geschützt. Benutzer der Gruppe(n) „$1“ können sie weiterhin bearbeiten oder verschieben.)',
-'protected-subtitle-each' => '(Diese Seite ist geschützt. Benutzer der Gruppe(n) „$1“ können sie weiterhin bearbeiten und Benutzer der Gruppe(n) „$2“ verschieben.)',
-'protected-anyone' => 'Jeder',
# Login and logout pages
'logouttitle' => 'Benutzer-Abmeldung',
'sqlhidden' => '(SQL query hidden)',
'cascadeprotected' => "This page has been protected from editing, because it is included in the following {{PLURAL:$1|page|pages}}, which are protected with the \"cascading\" option turned on:
$2",
-'namespaceprotected' => "You do not have permission to edit pages in the '''$1''' namespace.",
-'customcssjsprotected' => "You do not have permission to edit this page, because it contains another user's personal settings.",
-'ns-specialprotected' => "Pages in the {{ns:special}} namespace cannot be edited.",
-'protected-subtitle' => "(This page is protected)",
-'protected-subtitle-edit' => "(This page is protected. Only certain users ($1) can edit it.)",
+'namespaceprotected' => "You do not have permission to edit pages in the '''$1''' namespace.",
+'customcssjsprotected' => "You do not have permission to edit this page, because it contains another user's personal settings.",
+'ns-specialprotected' => "Pages in the {{ns:special}} namespace cannot be edited.",
# Login and logout pages
'logouttitle' => 'User logout',
'namespaceprotected' => "אינכם מורשים לערוך דפים במרחב השם '''$1'''.",
'customcssjsprotected' => 'אינכם מורשים לערוך דף זה, כיוון שהוא כולל את ההגדרות האישיות של משתמש אחר.',
'ns-specialprotected' => 'לא ניתן לערוך דפים מיוחדים.',
-'protected-subtitle' => '(דף זה מוגן)',
-'protected-subtitle-edit' => '(דף זה מוגן כך שרק משתמשים מסוימים ($1) יכולים לערוך אותו)',
# Login and logout pages
'logouttitle' => 'יציאה מהחשבון',
'namespaceprotected' => "'''$1''' ەسٸم اياسىنداعى بەتتەردٸ ٶڭدەۋ ٷشٸن رۇقساتىڭىز جوق.",
'customcssjsprotected' => 'بۇل بەتتٸ ٶڭدەۋگە رۇقساتىڭىز جوق, سەبەبٸ مىندا باسقا قاتىسۋشىنىڭ جەكە باپتاۋلارى بار.',
'ns-specialprotected' => '{{ns:special}} ەسٸم اياسىنداعى بەتتەر ٶڭدەلٸنبەيدٸ',
-'protected-subtitle' => '(بۇل بەت قورعالعان)',
-'protected-subtitle-same' => '(بۇل بەت قورعالعان. كەيبٸر پايدالانۋشىلار ($1) ٵلٸ دە بۇنى ٶڭدەي نە جىلجىتا الادى.)',
-'protected-subtitle-each' => '(بۇل بەت قورعالعان. كەيبٸر پايدالانۋشىلار ($1) ٵلٸ دە بۇنى ٶڭدەي الادى جٵنە باسقالار ($2) بۇنى جىلجىتا الادى.)',
-'protected-anyone' => 'ٵركٸم',
# Login and logout pages
'logouttitle' => 'قاتىسۋشى شىعۋى',
'namespaceprotected' => "'''$1''' есім аясындағы беттерді өңдеу үшін рұқсатыңыз жоқ.",
'customcssjsprotected' => 'Бұл бетті өңдеуге рұқсатыңыз жоқ, себебі мында басқа қатысушының жеке баптаулары бар.',
'ns-specialprotected' => '{{ns:special}} есім аясындағы беттер өңделінбейді',
-'protected-subtitle' => '(Бұл бет қорғалған)',
-'protected-subtitle-same' => '(Бұл бет қорғалған. Кейбір пайдаланушылар ($1) әлі де бұны өңдей не жылжыта алады.)',
-'protected-subtitle-each' => '(Бұл бет қорғалған. Кейбір пайдаланушылар ($1) әлі де бұны өңдей алады және басқалар ($2) бұны жылжыта алады.)',
-'protected-anyone' => 'әркім',
# Login and logout pages
'logouttitle' => 'Қатысушы шығуы',
'namespaceprotected' => "'''$1''' esim ayasındağı betterdi öñdew üşin ruqsatıñız joq.",
'customcssjsprotected' => 'Bul betti öñdewge ruqsatıñız joq, sebebi mında basqa qatıswşınıñ jeke baptawları bar.',
'ns-specialprotected' => '{{ns:special}} esim ayasındağı better öñdelinbeýdi',
-'protected-subtitle' => '(Bul bet qorğalğan)',
-'protected-subtitle-same' => '(Bul bet qorğalğan. Keýbir paýdalanwşılar ($1) äli de bunı öñdeý ne jıljıta aladı.)',
-'protected-subtitle-each' => '(Bul bet qorğalğan. Keýbir paýdalanwşılar ($1) äli de bunı öñdeý aladı jäne basqalar ($2) bunı jıljıta aladı.)',
-'protected-anyone' => 'ärkim',
# Login and logout pages
'logouttitle' => 'Qatıswşı şığwı',
'customcssjsprotected',
'ns-specialprotected',
'protected-subtitle',
- 'protected-subtitle-edit',
+ 'protected-subtitle-same',
+ 'protected-subtitle-each',
+ 'protected-anyone',
),
'login' => array(
'logouttitle',