Gossamer Forum
Home : Products : DBMan : Customization :

Fix for admin_display in Secure Lookup Mod

Quote Reply
Fix for admin_display in Secure Lookup Mod
I searched the forum and didn't find this, and the mod at JPDeni's site still has this, so here it is...

Check the Secure Lookup Mod, admin_display routine, updating an existing user:

Code:
# If we have a username, and the admin didn't press inquire, then
# we are updating a user.
($in{'username'} && !$in{'inquire'}) and do {
open (PASS, "<$auth_pw_file") or &cgierr ("unable to open: $auth_pw_file.\nReason: $!");
if ($db_use_flock) { flock(PASS, 1); }
@lines = <PASS>;
close PASS;

foreach $pass (@passwds) { # Go through each pass and see if we match..
next if ($pass =~ /^$/); # Skip blank lines.
next if ($pass =~ /^#/); # Skip Comment lines.
chomp ($pass);

#### Following line changed for secure_password_lookup mod
($userid, $pw, $view, $add, $del, $mod, $admin, $email) = split (/:/, $pass);

#### Following four lines added for secure_password_lookup mod
if (($in{'email'} eq $email) && ($in{'username'} ne $userid)) {
$message .= "email address already exists.";
last CASE;
}
}

After reading the pass file into @lines, the next foreach statement incorrectly goes through @passwds.

Change @passwds to @lines and everything works!

Sam