* (bug 4298) Include rc_id on enhanced RC singleton diff links for patrolling
[lhc/web/wiklou.git] / includes / SpecialUserlogin.php
index 416703e..719be81 100644 (file)
@@ -162,7 +162,7 @@ class LoginForm {
         */
        function addNewAccountInternal() {
                global $wgUser, $wgOut;
-               global $wgUseLatin1, $wgEnableSorbs, $wgProxyWhitelist;
+               global $wgEnableSorbs, $wgProxyWhitelist;
                global $wgMemc, $wgAccountCreationThrottle, $wgDBname;
                global $wgAuth, $wgMinimalPasswordLength;
 
@@ -343,8 +343,7 @@ class LoginForm {
         * @access private
         */
        function mailPassword() {
-               global $wgUser, $wgDeferredUpdateList, $wgOutputEncoding;
-               global $wgCookiePath, $wgCookieDomain, $wgDBname;
+               global $wgUser, $wgDBname;
 
                if ( '' == $this->mName ) {
                        $this->mainLoginForm( wfMsg( 'noname' ) );
@@ -366,7 +365,7 @@ class LoginForm {
                if( WikiError::isError( $result ) ) {
                        $this->mainLoginForm( wfMsg( 'mailerror', $result->getMessage() ) );
                } else {
-                       $this->mainLoginForm( wfMsg( 'passwordsent', $u->getName() ) );
+                       $this->mainLoginForm( wfMsg( 'passwordsent', $u->getName() ), 'success' );
                }
        }
 
@@ -376,8 +375,7 @@ class LoginForm {
         * @access private
         */
        function mailPasswordInternal( $u ) {
-               global $wgPasswordSender, $wgDBname;
-               global $wgCookiePath, $wgCookieDomain;
+               global $wgDBname, $wgCookiePath, $wgCookieDomain;
 
                if ( '' == $u->getEmail() ) {
                        return wfMsg( 'noemail', $u->getName() );
@@ -435,7 +433,7 @@ class LoginForm {
        /**
         * @access private
         */
-       function mainLoginForm( $err ) {
+       function mainLoginForm( $msg, $msgtype = 'error' ) {
                global $wgUser, $wgOut, $wgLang;
                global $wgDBname, $wgAllowRealName, $wgEnableEmail;
                global $wgAuth;
@@ -456,12 +454,12 @@ class LoginForm {
                        $template =& new UsercreateTemplate();
                        $q = 'action=submitlogin&type=signup';
                        $linkq = 'type=login';
-                       $msg = 'gotaccount';
+                       $linkmsg = 'gotaccount';
                } else {
                        $template =& new UserloginTemplate();
                        $q = 'action=submitlogin&type=login';
                        $linkq = 'type=signup';
-                       $msg = 'nologin';
+                       $linkmsg = 'nologin';
                }
 
                if ( !empty( $this->mReturnto ) ) {
@@ -471,10 +469,10 @@ class LoginForm {
                }
 
                $link = '<a href="' . htmlspecialchars ( $titleObj->getLocalUrl( $linkq ) ) . '">';
-               $link .= wfMsgHtml( $msg . 'link' );
+               $link .= wfMsgHtml( $linkmsg . 'link' );
                $link .= '</a>';
 
-               $template->set( 'link', wfMsgHtml( $msg, $link ) );
+               $template->set( 'link', wfMsgHtml( $linkmsg, $link ) );
                
                $template->set( 'name', $this->mName );
                $template->set( 'password', $this->mPassword );
@@ -484,7 +482,8 @@ class LoginForm {
                $template->set( 'domain', $this->mDomain );
 
                $template->set( 'action', $titleObj->getLocalUrl( $q ) );
-               $template->set( 'error', $err );
+               $template->set( 'message', $msg );
+               $template->set( 'messagetype', $msgtype );
                $template->set( 'create', $wgUser->isAllowedToCreateAccount() );
                $template->set( 'createemail', $wgEnableEmail && $wgUser->isLoggedIn() );
                $template->set( 'userealname', $wgAllowRealName );