Merge "Revert "Made LCStoreDB try to use a separate DB connection""
[lhc/web/wiklou.git] / includes / specials / SpecialChangePassword.php
index ba5c7ec..867fd1b 100644 (file)
@@ -61,7 +61,7 @@ class SpecialChangePassword extends FormSpecialPage {
        /**
         * Set a message at the top of the Change Password form
         * @since 1.23
-        * @param Message $msg to parse and add to the form header
+        * @param Message $msg Message to parse and add to the form header
         */
        public function setChangeMessage( Message $msg ) {
                $this->mPreTextMessage = $msg;
@@ -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' ),
                        );
                }
@@ -230,11 +229,9 @@ class SpecialChangePassword extends FormSpecialPage {
        }
 
        /**
-        * @throws PasswordError when cannot set the new password because requirements not met.
+        * @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()
                        );
                }