Include user name in Special:BotPassword success messages
authorBrad Jorsch <bjorsch@wikimedia.org>
Wed, 9 Mar 2016 19:20:23 +0000 (14:20 -0500)
committerBrad Jorsch <bjorsch@wikimedia.org>
Wed, 9 Mar 2016 19:20:23 +0000 (14:20 -0500)
Change-Id: Ib7cf409e66639947341126f1cfd7fca9fbb18295

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

index 11357fb..2b43a77 100644 (file)
@@ -315,20 +315,21 @@ class SpecialBotPasswords extends FormSpecialPage {
        public function onSuccess() {
                $out = $this->getOutput();
 
+               $username = $this->getUser()->getName();
                switch ( $this->operation ) {
                        case 'insert':
                                $out->setPageTitle( $this->msg( 'botpasswords-created-title' )->text() );
-                               $out->addWikiMsg( 'botpasswords-created-body', $this->par );
+                               $out->addWikiMsg( 'botpasswords-created-body', $this->par, $username );
                                break;
 
                        case 'update':
                                $out->setPageTitle( $this->msg( 'botpasswords-updated-title' )->text() );
-                               $out->addWikiMsg( 'botpasswords-updated-body', $this->par );
+                               $out->addWikiMsg( 'botpasswords-updated-body', $this->par, $username );
                                break;
 
                        case 'delete':
                                $out->setPageTitle( $this->msg( 'botpasswords-deleted-title' )->text() );
-                               $out->addWikiMsg( 'botpasswords-deleted-body', $this->par );
+                               $out->addWikiMsg( 'botpasswords-deleted-body', $this->par, $username );
                                $this->password = null;
                                break;
                }
@@ -337,7 +338,7 @@ class SpecialBotPasswords extends FormSpecialPage {
                        $sep = BotPassword::getSeparator();
                        $out->addWikiMsg(
                                'botpasswords-newpassword',
-                               htmlspecialchars( $this->getUser()->getName() . $sep . $this->par ),
+                               htmlspecialchars( $username . $sep . $this->par ),
                                htmlspecialchars( $this->password )
                        );
                        $this->password = null;
index fea9fbd..99f5066 100644 (file)
        "botpasswords-insert-failed": "Failed to add bot name \"$1\". Was it already added?",
        "botpasswords-update-failed": "Failed to update bot name \"$1\". Was it deleted?",
        "botpasswords-created-title": "Bot password created",
-       "botpasswords-created-body": "The bot password \"$1\" was created.",
+       "botpasswords-created-body": "The bot password for bot name \"$1\" of user \"$2\" was created.",
        "botpasswords-updated-title": "Bot password updated",
-       "botpasswords-updated-body": "The bot password \"$1\" was updated.",
+       "botpasswords-updated-body": "The bot password for bot name \"$1\" of user \"$2\" was updated.",
        "botpasswords-deleted-title": "Bot password deleted",
-       "botpasswords-deleted-body": "The bot password \"$1\" was deleted.",
+       "botpasswords-deleted-body": "The bot password for bot name \"$1\" of user \"$2\" was deleted.",
        "botpasswords-newpassword": "The new password to log in with <strong>$1</strong> is <strong>$2</strong>. <em>Please record this for future reference.</em>",
        "botpasswords-no-provider": "BotPasswordsSessionProvider is not available.",
        "botpasswords-restriction-failed": "Bot password restrictions prevent this login.",
index b388053..63264f3 100644 (file)
        "botpasswords-insert-failed": "Error message when saving a new bot password failed. It's likely that the failure was because the user resubmitted the form after a previous successful save. Parameters:\n* $1 - Bot name",
        "botpasswords-update-failed": "Error message when saving changes to an existing bot password failed. It's likely that the failure was because the user deleted the bot password in another browser window. Parameters:\n* $1 - Bot name",
        "botpasswords-created-title": "Title of the success page when a new bot password is created.",
-       "botpasswords-created-body": "Success message when a new bot password is created. Parameters:\n* $1 - Bot name",
+       "botpasswords-created-body": "Success message when a new bot password is created. Parameters:\n* $1 - Bot name\n* $2 - User name",
        "botpasswords-updated-title": "Title of the success page when a bot password is updated.",
-       "botpasswords-updated-body": "Success message when a bot password is updated. Parameters:\n* $1 - Bot name",
+       "botpasswords-updated-body": "Success message when a bot password is updated. Parameters:\n* $1 - Bot name\n* $2 - User name",
        "botpasswords-deleted-title": "Title of the success page when a bot password is deleted.",
-       "botpasswords-deleted-body": "Success message when a bot password is deleted. Parameters:\n* $1 - Bot name",
+       "botpasswords-deleted-body": "Success message when a bot password is deleted. Parameters:\n* $1 - Bot name\n* $2 - User name",
        "botpasswords-newpassword": "Success message to display the new password when a bot password is created or updated. Parameters:\n* $1 - User name to be used for login.\n* $2 - Password to be used for login.",
        "botpasswords-no-provider": "Error message when login is attempted but the BotPasswordsSessionProvider is not included in <code>$wgSessionProviders</code>.",
        "botpasswords-restriction-failed": "Error message when login is rejected because the configured restrictions were not satisfied.",