Diff for /loncom/auth/lonshibauth.pm between versions 1.5 and 1.10

version 1.5, 2021/06/22 16:56:35 version 1.10, 2021/10/10 23:59:19
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(); }
         my $protocol = $Apache::lonnet::protocol{$lonhost};          my $protocol = $Apache::lonnet::protocol{$lonhost};
         unless ($protocol eq 'https') { $protocol = 'http'; }          unless ($protocol eq 'https') { $protocol = 'http'; }
         my $alias = &Apache::lonnet::use_proxy_alias($r,$lonhost);          my $alias = &Apache::lonnet::use_proxy_alias($r,$lonhost);
         $hostname = $alias if ($alias ne '');          if (($alias ne '') &&
               (&Apache::lonnet::alias_shibboleth($lonhost))) {
               $hostname = $alias;
           }
         my $dest = $protocol.'://'.$hostname.$target;          my $dest = $protocol.'://'.$hostname.$target;
         $r->subprocess_env;          if ($r->args ne '') {
         if ($ENV{'QUERY_STRING'} ne '') {              $dest .= (($dest=~/\?/)?'&':'?').$r->args;
             $dest .= '?'.$ENV{'QUERY_STRING'};  
         }          }
         if ($uri ne '/adm/roles/') {          unless (($uri eq '/adm/roles') || ($uri eq '/adm/logout')) {
             unless ($ENV{'QUERY_STRING'} =~ /origurl=/) {              if ($target eq '/adm/login') {
                 $dest.=(($dest=~/\?/)?'&':'?').'origurl='.$uri;                  unless ($ENV{'QUERY_STRING'} =~ /firsturl=/) {
                       $dest.=(($dest=~/\?/)?'&':'?').'firsturl='.$uri;
                   }
               } else {
                   unless ($ENV{'QUERY_STRING'} =~ /origurl=/) {
                       $dest.=(($dest=~/\?/)?'&':'?').'origurl='.$uri;
                   }
             }              }
         }          }
         $r->header_out(Location => $dest);          $r->header_out(Location => $dest);

Removed from v.1.5  
changed lines
  Added in v.1.10


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>