JPDeni had written the following code to allow me to search for accounts which had not yet added a record to the database.
Is there a way to print out both the UserID and Email address of the account?
Here is the code:
sub html_verify_accounts {
# --------------------------------------------------------
&html_print_headers;
$page_title = "Accounts Without Records";
&html_page_top;
open (DB, "<$db_file_name") or &cgierr("unable to open database: $db_file_name.\nReason: $!");
@lines = <DB>;
close DB;
foreach $line (@lines) {
if ($line =~ /^#/) { next; }
if ($line =~ /^\s*$/) { next; }
chomp ($line);
@values = &split_decode($line);
$user{$values[$auth_user_field]} = 1;
}
open (PASSWD, "<$auth_pw_file") or &cgierr("unable to open password file. Reason: $!\n");
@passwds = <PASSWD>;
close PASSWD;
foreach $pass (@passwds) {
@data = split ":",$pass;
unless ($user{$data[0]}) {
push (@list,$data[0]);
}
}
unless ($list[0]) {
print "All users have records in the database";
}
else {
print "The following users do not have records in the database:<BR>";
foreach $user (@list) {
print "$user<BR>";
}
}
&html_footer;
&html_page_bottom;
}
Thanks !
----------------
donm
Is there a way to print out both the UserID and Email address of the account?
Here is the code:
sub html_verify_accounts {
# --------------------------------------------------------
&html_print_headers;
$page_title = "Accounts Without Records";
&html_page_top;
open (DB, "<$db_file_name") or &cgierr("unable to open database: $db_file_name.\nReason: $!");
@lines = <DB>;
close DB;
foreach $line (@lines) {
if ($line =~ /^#/) { next; }
if ($line =~ /^\s*$/) { next; }
chomp ($line);
@values = &split_decode($line);
$user{$values[$auth_user_field]} = 1;
}
open (PASSWD, "<$auth_pw_file") or &cgierr("unable to open password file. Reason: $!\n");
@passwds = <PASSWD>;
close PASSWD;
foreach $pass (@passwds) {
@data = split ":",$pass;
unless ($user{$data[0]}) {
push (@list,$data[0]);
}
}
unless ($list[0]) {
print "All users have records in the database";
}
else {
print "The following users do not have records in the database:<BR>";
foreach $user (@list) {
print "$user<BR>";
}
}
&html_footer;
&html_page_bottom;
}
Thanks !
----------------
donm