--- loncom/auth/switchserver.pm 2020/12/18 15:23:03 1.52 +++ loncom/auth/switchserver.pm 2021/05/03 15:27:43 1.54 @@ -1,7 +1,7 @@ # The LearningOnline Network # Switch Servers Handler # -# $Id: switchserver.pm,v 1.52 2020/12/18 15:23:03 raeburn Exp $ +# $Id: switchserver.pm,v 1.54 2021/05/03 15:27:43 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -123,6 +123,10 @@ sub handler { if ($Apache::lonnet::protocol{$env{'form.otherserver'}} eq 'https') { $protocol = $Apache::lonnet::protocol{$env{'form.otherserver'}}; } + unless ($env{'form.otherserver'} eq $r->dir_config('lonHostID')) { + my $alias = &Apache::lonnet::use_proxy_alias($r,$env{'form.otherserver'}); + $switch_to = $alias if ($alias ne ''); + } } if ($env{'user.name'} eq 'public' @@ -257,7 +261,7 @@ sub handler { $otherbalcookie = $env{'request.balancercookie'}; } - my %info=('ip' => $ENV{'REMOTE_ADDR'}, + my %info=('ip' => $ip, 'domain' => $env{'user.domain'}, 'username' => $env{'user.name'}, 'home' => $env{'user.home'},