Merge "Skin: Avoid redirect=no for links to non-redirects"
[lhc/web/wiklou.git] / includes / specials / SpecialBotPasswords.php
index f03565a..2d62d8f 100644 (file)
@@ -22,6 +22,7 @@
  */
 
 use MediaWiki\Logger\LoggerFactory;
+use MediaWiki\MediaWikiServices;
 
 /**
  * Let users manage bot passwords
@@ -57,6 +58,10 @@ class SpecialBotPasswords extends FormSpecialPage {
                return $this->getConfig()->get( 'EnableBotPasswords' );
        }
 
+       protected function getLoginSecurityLevel() {
+               return $this->getName();
+       }
+
        /**
         * Main execution point
         * @param string|null $par
@@ -162,8 +167,7 @@ class SpecialBotPasswords extends FormSpecialPage {
 
                } else {
                        $linkRenderer = $this->getLinkRenderer();
-                       $passwordFactory = new PasswordFactory();
-                       $passwordFactory->init( $this->getConfig() );
+                       $passwordFactory = MediaWikiServices::getInstance()->getPasswordFactory();
 
                        $dbr = BotPassword::getDB( DB_REPLICA );
                        $res = $dbr->select(
@@ -317,8 +321,7 @@ class SpecialBotPasswords extends FormSpecialPage {
 
                if ( $this->operation === 'insert' || !empty( $data['resetPassword'] ) ) {
                        $this->password = BotPassword::generatePassword( $this->getConfig() );
-                       $passwordFactory = new PasswordFactory();
-                       $passwordFactory->init( RequestContext::getMain()->getConfig() );
+                       $passwordFactory = MediaWikiServices::getInstance()->getPasswordFactory();
                        $password = $passwordFactory->newFromPlaintext( $this->password );
                } else {
                        $password = null;