i would like the passwords in user tables to be encrypted. i edited admin.pm to add following to sub user_update before the add/update user code:
## 8/12/2010
my @salt_chars = ('A' .. 'Z', 0 .. 9, 'a' .. 'z', '.', '/');
my $salt = join '', @salt_chars[rand 64, rand 64];
$hsh_user->{Password} = crypt($hsh_user->{Password}, $salt);
##then in home.pm i added the following code in sub login before $self->{user} = $self->_authenticate();:
my @salt_chars = ('A' .. 'Z', 0 .. 9, 'a' .. 'z', '.', '/');
my $salt = join '', @salt_chars[rand 64, rand 64];
$self->{cgi}->{Password} = crypt($self->{cgi}->{Password}, $salt);
###############the password field has obviously been changed in admin, but i keep getting invalid user or password when trying to login. what am i doing wrong?
Code:
## 8/12/2010
my @salt_chars = ('A' .. 'Z', 0 .. 9, 'a' .. 'z', '.', '/');
my $salt = join '', @salt_chars[rand 64, rand 64];
$hsh_user->{Password} = crypt($hsh_user->{Password}, $salt);
##
Code:
# 8/12/2010 my @salt_chars = ('A' .. 'Z', 0 .. 9, 'a' .. 'z', '.', '/');
my $salt = join '', @salt_chars[rand 64, rand 64];
$self->{cgi}->{Password} = crypt($self->{cgi}->{Password}, $salt);
###############