$wgOut->addWikiText( wfMsg( 'anoneditwarning' ) );
}
- if( $this->mTitle->isProtected('edit') ) {
- $wgOut->addWikiText( wfMsg( 'protectedpagewarning' ) );
+ if( $this->mTitle->isProtected( 'edit' ) ) {
+ if( $this->mTitle->isSemiProtected() ) {
+ $notice = wfMsg( 'semiprotectedpagewarning' );
+ if( wfEmptyMsg( 'semiprotectedpagewarning', $notice ) || $notice == '-' ) {
+ $notice = '';
+ }
+ } else {
+ $notice = wfMsg( 'protectedpagewarning' );
+ }
+ $wgOut->addWikiText( $notice );
}
-
+
$kblength = (int)(strlen( $this->textbox1 ) / 1024);
if( $kblength > 29 ) {
$wgOut->addWikiText( wfMsg( 'longpagewarning', $wgLang->formatNum( $kblength ) ) );
*/
function isExternal() { return ( '' != $this->mInterwiki ); }
+ /**
+ * Is this page "semi-protected" - the *only* protection is autoconfirm?
+ *
+ * @param string Action to check (default: edit)
+ * @return bool
+ */
+ function isSemiProtected( $action = 'edit' ) {
+ $restrictions = $this->getRestrictions( $action );
+ # We do a full compare because this could be an array
+ foreach( $restrictions as $restriction ) {
+ if( strtolower( $restriction ) != 'autoconfirmed' ) {
+ return( false );
+ }
+ }
+ return( true );
+ }
+
/**
* Does the title correspond to a protected article?
* @param string $what the action the page is protected from,
so you will not be able to save your edits right now. You may wish to cut-n-paste
the text into a text file and save it for later.</strong>',
'protectedpagewarning' => "<strong>WARNING: This page has been locked so that only users with sysop privileges can edit it. Be sure you are following the [[Project:Protected_page_guidelines|protected page guidelines]].</strong>",
+'semiprotectedpagewarning' => "'''Note:''' This page has been locked so that only registered users can edit it.",
'templatesused' => 'Templates used on this page:',
'edittools' => '<!-- Text here will be shown below edit and upload forms. -->',
'nocreatetitle' => 'Page creation limited',