[interchange] removed AdminUser configuration directive

Stefan Hornburg interchange-cvs at icdevgroup.org
Thu Mar 11 18:23:14 UTC 2010


commit 40a5f3e73619d7294e84779079cce89563f887b2
Author: Stefan Hornburg (Racke) <racke at linuxia.de>
Date:   Thu Mar 11 19:22:47 2010 +0100

    removed AdminUser configuration directive

 UPGRADE            |    1 +
 lib/Vend/Config.pm |    1 -
 lib/Vend/UserDB.pm |   31 -------------------------------
 lib/Vend/Util.pm   |   11 +----------
 4 files changed, 2 insertions(+), 42 deletions(-)
---
diff --git a/UPGRADE b/UPGRADE
index eaadd2e..daf564d 100644
--- a/UPGRADE
+++ b/UPGRADE
@@ -86,6 +86,7 @@ KNOWN ISSUES UPGRADING FROM 5.6
 
 Perl 5.8.5 or newer is now required.
 
+AdminUser configuration directive has been removed.
 
 PROBLEM WORKAROUND FOR POSTGRESQL 8.3 USERS
 
diff --git a/lib/Vend/Config.pm b/lib/Vend/Config.pm
index ffda977..8df529a 100644
--- a/lib/Vend/Config.pm
+++ b/lib/Vend/Config.pm
@@ -498,7 +498,6 @@ sub global_directives {
 	['UserTag',			 'tag',				 ''],
 	['CodeDef',			 'mapped_code',		 ''],
 	['HotDBI',			 'boolean',			 ''],
-	['AdminUser',		  undef,			 ''],
 	['HammerLock',		 'time',     	 30],
 	['DataTrace',		 'integer',     	 0],
 	['ShowTimes',		 'yesno',	     	 0],
diff --git a/lib/Vend/UserDB.pm b/lib/Vend/UserDB.pm
index a0a9953..26767d8 100644
--- a/lib/Vend/UserDB.pm
+++ b/lib/Vend/UserDB.pm
@@ -1381,37 +1381,6 @@ sub login {
 			die $stock_error, "\n";
 		}
 
-		# Allow entry to global AdminUser without checking access database
-		ADMINUSER: {
-			if ($Global::AdminUser) {
-				my $pwinfo = $Global::AdminUser;
-				$pwinfo =~ s/^\s+//; $pwinfo =~ s/\s+$//;
-				my ($adminuser, $adminpass) = split /[\s:]+/, $pwinfo;
-				last ADMINUSER unless $adminuser eq $self->{USERNAME};
-				unless ($adminpass) {
-					$self->log_either(errmsg("Refusing to use AdminUser variable with user '%s' and empty password", $adminuser));
-					last ADMINUSER;
-				}
-				my $test;
-				if($Global::Variable->{MV_NO_CRYPT}) {
-					$test = $self->{PASSWORD};
-				}
-				else {
-					my $sub = $self->{ENCSUB};
-					$self->{ENCSUB} = $enc_subs{default};
-					$test = $self->do_crypt($self->{PASSWORD}, $adminpass);
-					$self->{ENCSUB} = $sub;
-				}
-				if ($test eq $adminpass) {
-					$user_data = {};
-					$Vend::admin = $Vend::superuser = 1;
-					$self->log_either( errmsg("Successful superuser login by AdminUser '%s'", $adminuser));
-				} else {
-					$self->log_either(errmsg("Password given with user name '%s' didn't match AdminUser password", $adminuser));
-				}
-			}
-		}
-
 		my $udb = $self->{DB};
 		my $foreign = $self->{OPTIONS}{indirect_login};
 
diff --git a/lib/Vend/Util.pm b/lib/Vend/Util.pm
index 0cf538c..d958e50 100644
--- a/lib/Vend/Util.pm
+++ b/lib/Vend/Util.pm
@@ -1426,16 +1426,7 @@ sub check_authorization {
 						);
 	my $cmp_pw;
 	my $use_crypt = 1;
-	if(!defined $Vend::Cfg) {
-		$pwinfo = $Global::AdminUser;
-		$pwinfo =~ s/^\s+//;
-		$pwinfo =~ s/\s+$//;
-		my (%compare) = split /[\s:]+/, $pwinfo;
-		return undef unless $compare{$user};
-		$cmp_pw = $compare{$user};
-		undef $use_crypt if $Global::Variable->{MV_NO_CRYPT};
-	}
-	elsif(	$user eq $Vend::Cfg->{RemoteUser}	and
+	if(	$user eq $Vend::Cfg->{RemoteUser}	and
 			$Vend::Cfg->{Password}					)
 	{
 		$cmp_pw = $Vend::Cfg->{Password};



More information about the interchange-cvs mailing list