Bug 32673: Keep the username in the input field if not existing
[lhc/web/wiklou.git] / includes / specials / SpecialConfirmemail.php
index 70bbfe3..4a10b38 100644 (file)
@@ -46,9 +46,7 @@ class EmailConfirmation extends UnlistedSpecialPage {
        function execute( $code ) {
                $this->setHeaders();
 
-               if ( wfReadOnly() ) {
-                       throw new ReadOnlyError;
-               }
+               $this->checkReadOnly();
 
                if( empty( $code ) ) {
                        if( $this->getUser()->isLoggedIn() ) {
@@ -89,9 +87,9 @@ 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 );
+                               $time = $this->getLanguage()->timeAndDate( $user->mEmailAuthenticated, true );
+                               $d = $this->getLanguage()->date( $user->mEmailAuthenticated, true );
+                               $t = $this->getLanguage()->time( $user->mEmailAuthenticated, true );
                                $out->addWikiMsg( 'emailauthenticated', $time, $d, $t );
                        }
                        if( $user->isEmailConfirmationPending() ) {
@@ -99,7 +97,7 @@ 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 .= Html::hidden( 'token', $user->getEditToken() );
                        $form .= Xml::submitButton( wfMsg( 'confirmemail_send' ) );
                        $form .= Xml::closeElement( 'form' );
                        $out->addHTML( $form );