version 1.64, 2022/07/02 19:55:15
|
version 1.68, 2024/02/09 20:08:17
|
Line 42 use CGI::Cookie;
|
Line 42 use CGI::Cookie;
|
|
|
sub goto_login { |
sub goto_login { |
my ($r,$domain,$data) = @_; |
my ($r,$domain,$data) = @_; |
|
my $write_to_opener; |
|
if (ref($data) eq 'HASH') { |
|
$write_to_opener = $data->{'lcssowin'}; |
|
} |
if ((ref($data) eq 'HASH') && ($data->{'lti.login'})) { |
if ((ref($data) eq 'HASH') && ($data->{'lti.login'})) { |
&Apache::ltiauth::invalid_request($r,'22'); |
&Apache::ltiauth::invalid_request($r,'22'); |
} else { |
} else { |
Line 52 sub goto_login {
|
Line 56 sub goto_login {
|
$url .= '?domain='.$domain; |
$url .= '?domain='.$domain; |
} |
} |
$r->print(&Apache::loncommon::start_page('Going to login',undef, |
$r->print(&Apache::loncommon::start_page('Going to login',undef, |
{'redirect' => [0,$url],}). |
{'redirect' => [0,$url,'',$write_to_opener],}). |
'<h1>'.&mt('One moment please...').'</h1>'. |
'<h1>'.&mt('One moment please...').'</h1>'. |
'<p>'.&mt('Transferring to login page.').'</p>'. |
'<p>'.&mt('Transferring to login page.').'</p>'. |
&Apache::loncommon::end_page()); |
&Apache::loncommon::end_page()); |
Line 285 sub ip_changed {
|
Line 289 sub ip_changed {
|
'username' => $dataref->{'username'}, |
'username' => $dataref->{'username'}, |
'sessionserver' => $lonhost, |
'sessionserver' => $lonhost, |
); |
); |
my @names = ('origurl','symb','role','linkprotuser','linkprotexit','linkprot','linkkey'); |
my @names = ('origurl','symb','role','linkprotuser','linkprotexit','linkprot','linkkey','linkprotpbid','linkprotpburl'); |
foreach my $name (@names) { |
foreach my $name (@names) { |
if ($dataref->{$name} ne '') { |
if ($dataref->{$name} ne '') { |
$info{$name} = $dataref->{$name}; |
$info{$name} = $dataref->{$name}; |
} |
} |
} |
} |
|
if ($info{'origurl'} eq '/adm/email') { |
|
if (($dataref->{'display'}) && ($dataref->{'mailrecip'})) { |
|
if (&unescape($dataref->{'mailrecip'}) eq $dataref->{'username'}.':'.$dataref->{'domain'}) { |
|
$info{'display'} = $dataref->{'display'}; |
|
$info{'mailrecip'} = $dataref->{'mailrecip'}; |
|
} |
|
} |
|
} |
my $iptoken = &Apache::lonnet::tmpput(\%info,$switchto,'link'); |
my $iptoken = &Apache::lonnet::tmpput(\%info,$switchto,'link'); |
unless ($iptoken eq 'conlost') { |
unless ($iptoken eq 'conlost') { |
$url .= (($url =~ /\?/) ? '&' : '?') . 'iptoken='.$iptoken; |
$url .= (($url =~ /\?/) ? '&' : '?') . 'iptoken='.$iptoken; |
} |
} |
$r->print(&Apache::loncommon::start_page($title,undef, |
$r->print(&Apache::loncommon::start_page($title,undef, |
{'redirect' => |
{'redirect' => |
[2,$url],}). |
[2,$url,'',$dataref->{'lcssowin'}],}). |
'<h1>'.&mt('One moment please...').'</h1>'. |
'<h1>'.&mt('One moment please...').'</h1>'. |
'<p class="LC_warning">'.$message.'</p>'. |
'<p class="LC_warning">'.$message.'</p>'. |
&Apache::loncommon::end_page()); |
&Apache::loncommon::end_page()); |
Line 336 sub logout {
|
Line 348 sub logout {
|
$r->headers_out->add('Set-cookie' => $c); |
$r->headers_out->add('Set-cookie' => $c); |
} |
} |
my $lonhost = $r->dir_config('lonHostID'); |
my $lonhost = $r->dir_config('lonHostID'); |
my ($url,$token,$delay,%info,%user_info); |
my ($url,$token,$delay,$write_to_opener,%info,%user_info); |
if (ref($data) eq 'HASH') { |
if (ref($data) eq 'HASH') { |
%user_info=('ip' => $ip, |
%user_info=('ip' => $ip, |
'domain' => $data->{'domain'}, |
'domain' => $data->{'domain'}, |
Line 346 sub logout {
|
Line 358 sub logout {
|
'origurl' => $data->{'origurl'}, |
'origurl' => $data->{'origurl'}, |
'symb' => $data->{'symb'}, |
'symb' => $data->{'symb'}, |
'server' => $lonhost); |
'server' => $lonhost); |
|
$write_to_opener = $data->{'lcssowin'}; |
} |
} |
$delay = 0.1; |
$delay = 0.1; |
if (ref($linkprot_info) eq 'HASH') { |
if (ref($linkprot_info) eq 'HASH') { |
Line 379 sub logout {
|
Line 392 sub logout {
|
$r->send_http_header; |
$r->send_http_header; |
$r->print( |
$r->print( |
&Apache::loncommon::start_page('Updating Session ...',undef, |
&Apache::loncommon::start_page('Updating Session ...',undef, |
{'redirect' => [$delay,$url], |
{'redirect' => [$delay,$url,'',$write_to_opener], |
'only_body' => 1,}). |
'only_body' => 1,}). |
&Apache::loncommon::end_page()); |
&Apache::loncommon::end_page()); |
if ($env{'request.balancercookie'}) { |
if ($env{'request.balancercookie'}) { |
Line 739 sub handler {
|
Line 752 sub handler {
|
if ($handle) { |
if ($handle) { |
&Apache::lonnet::transfer_profile_to_env($r->dir_config('lonIDsDir'), |
&Apache::lonnet::transfer_profile_to_env($r->dir_config('lonIDsDir'), |
$handle); |
$handle); |
my $checklaunch; |
my ($checklaunch,$prevlaunch); |
if ($data{'origurl'} =~ m{^/tiny/$match_domain/\w+$}) { |
if ($data{'origurl'} =~ m{^/tiny/$match_domain/\w+$}) { |
unless ($env{'request.linkprot'} eq $data{'linkprot'}) { |
unless ($env{'request.linkprot'} eq $data{'linkprot'}) { |
$checklaunch = 1; |
$checklaunch = 1; |
Line 747 sub handler {
|
Line 760 sub handler {
|
unless ($env{'request.linkprotexit'} eq $data{'linkprotexit'}) { |
unless ($env{'request.linkprotexit'} eq $data{'linkprotexit'}) { |
$checklaunch = 1; |
$checklaunch = 1; |
} |
} |
|
unless ($env{'request.linkprotpbid'} eq $data{'linkprotpbid'}) { |
|
$checklaunch = 1; |
|
} |
|
unless ($env{'request.linkprotpburl'} eq $data{'linkprotpburl'}) { |
|
$checklaunch = 1; |
|
} |
unless ($env{'request.linkkey'} eq $data{'linkkey'}) { |
unless ($env{'request.linkkey'} eq $data{'linkkey'}) { |
$checklaunch = 1; |
$checklaunch = 1; |
} |
} |
Line 758 sub handler {
|
Line 777 sub handler {
|
if (($env{'user.name'} ne $data{'username'}) || |
if (($env{'user.name'} ne $data{'username'}) || |
($env{'user.domain'} ne $data{'domain'})) { |
($env{'user.domain'} ne $data{'domain'})) { |
my %linkprot_env; |
my %linkprot_env; |
foreach my $item ('linkprot','linkprotexit','deeplink.login') { |
foreach my $item ('linkprot','linkprotexit','linkprotpbid','linkprotpburl','deeplink.login') { |
if ($data{$item}) { |
if ($data{$item}) { |
$linkprot_env{$item} = $data{$item}; |
$linkprot_env{$item} = $data{$item}; |
} |
} |
Line 823 sub handler {
|
Line 842 sub handler {
|
} |
} |
} |
} |
if ($data{'deeplink.login'}) { |
if ($data{'deeplink.login'}) { |
|
if (($env{'request.deeplink.login'}) && ($env{'request.deeplink.login'} ne $data{'deeplink.login'})) { |
|
$prevlaunch = $env{'request.deeplink.login'}; |
|
} |
&Apache::lonnet::appenv({'request.deeplink.login' => $data{'deeplink.login'}}); |
&Apache::lonnet::appenv({'request.deeplink.login' => $data{'deeplink.login'}}); |
} |
} |
if ($data{'lti.login'}) { |
if ($data{'lti.login'}) { |
Line 908 sub handler {
|
Line 930 sub handler {
|
my %info; |
my %info; |
if ($env{'request.linkprot'}) { |
if ($env{'request.linkprot'}) { |
$info{'linkprot'} = $env{'request.linkprot'}; |
$info{'linkprot'} = $env{'request.linkprot'}; |
foreach my $item ('linkprotuser','linkprotexit') { |
foreach my $item ('linkprotuser','linkprotexit','linkprotpbid','linkprotpburl') { |
if ($data{$item}) { |
if ($data{$item}) { |
$info{$item} = $data{$item}; |
$info{$item} = $data{$item}; |
} |
} |
Line 919 sub handler {
|
Line 941 sub handler {
|
$info{'origurl'} = $data{'origurl'}; |
$info{'origurl'} = $data{'origurl'}; |
if ($checklaunch) { |
if ($checklaunch) { |
$info{'checklaunch'} = 1; |
$info{'checklaunch'} = 1; |
|
$info{'prevlaunch'} = $prevlaunch; |
} |
} |
my $token = &Apache::lonnet::tmpput(\%info,$r->dir_config('lonHostID'),'link'); |
my $token = &Apache::lonnet::tmpput(\%info,$r->dir_config('lonHostID'),'link'); |
unless (($token eq 'con_lost') || ($token eq 'refused') || ($token =~ /^error:/) || |
unless (($token eq 'con_lost') || ($token eq 'refused') || ($token =~ /^error:/) || |
Line 967 sub handler {
|
Line 990 sub handler {
|
if ($data{'linkprotexit'}) { |
if ($data{'linkprotexit'}) { |
$extra_env->{'request.linkprotexit'} = $data{'linkprotexit'}; |
$extra_env->{'request.linkprotexit'} = $data{'linkprotexit'}; |
} |
} |
|
if ($data{'linkprotpbid'}) { |
|
$extra_env->{'request.linkprotpbid'} = $data{'linkprotpbid'}; |
|
} |
|
if ($data{'linkprotpburl'}) { |
|
$extra_env->{'request.linkprotpburl'} = $data{'linkprotpburl'}; |
|
} |
} |
} |
foreach my $item ('linkprotuser','linkprotexit') { |
foreach my $item ('linkprotuser','linkprotexit','linkprotpbid','linkprotpburl') { |
if ($data{$item} ne '') { |
if ($data{$item} ne '') { |
$form{$item} = $data{$item}; |
$form{$item} = $data{$item}; |
} |
} |
Line 991 sub handler {
|
Line 1020 sub handler {
|
$extra_env = {'request.deeplink.login' => $data{'deeplink.login'}}; |
$extra_env = {'request.deeplink.login' => $data{'deeplink.login'}}; |
} |
} |
} |
} |
|
if ($desturl eq '/adm/email') { |
|
if (($data{'display'}) && ($data{'mailrecip'})) { |
|
if (&unescape($data{'mailrecip'}) eq "$data{'username'}:$data{'domain'}") { |
|
$form{'display'} = &unescape($data{'display'}); |
|
} |
|
} |
|
} |
} |
} |
my $skipcritical; |
my $skipcritical; |
if ($data{'lti.login'}) { |
if ($data{'lti.login'}) { |
Line 1002 sub handler {
|
Line 1038 sub handler {
|
} |
} |
&Apache::lonauth::success($r,$data{'username'},$data{'domain'}, |
&Apache::lonauth::success($r,$data{'username'},$data{'domain'}, |
$home,$desturl,$extra_env,\%form,$skipcritical,'', |
$home,$desturl,$extra_env,\%form,$skipcritical,'', |
$expirepub); |
$expirepub,$data{'lcssowin'}); |
} |
} |
return OK; |
return OK; |
} |
} |
Line 1073 sub handler {
|
Line 1109 sub handler {
|
if ($data{'linkprotexit'}) { |
if ($data{'linkprotexit'}) { |
$extra_env->{'request.linkprotexit'} = $data{'linkprotexit'}; |
$extra_env->{'request.linkprotexit'} = $data{'linkprotexit'}; |
} |
} |
foreach my $item ('linkprotuser','linkprotexit') { |
if ($data{'linkprotpbid'}) { |
|
$extra_env->{'request.linkprotpassbid'} = $data{'linkprotpbid'}; |
|
} |
|
if ($data{'linkprotpburl'}) { |
|
$extra_env->{'request.linkprotpassburl'} = $data{'linkprotpburl'}; |
|
} |
|
foreach my $item ('linkprotuser','linkprotexit','linkprotpbid','linkprotpburl') { |
if ($data{$item}) { |
if ($data{$item}) { |
$form{'request.'.$item} = $data{$item}; |
$form{'request.'.$item} = $data{$item}; |
} |
} |
Line 1083 sub handler {
|
Line 1125 sub handler {
|
} |
} |
} |
} |
&Apache::lonauth::success($r,$data{'username'},$data{'domain'},$home, |
&Apache::lonauth::success($r,$data{'username'},$data{'domain'},$home, |
$next_url,$extra_env,\%form,'',$cid); |
$next_url,$extra_env,\%form,'',$cid,'',$data{'lcssowin'}); |
} |
} |
return OK; |
return OK; |
} |
} |