summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorterry%mozilla.org <>1999-06-12 02:39:19 +0200
committerterry%mozilla.org <>1999-06-12 02:39:19 +0200
commit61972658853675a69033e0322c7be347ed790b82 (patch)
tree87223dba8a53bd5cb59d2e33b03280bc3339514b
parentb9d594e95be703544d023c237c030009e4d25270 (diff)
downloadbugzilla-61972658853675a69033e0322c7be347ed790b82.tar.gz
bugzilla-61972658853675a69033e0322c7be347ed790b82.tar.xz
Some apache servers seem not to deliever the REMOTE_HOST environment var.
-rw-r--r--CGI.pl7
1 files changed, 7 insertions, 0 deletions
diff --git a/CGI.pl b/CGI.pl
index 1b122aa73..20e813c98 100644
--- a/CGI.pl
+++ b/CGI.pl
@@ -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();