documentation
[lhc/web/wiklou.git] / includes / SpecialUserlogin.php
index 5bfa706..f7b6680 100644 (file)
@@ -131,7 +131,7 @@ class LoginForm {
         * @access private
         */
        function addNewAccount() {
-               global $wgUser, $wgOut;
+               global $wgUser, $wgOut, $wgEmailAuthentication;
 
                $u = $this->addNewAccountInternal();
 
@@ -143,7 +143,7 @@ class LoginForm {
                $wgUser->setCookies();
 
                $wgUser->saveSettings();
-               if( $wgUser->isValidEmailAddr( $wgUser->getEmail() ) ) {
+               if( $wgEmailAuthentication && $wgUser->isValidEmailAddr( $wgUser->getEmail() ) ) {
                        $wgUser->sendConfirmationMail();
                }
 
@@ -159,7 +159,7 @@ class LoginForm {
         */
        function addNewAccountInternal() {
                global $wgUser, $wgOut;
-               global $wgMaxNameChars;
+               global $wgMaxNameChars, $wgUseLatin1, $wgEnableSorbs, $wgProxyWhitelist;
                global $wgMemc, $wgAccountCreationThrottle, $wgDBname, $wgIP;
                global $wgMinimalPasswordLength;
                global $wgAuth;
@@ -190,6 +190,14 @@ class LoginForm {
                        return false;
                }
 
+               if ( $wgEnableSorbs && !in_array( $wgIP, $wgProxyWhitelist ) && 
+                 $wgUser->inSorbsBlacklist( $wgIP ) ) 
+               {
+                       $this->mainLoginForm( wfMsg( 'sorbs_create_account_reason' ) );
+                       return;
+               }
+
+
                if ( 0 != strcmp( $this->mPassword, $this->mRetype ) ) {
                        $this->mainLoginForm( wfMsg( 'badretype' ) );
                        return false;
@@ -239,6 +247,10 @@ class LoginForm {
                        return false;
                }
 
+               # Update user count
+               $ssUpdate = new SiteStatsUpdate( 0, 0, 0, 0, 1 );
+               $ssUpdate->doUpdate();
+
                return $this->initUser( $u );
        }
        
@@ -387,9 +399,9 @@ class LoginForm {
                $ip = $wgIP;
                if ( '' == $ip ) { $ip = '(Unknown)'; }
 
-               $m = wfMsg( 'passwordremindermailbody', $ip, $u->getName(), wfUrlencode($u->getName()), $np );
-               $result = $u->sendMail( wfMsg( 'passwordremindermailsubject' ), $m );
-               
+               $m = wfMsg( 'passwordremindertext', $ip, $u->getName(), $np );
+
+               $result = $u->sendMail( wfMsg( 'passwordremindertitle' ), $m );
                return $result;
        }