--- loncom/auth/migrateuser.pm 2020/05/02 17:35:40 1.25.2.2 +++ loncom/auth/migrateuser.pm 2017/11/30 15:14:51 1.26 @@ -1,7 +1,7 @@ # The LearningOnline Network # Starts a user off based of an existing token. # -# $Id: migrateuser.pm,v 1.25.2.2 2020/05/02 17:35:40 raeburn Exp $ +# $Id: migrateuser.pm,v 1.26 2017/11/30 15:14:51 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -53,7 +53,7 @@ sub goto_login { } -sub sso_check { +sub sso_lti_check { my ($data) = @_; my %extra_env; if (ref($data) eq 'HASH') { @@ -64,6 +64,21 @@ sub sso_check { $extra_env{'request.sso.reloginserver'} = $data->{'sso.reloginserver'}; } + if ($data->{'lti.login'}) { + $extra_env{'request.lti.login'} = $data->{'lti.login'}; + } + if ($data->{'lti.passbackid'}) { + $extra_env{'request.lti.passbackid'} = $data->{'lti.passbackid'}; + } + if ($data->{'lti.passbackurl'}) { + $extra_env{'request.lti.passbackurl'} = $data->{'lti.passbackurl'}; + } + if ($data->{'lti.rosterid'}) { + $extra_env{'request.lti.rosterid'} = $data->{'lti.rosterid'}; + } + if ($data->{'lti.rosterurl'}) { + $extra_env{'request.lti.rosterurl'} = $data->{'lti.rosterurl'}; + } } return \%extra_env; } @@ -171,11 +186,6 @@ sub ip_changed { } } } - unless ($hosthere) { - if (($dataref->{'balancer'}) && ($dataref->{'balcookie'})) { - &Apache::lonnet::delbalcookie($dataref->{'balcookie'},$dataref->{'balancer'}); - } - } } if ($dataref->{'sso.login'}) { $url .= '/adm/roles'; @@ -248,16 +258,9 @@ sub handler { } if ($home =~ /(con_lost|no_such_host)/) { return &goto_login($r,$udom); } - 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'} }; - } - } + my $extra_env = &sso_lti_check(\%data); - my (%form,$cid); + my %form; if ($data{'symb'} ne '') { $form{'symb'} = $data{'symb'}; } @@ -267,13 +270,8 @@ sub handler { if ($data{'noloadbalance'} ne '') { $form{'noloadbalance'} = $data{'noloadbalance'}; } - 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 { + + if (!$data{'role'}) { my $handle = &Apache::lonnet::check_for_valid_session($r); if ($handle) { &Apache::lonnet::transfer_profile_to_env($r->dir_config('lonIDsDir'), @@ -303,7 +301,7 @@ sub handler { $next_url .= '&orgurl='.&escape($data{'origurl'}); } &Apache::lonauth::success($r,$data{'username'},$data{'domain'},$home, - $next_url,$extra_env,\%form,$cid); + $next_url,$extra_env,\%form); return OK; }