ported changes to SORBS check from 1.4
authorTim Starling <tstarling@users.mediawiki.org>
Sun, 19 Jun 2005 02:17:05 +0000 (02:17 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Sun, 19 Jun 2005 02:17:05 +0000 (02:17 +0000)
includes/SpecialUserlogin.php
includes/User.php

index b1d4886..e684c44 100644 (file)
@@ -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;
index 3520a2e..93bd950 100644 (file)
@@ -320,7 +320,7 @@ class User {
                        }
 
                        # DNSBL
-                       if ( !$this->mBlockedby && $wgEnableSorbs ) {
+                       if ( !$this->mBlockedby && $wgEnableSorbs && !$this->getID() ) {
                                if ( $this->inSorbsBlacklist( $wgIP ) ) {
                                        $this->mBlockedby = wfMsg( 'sorbs' );
                                        $this->mBlockreason = wfMsg( 'sorbsreason' );