X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialConfirmemail.php;h=d771589d82428cf779267be0b3d7aa2d51a1cfcb;hb=038bde3276d1caa9804fbea170b1921cc9058546;hp=6757990afd3481e3f969dc6adde592dbf3c5cc3a;hpb=164f334e53bb3ea854bf1f2a3c1202102ccac5df;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialConfirmemail.php b/includes/specials/SpecialConfirmemail.php index 6757990afd..d771589d82 100644 --- a/includes/specials/SpecialConfirmemail.php +++ b/includes/specials/SpecialConfirmemail.php @@ -45,6 +45,8 @@ class EmailConfirmation extends UnlistedSpecialPage { $this->checkReadOnly(); $this->checkPermissions(); + $this->requireLogin( 'confirmemail_needlogin' ); + // This could also let someone check the current email address, so // require both permissions. if ( !$this->getUser()->isAllowed( 'viewmyprivateinfo' ) ) { @@ -52,22 +54,10 @@ class EmailConfirmation extends UnlistedSpecialPage { } if ( $code === null || $code === '' ) { - if ( $this->getUser()->isLoggedIn() ) { - if ( Sanitizer::validateEmail( $this->getUser()->getEmail() ) ) { - $this->showRequestForm(); - } else { - $this->getOutput()->addWikiMsg( 'confirmemail_noemail' ); - } + if ( Sanitizer::validateEmail( $this->getUser()->getEmail() ) ) { + $this->showRequestForm(); } else { - $llink = Linker::linkKnown( - SpecialPage::getTitleFor( 'Userlogin' ), - $this->msg( 'loginreqlink' )->escaped(), - array(), - array( 'returnto' => $this->getTitle()->getPrefixedText() ) - ); - $this->getOutput()->addHTML( - $this->msg( 'confirmemail_needlogin' )->rawParams( $llink )->parse() - ); + $this->getOutput()->addWikiMsg( 'confirmemail_noemail' ); } } else { $this->attemptConfirm( $code ); @@ -111,7 +101,7 @@ class EmailConfirmation extends UnlistedSpecialPage { $out->addWikiMsg( 'confirmemail_text' ); $form = Html::openElement( 'form', - array( 'method' => 'post', 'action' => $this->getTitle()->getLocalURL() ) + array( 'method' => 'post', 'action' => $this->getPageTitle()->getLocalURL() ) ) . "\n"; $form .= Html::hidden( 'token', $user->getEditToken() ) . "\n"; $form .= Xml::submitButton( $this->msg( 'confirmemail_send' )->text() ) . "\n";