Gossamer Forum
Home : Products : DBMan : Customization :

admin display with separate files

Quote Reply
admin display with separate files
ok, i've been working some more on the separate permissions and password files. i'm storing userid, password, permissions all set to 0, and email in the password file (just to keep same file layouts). i'm storing userid, userid, permissions and trailing colon : in the permission file. in admin, i want the following:
1 add a new user to the permission file IF the user already exists in the password file.
2 delete a user from the permission file only
3 modify existing permissions in permission file AND modify existing password or email in the password file
4 user list displays only the users in the permission file

1, 2 and 4 are working fine with preliminary testing.
3 has problems! i think finally it is all working except it is changing the password every time! for some reason the comparison of the password in the pw file is not being matched to $in{'password'} so it is generating a new one every time i modify anything.

i'm attaching a text file of sub admin display and hope someone can spot my problem.
Quote Reply
Re: [delicia] admin display with separate files In reply to
I would add some debugging code just to see what's happening:

Code:

if ($line =~ /^$in{'username'}:/) {
my $password = (split (/:/, $line))[1];
unless ($password eq $in{'password'}) {
$old_password = $password;
my @salt_chars = ('A' .. 'Z', 0 .. 9, 'a' .. 'z', '.', '/');
my $salt = join '', @salt_chars[rand 64, rand 64];
$password = crypt($in{'password'}, $salt);
}

..................

######
$in{'inquire'} = $in{'username'};
$found ?
($message = "User: $in{'username'} updated.
<br>Old password: $old_password
<br>New password: $in{'password'} ") :
($message = "Unable to find user: '$in{'username'}'.");
last CASE;



This will let you know whether the passwords are really different or something else is going on.


JPD
----------------------------------------------------
JPDeni's DBMan-ual
How to ask questions the smart way.
Quote Reply
Re: [JPDeni] admin display with separate files In reply to
thanks for the tip! i found the problem. i had skipped the step that read the password file.