Display a warning when the user name looked up is not registered
authorAditya Sastry <ganeshaditya1@gmail.com>
Thu, 10 Apr 2014 21:24:35 +0000 (02:54 +0530)
committerBartosz Dziewoński <matma.rex@gmail.com>
Sat, 12 Apr 2014 13:08:35 +0000 (15:08 +0200)
Changed the SpecialContributions.php and added a warning message to tell the
user that the name he looked up isn't registered.

Bug: 60524
Change-Id: Ie07001e75a9732f727930f8f367bba8feb395b3e

includes/specials/SpecialContributions.php
languages/i18n/en.json
languages/i18n/qqq.json

index 51606b7..f20355b 100644 (file)
@@ -244,6 +244,16 @@ class SpecialContributions extends IncludableSpecialPage {
         */
        protected function contributionsSub( $userObj ) {
                if ( $userObj->isAnon() ) {
+                       // Show a warning message that the user being searched for doesn't exists
+                       if ( !User::isIP( $userObj ) ) {
+                               $this->getOutput()->wrapWikiMsg(
+                                       "<div class=\"mw-userpage-userdoesnotexist error\">\n\$1\n</div>",
+                                       array(
+                                               'contributions-userdoesnotexist',
+                                               wfEscapeWikiText( $userObj->getName() ),
+                                       )
+                               );
+                       }
                        $user = htmlspecialchars( $userObj->getName() );
                } else {
                        $user = Linker::link( $userObj->getUserPage(), htmlspecialchars( $userObj->getName() ) );
index 6dec0ef..41c12b3 100644 (file)
     "contributions-title": "User contributions for $1",
     "mycontris": "Contributions",
     "contribsub2": "For {{GENDER:$3|$1}} ($2)",
+    "contributions-userdoesnotexist": "User account \"$1\" is not registered.",
     "nocontribs": "No changes were found matching these criteria.",
     "uctop": "(current)",
     "month": "From month (and earlier):",
index f788eaf..ba64764 100644 (file)
     "sp-contributions-footer": "{{ignored}}This is the footer for users that are not anonymous or newbie on [[Special:Contributions]].",
     "sp-contributions-footer-anon": "{{ignored}}This is the footer for anonymous users on [[Special:Contributions]].",
     "sp-contributions-footer-newbies": "{{ignored}}This is the footer for newbie users on [[Special:Contributions]].",
+    "contributions-userdoesnotexist": "This message is used in [[Special:Contributions]]. It is used to tell the user that the name he searched for doesn\\'t exists. Parameters: \n* $1 is the name that was searched for",
     "whatlinkshere": "The text of the link in the toolbox (on the left, below the search menu) going to [[Special:WhatLinksHere]].\n\nSee also:\n* {{msg-mw|Whatlinkshere}}\n* {{msg-mw|Accesskey-t-whatlinkshere}}\n* {{msg-mw|Tooltip-t-whatlinkshere}}",
     "whatlinkshere-title": "Title of the special page [[Special:WhatLinksHere]]. This page appears when you click on the 'What links here' button in the toolbox. $1 is the name of the page concerned.",
     "whatlinkshere-summary": "{{doc-specialpagesummary|whatlinkshere}}",