diff options
author | terry%mozilla.org <> | 1999-06-12 02:39:19 +0200 |
---|---|---|
committer | terry%mozilla.org <> | 1999-06-12 02:39:19 +0200 |
commit | 61972658853675a69033e0322c7be347ed790b82 (patch) | |
tree | 87223dba8a53bd5cb59d2e33b03280bc3339514b | |
parent | b9d594e95be703544d023c237c030009e4d25270 (diff) | |
download | bugzilla-61972658853675a69033e0322c7be347ed790b82.tar.gz bugzilla-61972658853675a69033e0322c7be347ed790b82.tar.xz |
Some apache servers seem not to deliever the REMOTE_HOST environment var.
-rw-r--r-- | CGI.pl | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -221,6 +221,7 @@ sub make_options { my $last = ""; my $popup = ""; my $found = 0; + $default = "" if !defined $default; if ($src) { foreach my $item (@$src) { @@ -282,6 +283,9 @@ sub quietly_check_login() { if (defined $::COOKIE{"Bugzilla_login"} && defined $::COOKIE{"Bugzilla_logincookie"}) { ConnectToDatabase(); + if (!defined $ENV{'REMOTE_HOST'}) { + $ENV{'REMOTE_HOST'} = $ENV{'REMOTE_ADDR'}; + } SendSQL("select profiles.groupset, profiles.login_name, " . "profiles.login_name = " . SqlQuote($::COOKIE{"Bugzilla_login"}) . @@ -400,6 +404,9 @@ sub confirm_login { exit; } $::COOKIE{"Bugzilla_login"} = $enteredlogin; + if (!defined $ENV{'REMOTE_HOST'}) { + $ENV{'REMOTE_HOST'} = $ENV{'REMOTE_ADDR'}; + } SendSQL("insert into logincookies (userid,cryptpassword,hostname) values (@{[DBNameToIdAndCheck($enteredlogin)]}, @{[SqlQuote($realcryptpwd)]}, @{[SqlQuote($ENV{'REMOTE_HOST'})]})"); SendSQL("select LAST_INSERT_ID()"); my $logincookie = FetchOneColumn(); |