id "mw-sp-contributions-explain"
* (bug 19159) Fixed \overleftrightarrow in texvc
* (bug 19391) Fix caching for Recent ChangesFeed.
+* (bug 21455) Fixed "Watch this page" checkbox appearing on some special pages
+ even to non-logged in users
== API changes in 1.16 ==
if( $confirm ) {
$this->doDelete( $reason, $suppress );
- if( $wgRequest->getCheck( 'wpWatch' ) ) {
+ if( $wgRequest->getCheck( 'wpWatch' ) && $wgUser->isLoggedIn() ) {
$this->doWatch();
} elseif( $this->mTitle->userIsWatching() ) {
$this->doUnwatch();
'autofocus'
) ) .
"</td>
- </tr>
+ </tr>";
+ # Dissalow watching is user is not logged in
+ if( $wgUser->isLoggedIn() ) {
+ $form .= "
<tr>
<td></td>
<td class='mw-input'>" .
Xml::checkLabel( wfMsg( 'watchthis' ),
'wpWatch', 'wpWatch', $checkWatch, array( 'tabindex' => '3' ) ) .
"</td>
- </tr>
+ </tr>";
+ }
+ $form .= "
$suppress
<tr>
<td></td>
if( wfRunHooks('ArticleDelete', array(&$article, &$wgUser, &$reason, &$error)) ) {
if( $article->doDeleteArticle( $reason, $suppress, $id ) ) {
global $wgRequest;
- if( $wgRequest->getCheck( 'wpWatch' ) ) {
+ if( $wgRequest->getCheck( 'wpWatch' ) && $wgUser->isLoggedIn() ) {
$article->doWatch();
} elseif( $title->userIsWatching() ) {
$article->doUnwatch();
array( 'type' => 'text', 'maxlength' => '255', 'tabindex' => '2', 'id' => 'wpReason' ) ) .
"</td>
</tr>
- {$suppress}
+ {$suppress}";
+ if( $wgUser->isLoggedIn() ) {
+ $form .= "
<tr>
<td></td>
<td class='mw-input'>" .
Xml::checkLabel( wfMsg( 'watchthis' ),
'wpWatch', 'wpWatch', $checkWatch, array( 'tabindex' => '3' ) ) .
"</td>
- </tr>
+ </tr>";
+ }
+ $form .= "
<tr>
<td></td>
<td class='mw-submit'>" .
return false;
}
- if( $wgRequest->getCheck( 'mwProtectWatch' ) ) {
+ if( $wgRequest->getCheck( 'mwProtectWatch' ) && $wgUser->isLoggedIn() ) {
$this->mArticle->doWatch();
} elseif( $this->mTitle->userIsWatching() ) {
$this->mArticle->doUnwatch();
Xml::input( 'mwProtect-reason', 60, $this->mReason, array( 'type' => 'text',
'id' => 'mwProtect-reason', 'maxlength' => 255 ) ) .
"</td>
- </tr>
+ </tr>";
+ # Disallow watching is user is not logged in
+ if( $wgUser->isLoggedIn() ) {
+ $out .= "
<tr>
<td></td>
<td class='mw-input'>" .
'mwProtectWatch', 'mwProtectWatch',
$this->mTitle->userIsWatching() || $wgUser->getOption( 'watchdefault' ) ) .
"</td>
- </tr>
+ </tr>";
+ }
+ $out .= "
<tr>
<td></td>
<td class='mw-submit'>" .
if( self::canBlockEmail( $wgUser ) ) {
$this->BlockEmail = $wgRequest->getBool( 'wpEmailBan', false );
}
- $this->BlockWatchUser = $wgRequest->getBool( 'wpWatchUser', false );
+ $this->BlockWatchUser = $wgRequest->getBool( 'wpWatchUser', false ) && $wgUser->isLoggedIn();
# Re-check user's rights to hide names, very serious, defaults to null
if( $wgUser->isAllowed( 'hideuser' ) ) {
$this->BlockHideName = $wgRequest->getBool( 'wpHideName', null );
);
}
- # Watchlist their user page?
- $wgOut->addHTML("
+ # Watchlist their user page? (Only if user is logged in)
+ if( $wgUser->isLoggedIn() ) {
+ $wgOut->addHTML("
<tr id='wpEnableWatchUser'>
<td> </td>
<td class='mw-input'>" .
array( 'tabindex' => '11' ) ) . "
</td>
</tr>"
- );
+ );
+ }
# Can we explicitly disallow the use of user_talk?
global $wgBlockAllowsUTEdit;
$this->moveSubpages = $wgRequest->getBool( 'wpMovesubpages', false );
$this->deleteAndMove = $wgRequest->getBool( 'wpDeleteAndMove' ) && $wgRequest->getBool( 'wpConfirm' );
$this->moveOverShared = $wgRequest->getBool( 'wpMoveOverSharedFile', false );
- $this->watch = $wgRequest->getCheck( 'wpWatch' );
+ $this->watch = $wgRequest->getCheck( 'wpWatch' ) && $wgUser->isLoggedIn();
}
/**
);
}
- $watchChecked = $this->watch || $wgUser->getBoolOption( 'watchmoves' )
- || $this->oldTitle->userIsWatching();
- $wgOut->addHTML( "
+ $watchChecked = $wgUser->isLoggedIn() && ($this->watch || $wgUser->getBoolOption( 'watchmoves' )
+ || $this->oldTitle->userIsWatching());
+ # Don't allow watching if user is not logged in
+ if( $wgUser->isLoggedIn() ) {
+ $wgOut->addHTML( "
<tr>
<td></td>
<td class='mw-input'>" .
Xml::checkLabel( wfMsg( 'move-watch' ), 'wpWatch', 'watch', $watchChecked ) .
"</td>
- </tr>
+ </tr>");
+ }
+
+ $wgOut->addHTML( "
{$confirm}
<tr>
<td> </td>
}
# Deal with watches (we don't watch subpages)
- if( $this->watch ) {
+ if( $this->watch && $wgUser->isLoggedIn() ) {
$wgUser->addWatch( $ot );
$wgUser->addWatch( $nt );
} else {
$this->mIgnoreWarning = $request->getCheck( 'wpIgnoreWarning' )
|| $request->getCheck( 'wpUploadIgnoreWarning' );
- $this->mWatchthis = $request->getBool( 'wpWatchthis' );
+ $this->mWatchthis = $request->getBool( 'wpWatchthis' ) && $wgUser->isLoggedIn();
$this->mCopyrightStatus = $request->getText( 'wpUploadCopyStatus' );
$this->mCopyrightSource = $request->getText( 'wpUploadSource' );
* @return array Descriptor array
*/
protected function getOptionsSection() {
- global $wgOut;
+ global $wgUser, $wgOut;
- $descriptor = array(
- 'Watchthis' => array(
- 'type' => 'check',
- 'id' => 'wpWatchthis',
- 'label-message' => 'watchthisupload',
- 'section' => 'options',
- )
- );
- if ( !$this->mHideIgnoreWarning ) {
+ if( $wgUser->isLoggedIn() ) {
+ $descriptor = array(
+ 'Watchthis' => array(
+ 'type' => 'check',
+ 'id' => 'wpWatchthis',
+ 'label-message' => 'watchthisupload',
+ 'section' => 'options',
+ )
+ );
+ }
+ if( !$this->mHideIgnoreWarning ) {
$descriptor['IgnoreWarning'] = array(
'type' => 'check',
'id' => 'wpIgnoreWarning',