Hi all,
I have a sub that reads a file, finds the user and checks the password. Nothing that needs to be real secure, but something that makes it a little harder to get in.
Anyway, if I login using the first user listed in the file, all works well, past that, invalid password message.....
Any ideas why this is not going past the first line of the file?
Thanks,
Jim
The password file is:
I have a sub that reads a file, finds the user and checks the password. Nothing that needs to be real secure, but something that makes it a little harder to get in.
Anyway, if I login using the first user listed in the file, all works well, past that, invalid password message.....
Any ideas why this is not going past the first line of the file?
Thanks,
Jim
Code:
sub check_password {
my($mode, $login, $password) = @_;
my($flogin, $fpass, $flevel, $fpage);
if (($login eq $UNIV_LOGIN) && ($password eq $UNIV_PASSWORD)) { return 1; }
if ($mode && $login && $password) {
open(PASSWORD, $PASSWORD_FILE);
($_) = grep(/^$login\t/, <PASSWORD>);
close(PASSWORD);
s/\n//;
($flogin, $fpass, $flevel, $fpage) = split /\t/;
if ( ($flogin eq $login) && ($fpass eq &CryptPassword($password)) ) {
return 1;
}
}
return 0;
}
The password file is:
Code:
JRC1 00SXHKDIsPEFA guest member
JRC2 00vW/ON1hNgpM guest member
JRC6 00QbzQRDCkj0s guest member
JRC7 00TocvUpWbIok guest member