From c0ca0b259015538daba509924a0c7b82e6578566 Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Sun, 3 Aug 2014 14:32:34 -0700 Subject: [PATCH] SpecialChangePassword: Use Config instead of globals Change-Id: Iabd07d226ea6da340dc7fc52a2370c287b769bbc --- includes/specials/SpecialChangePassword.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/includes/specials/SpecialChangePassword.php b/includes/specials/SpecialChangePassword.php index ad1d597113..867fd1bcf5 100644 --- a/includes/specials/SpecialChangePassword.php +++ b/includes/specials/SpecialChangePassword.php @@ -77,8 +77,6 @@ class SpecialChangePassword extends FormSpecialPage { } protected function getFormFields() { - global $wgCookieExpiration; - $user = $this->getUser(); $request = $this->getRequest(); @@ -134,8 +132,9 @@ class SpecialChangePassword extends FormSpecialPage { $fields['Remember'] = array( 'type' => 'check', 'label' => $this->msg( 'remembermypassword' ) - ->numParams( ceil( $wgCookieExpiration / ( 3600 * 24 ) ) ) - ->text(), + ->numParams( + ceil( $this->getConfig()->get( 'CookieExpiration' ) / ( 3600 * 24 ) ) + )->text(), 'default' => $request->getVal( 'wpRemember' ), ); } @@ -233,8 +232,6 @@ class SpecialChangePassword extends FormSpecialPage { * @throws PasswordError When cannot set the new password because requirements not met. */ protected function attemptReset( $oldpass, $newpass, $retype ) { - global $wgPasswordAttemptThrottle; - $isSelf = ( $this->mUserName === $this->getUser()->getName() ); if ( $isSelf ) { $user = $this->getUser(); @@ -254,8 +251,9 @@ class SpecialChangePassword extends FormSpecialPage { $throttleCount = LoginForm::incLoginThrottle( $this->mUserName ); if ( $throttleCount === true ) { $lang = $this->getLanguage(); + $throttleInfo = $this->getConfig()->get( 'PasswordAttemptThrottle' ); throw new PasswordError( $this->msg( 'changepassword-throttled' ) - ->params( $lang->formatDuration( $wgPasswordAttemptThrottle['seconds'] ) ) + ->params( $lang->formatDuration( $throttleInfo['seconds'] ) ) ->text() ); } -- 2.20.1