X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialChangeCredentials.php;h=970a2e29f2a80faa9f0db5abd63a7a44e683f77e;hb=f29c93a23bc6ca74a42aad576471e52882711779;hp=f22d5f3c33c6ab71459cc64930f7a6dd7219d89b;hpb=2c72e849d223012864627e744df65d865e738fa1;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialChangeCredentials.php b/includes/specials/SpecialChangeCredentials.php index f22d5f3c33..970a2e29f2 100644 --- a/includes/specials/SpecialChangeCredentials.php +++ b/includes/specials/SpecialChangeCredentials.php @@ -87,6 +87,8 @@ class SpecialChangeCredentials extends AuthManagerSpecialPage { return; } + $this->getOutput()->addBacklinkSubtitle( $this->getPageTitle() ); + $status = $this->trySubmit(); if ( $status === false || !$status->isOK() ) { @@ -124,7 +126,27 @@ class SpecialChangeCredentials extends AuthManagerSpecialPage { if ( !static::$loadUserData ) { return []; } else { - return parent::getAuthFormDescriptor( $requests, $action ); + $descriptor = parent::getAuthFormDescriptor( $requests, $action ); + + $any = false; + foreach ( $descriptor as &$field ) { + if ( $field['type'] === 'password' && $field['name'] !== 'retype' ) { + $any = true; + if ( isset( $field['cssclass'] ) ) { + $field['cssclass'] .= ' mw-changecredentials-validate-password'; + } else { + $field['cssclass'] = 'mw-changecredentials-validate-password'; + } + } + } + + if ( $any ) { + $this->getOutput()->addModules( [ + 'mediawiki.special.changecredentials.js' + ] ); + } + + return $descriptor; } } @@ -236,7 +258,7 @@ class SpecialChangeCredentials extends AuthManagerSpecialPage { } $title = Title::newFromText( $returnTo ); - return $title->getFullURL( $returnToQuery ); + return $title->getFullUrlForRedirect( $returnToQuery ); } protected function getRequestBlacklist() {