From 8324e3b7a8cdf7d4828c6695a24c655c0de83f61 Mon Sep 17 00:00:00 2001 From: Brad Jorsch Date: Wed, 9 Mar 2016 14:20:23 -0500 Subject: [PATCH] Include user name in Special:BotPassword success messages Change-Id: Ib7cf409e66639947341126f1cfd7fca9fbb18295 --- includes/specials/SpecialBotPasswords.php | 9 +++++---- languages/i18n/en.json | 6 +++--- languages/i18n/qqq.json | 6 +++--- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/includes/specials/SpecialBotPasswords.php b/includes/specials/SpecialBotPasswords.php index 11357fbd0b..2b43a77b71 100644 --- a/includes/specials/SpecialBotPasswords.php +++ b/includes/specials/SpecialBotPasswords.php @@ -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; diff --git a/languages/i18n/en.json b/languages/i18n/en.json index fea9fbd4ca..99f5066f26 100644 --- a/languages/i18n/en.json +++ b/languages/i18n/en.json @@ -555,11 +555,11 @@ "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 $1 is $2. Please record this for future reference.", "botpasswords-no-provider": "BotPasswordsSessionProvider is not available.", "botpasswords-restriction-failed": "Bot password restrictions prevent this login.", diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json index b388053d8a..63264f3c3c 100644 --- a/languages/i18n/qqq.json +++ b/languages/i18n/qqq.json @@ -731,11 +731,11 @@ "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 $wgSessionProviders.", "botpasswords-restriction-failed": "Error message when login is rejected because the configured restrictions were not satisfied.", -- 2.20.1