View Single Post
 
Old Jun 10, 2001, 07:48 PM
DocJohn's Avatar
DocJohn DocJohn is offline
Founder & Your Host
Community Support Team
Chat Leader
 
Member Since: May 2001
Location: Greater Boston, MA
Posts: 13,794
Script_link is defined only when it receives an "ok" from the authorization module once at the beginning of oj.cgi. This is not a mistake.

Apparently there's a problem with passing this to the script after a new user is created (because the existing login information wasn't saved). This is a bug which is best fixed by replacing the entire "Main" section at the beginning of oj.cgi:

# ----------------------------------------------
# Main
# ----------------------------------------------

sub main {

$| ; # Flush Output Right Away

$userid = $in{'username'}; $pw = $in{'password'};
$in{'userid'} = $userid; $in{'pw'} = $pw;

&auth_cleanup; # Remove old session files.
($status, $uid) = &auth_check_password; # Authenticate User, get permissions and userid.
$script_link = "$db_script_url?db=default&uid=$db_uid";

if ($status eq "ok") {
if (length($userid) < 3) { ($userid, $trashy) = split(/\./,$uid); }
if ($userid) { $script_link = "$script_link&userid=$userid"; }
if ($uid eq "default") { $db_userid = $uid; }
else { ($db_userid) = $db_uid =~ /([A-Za-z0-9] )\.\d /; }

if ($in{'edit'}) {
$edit = $in{'edit'};
&verify;

} elsif ($in{'logoff'}) { &auth_logging('logged off') if ($auth_logging);
$auth_logoff ? (print "Location: $auth_logoff\n\n") : (print "Location: $db_script_url\n\n");

} elsif ($in{'addentry'} =~ /Add/) {

&get_variables;
if ($blurbonly eq 0) { &new_file; } #if there is not just a blurb, write a new news file
&main_page;
&return_html("entry added"); #show user added entry

} elsif ($in{'addentry'} =~ /Preview/) {

&get_variables;
&preview;

} elsif ($in{'auth'} eq "adduser") {
&print_new_auth;

} elsif ($in{'login'}) {
&addform;

} else {
&error($status);

} # End Edit

} elsif ($in{'auth'} eq "newpass") {
if ($in{'password'} eq $in{'verify'}) {
&signup;
} else { &print_new_auth("Sorry... Your passwords didn't match. Please try again."); }

} elsif ($status eq "no login") {
&print_auth($status);

} else {
&error($status);
}

exit(0);

} # End Main
__________________
Don't throw away your shot.
Thanks for this!
healingme4me