ported changes to SORBS check from 1.4

This commit is contained in:
Tim Starling 2005-06-19 02:17:05 +00:00
parent 78c798bd96
commit 52f18d86dc
2 changed files with 10 additions and 2 deletions

View 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;

View 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' );