#!/perl
use strict;
require "extra.pl";

# set up the main config hasharray
our %maindb;
$maindb{'dbUser1'}  = "oneusername";
$maindb{'dbPass1'} = "oneuserpass";
$maindb{'dbUser2'}  = "twousername";
$maindb{'dbPass2'} = "twouserpass";

sub verify_2 {
	my ($k, $v) = @_;
	tolog ( "verify: $k $v ...\n" );
	my $ret = 0; # bad case
	if ( exists $maindb{$k} ) {
		tolog ( "got: $k $v ...".$maindb{$k}."\n" );
		$ret++; # got one part
		$k =~ s/User/Pass/;
		tolog ( "seeking: $k $v ...\n" );
		if ( exists $maindb{$k} ) {
			tolog ( "got: $k $v ...".$maindb{$k}."\n" );
			if ($maindb{$k} eq $v) {
				$ret++;
			}
		}
	}
	return $ret;
}

sub get_user_name {
	my ($k) = @_;
	if ( exists $maindb{$k} ) {
		return $maindb{$k};
	}
	return '';
}


1;
# EOF
