$user = $this->getUser();
$request = $this->getRequest();
- if ( !$request->wasPosted() && !$user->isLoggedIn() ) {
+ if ( !$user->isLoggedIn() ) {
$this->error( 'changeemail-no-info' );
return;
* @return bool|string true or string on success, false on failure
*/
protected function attemptChange( User $user, $pass, $newaddr ) {
- global $wgAuth;
+ global $wgAuth, $wgPasswordAttemptThrottle;
if ( $newaddr != '' && !Sanitizer::validateEmail( $newaddr ) ) {
$this->error( 'invalidemailaddress' );
$throttleCount = LoginForm::incLoginThrottle( $user->getName() );
if ( $throttleCount === true ) {
- $this->error( 'login-throttled' );
+ $lang = $this->getLanguage();
+ $this->error( array( 'login-throttled', $lang->formatDuration( $wgPasswordAttemptThrottle['seconds'] ) ) );
return false;
}