Re-establishing validation feature (the beginnings)
[lhc/web/wiklou.git] / includes / SpecialWatchlist.php
index 8b9f7db..3d14b2a 100644 (file)
@@ -27,8 +27,7 @@ function wfSpecialWatchlist() {
 
        $specialTitle = Title::makeTitle( NS_SPECIAL, 'Watchlist' );
 
-       $uid = $wgUser->getID();
-       if( $uid == 0 ) {
+       if( $wgUser->isAnon() ) {
                $wgOut->addWikiText( wfMsg( 'nowatchlist' ) );
                return;
        }
@@ -39,8 +38,20 @@ function wfSpecialWatchlist() {
        $remove = $wgRequest->getVal( 'remove' );
        $id = $wgRequest->getArray( 'id' );
 
-       $wgOut->addWikiText( wfMsg( 'email_notification_infotext' ) );
+       if( $wgUser->getOption( 'enotifwatchlistpages' ) ) {
+               $wgOut->addHTML( "<div class='enotifinfo'>\n" );
+               
+               $wgOut->addWikiText( wfMsg( 'email_notification_infotext' ) );
+
+               $wgOut->addHTML( '<form action="' .
+                       $specialTitle->escapeLocalUrl( 'action=submit&magic=yes' ) .
+                       '" method="post"><input type="submit" name="dummy" value="' .
+                       htmlspecialchars( wfMsg( 'email_notification_reset' ) ) .
+                       '" /><input type="hidden" name="reset" value="all" /></form>' .
+                       "</div>\n\n" );
+       }
 
+       $uid = $wgUser->getID();
        if( $wgRequest->getVal( 'reset' ) == 'all' ) {
                $wgUser->clearAllNotifications( $uid );
        }