Diff for /loncom/auth/migrateuser.pm between versions 1.25 and 1.25.2.4

version 1.25, 2016/12/05 00:51:43 version 1.25.2.4, 2021/01/04 03:52:32
Line 171  sub ip_changed { Line 171  sub ip_changed {
                     }                      }
                 }                  }
             }              }
               unless ($hosthere) {
                   if (($dataref->{'balancer'}) && ($dataref->{'balcookie'})) {
                       &Apache::lonnet::delbalcookie($dataref->{'balcookie'},$dataref->{'balancer'});
                   }
               }
         }          }
         if ($dataref->{'sso.login'}) {          if ($dataref->{'sso.login'}) {
             $url .= '/adm/roles';              $url .= '/adm/roles';
Line 229  sub handler { Line 234  sub handler {
     if (!defined($data{'username'}) || !defined($data{'domain'})) {      if (!defined($data{'username'}) || !defined($data{'domain'})) {
         return &goto_login($r);          return &goto_login($r);
     }      }
     if ($data{'ip'} ne $ENV{'REMOTE_ADDR'}) {      my $ip = &Apache::lonnet::get_requestor_ip(); 
       if ($data{'ip'} ne $ip) {
         &Apache::lonnet::logthis('IP change when session migration requested -- was: '.          &Apache::lonnet::logthis('IP change when session migration requested -- was: '.
                  $data{'ip'}.'; now: '.$ENV{'REMOTE_ADDR'}.' for '.$data{'username'}.':'.$data{'domain'});                   $data{'ip'}.'; now: '.$ip.' for '.$data{'username'}.':'.$data{'domain'});
  return &ip_changed($r,$data{'domain'},$data{'server'},\%data);   return &ip_changed($r,$data{'domain'},$data{'server'},\%data);
     }      }
   
Line 244  sub handler { Line 250  sub handler {
     if ($home =~ /(con_lost|no_such_host)/) { return &goto_login($r,$udom); }      if ($home =~ /(con_lost|no_such_host)/) { return &goto_login($r,$udom); }
   
     my $extra_env = &sso_check(\%data);      my $extra_env = &sso_check(\%data);
       if (($data{'balancer'}) && ($data{'server'}) && ($data{'balcookie'})) {
           if (ref($extra_env) eq 'HASH') {
               $extra_env->{'request.balancercookie'} = $data{'server'}.':'.$data{'balcookie'};
           } else {
               $extra_env = { 'request.balancercookie' => $data{'server'}.':'.$data{'balcookie'} };
           }
       } elsif (($data{'server'}) && ($data{'otherbalcookie'})) {
           my ($balancer,$balcookie) = split(/:/,$data{'otherbalcookie'});
           if (defined(&Apache::lonnet::hostname($balancer)) && $balcookie =~ /^[a-f0-9]{32}$/) {
               my $baldom = &Apache::lonnet::host_domain($balancer);
               if (&Apache::lonnet::shared_institution($baldom)) {
                   my $cookieid = join('_',$udom,$data{'username'},$balcookie);
                   &Apache::lonnet::updatebalcookie($cookieid,$balancer,$data{'server'});
                   if (ref($extra_env) eq 'HASH') {
                       $extra_env->{'request.balancercookie'} = $data{'otherbalcookie'};
                   } else {
                       $extra_env = { 'request.balancercookie' => $data{'otherbalcookie'} };
                   }
               }
           }
       }
   
     my %form;      my (%form,$cid);
     if ($data{'symb'} ne '') {      if ($data{'symb'} ne '') {
         $form{'symb'} = $data{'symb'};          $form{'symb'} = $data{'symb'};
     }      }
Line 255  sub handler { Line 282  sub handler {
     if ($data{'noloadbalance'} ne '') {      if ($data{'noloadbalance'} ne '') {
         $form{'noloadbalance'} = $data{'noloadbalance'};          $form{'noloadbalance'} = $data{'noloadbalance'};
     }      }
       if ($data{'role'}) {
     if (!$data{'role'}) {          if ($data{'role'} =~ m{\./($match_domain)/($match_courseid)(?:/\w+|$)}) {
               unless (&Apache::lonnet::homeserver($2,$1) eq 'no_host') {
                   $cid = $1.'_'.$2;
               }
           }
       } else {
  my $handle = &Apache::lonnet::check_for_valid_session($r);   my $handle = &Apache::lonnet::check_for_valid_session($r);
  if ($handle) {   if ($handle) {
     &Apache::lonnet::transfer_profile_to_env($r->dir_config('lonIDsDir'),      &Apache::lonnet::transfer_profile_to_env($r->dir_config('lonIDsDir'),
Line 286  sub handler { Line 318  sub handler {
         $next_url .= '&orgurl='.&escape($data{'origurl'});          $next_url .= '&orgurl='.&escape($data{'origurl'});
     }      }
     &Apache::lonauth::success($r,$data{'username'},$data{'domain'},$home,      &Apache::lonauth::success($r,$data{'username'},$data{'domain'},$home,
       $next_url,$extra_env,\%form);        $next_url,$extra_env,\%form,$cid);
     return OK;      return OK;
 }  }
   

Removed from v.1.25  
changed lines
  Added in v.1.25.2.4


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