[ic] UserDB Login Inactive Flag.

Andrew Metcalfe interchange-users@icdevgroup.org
Fri Aug 30 13:17:01 2002


> -----Original Message-----
> From: Jonathan Clark
> > Out of curiosity, where would I find the Login code?
>
> lib/Vend/UserDB.pm
>
> search for 'sub login'

You KNEW I was going to come back with more questions, didn't you?  ;)

First I added INACTIVE, and INACTIVE_FLAG to $self.

	my $self = {
			USERNAME  	=> $options{username}	||
						   $Vend::username		||
						   $CGI::values{mv_username} ||
						   '',
			OLDPASS  	=> $options{oldpass}	|| $CGI::values{mv_password_old} || '',
			PASSWORD  	=> $options{password}	|| $CGI::values{mv_password} || '',
			VERIFY  	=> $options{verify}		|| $CGI::values{mv_verify}	 || '',
			NICKNAME   	=> $options{nickname}	|| '',
			PROFILE   	=> $options{profile}	|| '',
			LAST   		=> '',
			USERMINLEN	=> $options{userminlen}	|| 2,
			PASSMINLEN	=> $options{passminlen}	|| 4,
+			INACTIVE	=> $options{inactive} || 0,
+			INACTIVE_FLAG	=> 1
.deletia.
			};

then in sub Login I added

	# Fail if inactive flag set
	my $inactive_error = ::errmsg("User is disabled.");
	if ($self->{INACTIVE} eq $self->{INACTIVE_FLAG}) {
			logError("Inactive user attempted login with user name '%s'");
			die $inactive_error, "\n";
	}

Was I correct in asuming that $options refers to the userDB db fields?  I'm
not getting any errors, but it inactive users are still logging in, I'm
seeing neither logError or $inactive_error.

_Am