Yeah I'm up late. I'm about ready to go to bed.
But first....
I started writing all of this in a separate file so I'll have it -- corrected
-- and I realized that there is one more little step before you use this new permission. We need to adjust your current .pass file. I think it's important that this little script is tested out before we continue.
At this point, you are ready to do some work with your real .pass file. You will have to go through and manually change the "member" permission through the admin display, but first you need to add another field to the password file. Save your "real" password file to the directory you've been working in.
Save the script below to the same directory, with the name
fixpass.cgi.
Note that you may need to change the first line of the script to match your path to Perl and, if your .pass file is not called "default.pass," you'll have to change the name of the file as well.
You will also need to copy sub cgierr from db.cgi into this script.
Code:
#!/usr/local/bin/perl
$db_script_path = ".";
$auth_pw_file = $db_script_path . "/default.pass";
open (PASSWD, "<$auth_pw_file") or &cgierr("unable to open password file. Reason: $!\n");
@passwds = <PASSWD>;
close PASSWD;
PASS: foreach $pass (@passwds) {
next PASS if ($pass =~ /^$/);
next PASS if ($pass =~ /^#/);
chomp ($pass);
($userid, $pw, $view, $add, $del, $mod, $admin, $email) = split (/:/, $pass);
$output .= "$userid:$pw:$view:$add:$del:$mod:0:$admin:$email\n";
}
open (PASS, ">$auth_pw_file") or &cgierr ("unable to open: $auth_pw_file.\nReason: $!");
print PASS $output;
close PASS;
print "Content-type: text/html\n\n";
print qq|<html><head><title>Password file fixed</title></head>
<body>The password file is now fixed. Log on to DBMan to test it out.</body></html>|;
1;
I haven't tested this to see if it works, but it doesn't have any syntax errors in it.
Upload the script (in ASCII mode) and set the permission to 755. Run it from your browser, using "fixpass.cgi."
After it's finished, log on to DBMan, using one of the username/password combinations that you know is in the file. Create a new user and try out all of the functions. Change one of the current users to "member" status and try out all the functions. (You may need to change a password so you'll be able to log in, but that's okay. You're not going to be using this file anyway when you're all done.)
Test everything before you go on. Test it again. Test it a third time and then once more for good measure. Try to think of anything that might be a problem.
After this, we'll be ready to use this new permission. Think of what you want to do with it.
------------------
JPD