added enabled field so you can disable the cache thing if you need to before its...
[lhc/web/wiklou.git] / includes / specials / SpecialConfirmemail.php
index 70bbfe3..3e9ce12 100644 (file)
@@ -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 );
                }
@@ -110,7 +110,7 @@ class EmailConfirmation extends UnlistedSpecialPage {
         * Attempt to confirm the user's email address and show success or failure
         * as needed; if successful, take the user to log in
         *
-        * @param $code Confirmation code
+        * @param $code string Confirmation code
         */
        function attemptConfirm( $code ) {
                $user = User::newFromConfirmationCode( $code );
@@ -156,7 +156,7 @@ class EmailInvalidation extends UnlistedSpecialPage {
         * Attempt to invalidate the user's email address and show success or failure
         * as needed; if successful, link to main page
         *
-        * @param $code Confirmation code
+        * @param $code string Confirmation code
         */
        function attemptInvalidate( $code ) {
                $user = User::newFromConfirmationCode( $code );