version 1.5, 2021/06/22 16:56:35
|
version 1.6, 2021/09/21 22:54:26
|
Line 74 use LONCAPA qw(:DEFAULT);
|
Line 74 use LONCAPA qw(:DEFAULT);
|
sub handler { |
sub handler { |
my $r = shift; |
my $r = shift; |
my $target = '/adm/sso'; |
my $target = '/adm/sso'; |
|
if (&Apache::lonnet::get_saml_landing()) { |
|
$target = '/adm/login'; |
|
} |
my $uri = $r->uri; |
my $uri = $r->uri; |
if (($r->user eq '') && ($uri ne $target)) { |
if (($r->user eq '') && ($uri ne $target) && ($uri ne '/adm/sso')) { |
my $lonhost = $Apache::lonnet::perlvar{'lonHostID'}; |
my $lonhost = $Apache::lonnet::perlvar{'lonHostID'}; |
my $hostname = &Apache::lonnet::hostname($lonhost); |
my $hostname = &Apache::lonnet::hostname($lonhost); |
if (!$hostname) { $hostname = $r->hostname(); } |
if (!$hostname) { $hostname = $r->hostname(); } |
Line 88 sub handler {
|
Line 91 sub handler {
|
if ($ENV{'QUERY_STRING'} ne '') { |
if ($ENV{'QUERY_STRING'} ne '') { |
$dest .= '?'.$ENV{'QUERY_STRING'}; |
$dest .= '?'.$ENV{'QUERY_STRING'}; |
} |
} |
if ($uri ne '/adm/roles/') { |
unless (($uri eq '/adm/roles') || ($ENV{'QUERY_STRING'} =~ /origurl=/)) { |
unless ($ENV{'QUERY_STRING'} =~ /origurl=/) { |
$dest.=(($dest=~/\?/)?'&':'?').'origurl='.$uri; |
$dest.=(($dest=~/\?/)?'&':'?').'origurl='.$uri; |
|
} |
|
} |
} |
$r->header_out(Location => $dest); |
$r->header_out(Location => $dest); |
return REDIRECT; |
return REDIRECT; |