From 52f18d86dc410dd5a79a3f93153356e7095ab5de Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Sun, 19 Jun 2005 02:17:05 +0000 Subject: [PATCH] ported changes to SORBS check from 1.4 --- includes/SpecialUserlogin.php | 10 +++++++++- includes/User.php | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/includes/SpecialUserlogin.php b/includes/SpecialUserlogin.php index b1d4886029..e684c44279 100644 --- a/includes/SpecialUserlogin.php +++ b/includes/SpecialUserlogin.php @@ -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; diff --git a/includes/User.php b/includes/User.php index 3520a2e30b..93bd950e40 100644 --- a/includes/User.php +++ b/includes/User.php @@ -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' ); -- 2.20.1