From: Kunal Mehta Date: Sun, 3 Aug 2014 21:32:34 +0000 (-0700) Subject: SpecialChangePassword: Use Config instead of globals X-Git-Tag: 1.31.0-rc.0~14613^2 X-Git-Url: http://git.cyclocoop.org/data/Luca_Pacioli_%28Gemaelde%29.jpeg?a=commitdiff_plain;h=c0ca0b259015538daba509924a0c7b82e6578566;p=lhc%2Fweb%2Fwiklou.git SpecialChangePassword: Use Config instead of globals Change-Id: Iabd07d226ea6da340dc7fc52a2370c287b769bbc --- 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() ); }