X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialBotPasswords.php;h=1027f1f6e83efac8f9c00bbb5ade19c91f7326f2;hb=5cbada9dea3f22e7bb33250197b156e8628b8e4a;hp=37f769ee93b260d63289ceace1e46052137913ea;hpb=207a47a1fe50f51e999e28e1796c083e46860a15;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialBotPasswords.php b/includes/specials/SpecialBotPasswords.php index 37f769ee93..1027f1f6e8 100644 --- a/includes/specials/SpecialBotPasswords.php +++ b/includes/specials/SpecialBotPasswords.php @@ -84,9 +84,6 @@ class SpecialBotPasswords extends FormSpecialPage { } protected function getFormFields() { - $user = $this->getUser(); - $request = $this->getRequest(); - $fields = []; if ( $this->par !== null ) { @@ -192,6 +189,7 @@ class SpecialBotPasswords extends FormSpecialPage { 'type' => 'textwithbutton', 'label-message' => 'botpasswords-label-appid', 'buttondefault' => $this->msg( 'botpasswords-label-create' )->text(), + 'buttonflags' => [ 'progressive', 'primary' ], 'required' => true, 'size' => BotPassword::APPID_MAXLENGTH, 'maxlength' => BotPassword::APPID_MAXLENGTH, @@ -315,20 +313,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 +336,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; @@ -346,24 +345,6 @@ class SpecialBotPasswords extends FormSpecialPage { $out->addReturnTo( $this->getPageTitle() ); } - /** - * Return an array of subpages beginning with $search that this special page will accept. - * - * @param string $search Prefix to search for - * @param int $limit Maximum number of results to return (usually 10) - * @param int $offset Number of results to skip (usually 0) - * @return string[] Matching subpages - */ - public function prefixSearchSubpages( $search, $limit, $offset ) { - $user = User::newFromName( $search ); - if ( !$user ) { - // No prefix suggestion for invalid user - return []; - } - // Autocomplete subpage as user list - public to allow caching - return UserNamePrefixSearch::search( 'public', $search, $limit, $offset ); - } - protected function getGroupName() { return 'users'; }