diff options
Diffstat (limited to 'includes/specials/SpecialConfirmemail.php')
-rw-r--r-- | includes/specials/SpecialConfirmemail.php | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/includes/specials/SpecialConfirmemail.php b/includes/specials/SpecialConfirmemail.php index 70bbfe39..912f7733 100644 --- a/includes/specials/SpecialConfirmemail.php +++ b/includes/specials/SpecialConfirmemail.php @@ -46,11 +46,9 @@ class EmailConfirmation extends UnlistedSpecialPage { function execute( $code ) { $this->setHeaders(); - if ( wfReadOnly() ) { - throw new ReadOnlyError; - } + $this->checkReadOnly(); - if( empty( $code ) ) { + if( $code === null || $code === '' ) { if( $this->getUser()->isLoggedIn() ) { if( Sanitizer::validateEmail( $this->getUser()->getEmail() ) ) { $this->showRequestForm(); @@ -60,11 +58,11 @@ class EmailConfirmation extends UnlistedSpecialPage { } else { $llink = Linker::linkKnown( SpecialPage::getTitleFor( 'Userlogin' ), - wfMsgHtml( 'loginreqlink' ), + $this->msg( 'loginreqlink' )->escaped(), array(), array( 'returnto' => $this->getTitle()->getPrefixedText() ) ); - $this->getOutput()->addHTML( wfMessage( 'confirmemail_needlogin' )->rawParams( $llink )->parse() ); + $this->getOutput()->addHTML( $this->msg( 'confirmemail_needlogin' )->rawParams( $llink )->parse() ); } } else { $this->attemptConfirm( $code ); @@ -89,9 +87,11 @@ class EmailConfirmation extends UnlistedSpecialPage { // date and time are separate parameters to facilitate localisation. // $time is kept for backward compat reasons. // 'emailauthenticated' is also used in SpecialPreferences.php - $time = $this->getLang()->timeAndDate( $user->mEmailAuthenticated, true ); - $d = $this->getLang()->date( $user->mEmailAuthenticated, true ); - $t = $this->getLang()->time( $user->mEmailAuthenticated, true ); + $lang = $this->getLanguage(); + $emailAuthenticated = $user->getEmailAuthenticationTimestamp(); + $time = $lang->userTimeAndDate( $emailAuthenticated, $user ); + $d = $lang->userDate( $emailAuthenticated, $user ); + $t = $lang->userTime( $emailAuthenticated, $user ); $out->addWikiMsg( 'emailauthenticated', $time, $d, $t ); } if( $user->isEmailConfirmationPending() ) { @@ -99,8 +99,8 @@ class EmailConfirmation extends UnlistedSpecialPage { } $out->addWikiMsg( 'confirmemail_text' ); $form = Xml::openElement( 'form', array( 'method' => 'post', 'action' => $this->getTitle()->getLocalUrl() ) ); - $form .= Html::hidden( 'token', $user->editToken() ); - $form .= Xml::submitButton( wfMsg( 'confirmemail_send' ) ); + $form .= Html::hidden( 'token', $user->getEditToken() ); + $form .= Xml::submitButton( $this->msg( 'confirmemail_send' )->text() ); $form .= Xml::closeElement( 'form' ); $out->addHTML( $form ); } |