version 1.8.2.1, 2022/01/02 17:21:37
|
version 1.9, 2022/05/24 16:23:04
|
Line 172 sub handler {
|
Line 172 sub handler {
|
} |
} |
} |
} |
my @allposs = keys(%possroles); |
my @allposs = keys(%possroles); |
|
if ($env{'request.lti.login'}) { |
|
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}); |
|
if ($env{'request.lti.target'} eq '') { |
|
if ($env{'form.ltitarget'} eq 'iframe') { |
|
&Apache::lonnet::appenv({'request.lti.target' => 'iframe'}); |
|
delete($env{'form.ltitarget'}); |
|
} |
|
} |
|
if ($env{'form.selectrole'}) { |
|
foreach my $role (@allposs) { |
|
my $newrole = "$role./$cdom/$cnum"; |
|
if ($possroles{$allposs[0]} ne '') { |
|
$newrole .= "/$possroles{$role}"; |
|
} |
|
if ($env{"form.$newrole"}) { |
|
my $destination .= '/adm/roles?selectrole=1&'.$newrole.'=1'. |
|
'&destinationurl='.&HTML::Entities::encode($r->uri); |
|
if ($env{'form.ltitarget'} eq 'iframe') { |
|
$destination .= '<itarget=iframe'; |
|
} |
|
&do_redirect($r,$destination); |
|
return OK; |
|
} |
|
} |
|
} |
|
} |
if (@allposs == 0) { |
if (@allposs == 0) { |
&show_roles($r,\%crsenv,\%possroles); |
&show_roles($r,\%crsenv,\%possroles); |
} elsif (@allposs == 1) { |
} elsif (@allposs == 1) { |
Line 291 sub launch_check {
|
Line 317 sub launch_check {
|
} |
} |
if ($deeplink ne '') { |
if ($deeplink ne '') { |
my $disallow; |
my $disallow; |
my ($state,$others,$listed,$scope,$protect) = split(/,/,$deeplink); |
my ($state,$others,$listed,$scope,$protect,$display,$target) = split(/,/,$deeplink); |
if (($protect ne 'none') && ($protect ne '')) { |
if (($protect ne 'none') && ($protect ne '')) { |
my ($acctype,$item) = split(/:/,$protect); |
my ($acctype,$item) = split(/:/,$protect); |
if ($acctype =~ /lti(c|d)$/) { |
if ($acctype =~ /lti(c|d)$/) { |
Line 334 sub launch_check {
|
Line 360 sub launch_check {
|
} |
} |
} |
} |
&Apache::lonnet::appenv({'request.deeplink.login' => $linkuri}); |
&Apache::lonnet::appenv({'request.deeplink.login' => $linkuri}); |
|
if ($target ne '') { |
|
&Apache::lonnet::appenv({'request.deeplink.target' => $target}); |
|
} |
} |
} |
} else { |
} else { |
if ($linkprotector) { |
if ($linkprotector) { |
Line 354 sub launch_check {
|
Line 383 sub launch_check {
|
sub do_redirect { |
sub do_redirect { |
my ($r,$destination) = @_; |
my ($r,$destination) = @_; |
my $windowname = 'loncapaclient'; |
my $windowname = 'loncapaclient'; |
|
if ($env{'request.lti.login'}) { |
|
$windowname .= 'lti'; |
|
} |
my $header = '<meta HTTP-EQUIV="Refresh" CONTENT="0; url='.$destination.'" />'; |
my $header = '<meta HTTP-EQUIV="Refresh" CONTENT="0; url='.$destination.'" />'; |
my $args = {'bread_crumbs' => [{'href' => '','text' => 'Role initialization'},],}; |
my $args = {'bread_crumbs' => [{'href' => '','text' => 'Role initialization'},],}; |
&Apache::loncommon::content_type($r,'text/html'); |
&Apache::loncommon::content_type($r,'text/html'); |
Line 498 ENDJS
|
Line 530 ENDJS
|
sub generic_error { |
sub generic_error { |
my ($r) = @_; |
my ($r) = @_; |
my $continuelink; |
my $continuelink; |
my $linktext; |
unless ($env{'request.lti.login'}) { |
if ($env{'user.adv'}) { |
my $linktext; |
$linktext = &mt('Continue to your roles page'); |
if ($env{'user.adv'}) { |
} else { |
$linktext = &mt('Continue to your roles page'); |
$linktext = &mt('Continue to your courses page'); |
} else { |
|
$linktext = &mt('Continue to your courses page'); |
|
} |
|
$continuelink='<a href="/adm/roles">'.$linktext.'</a>'; |
} |
} |
$continuelink='<a href="/adm/roles">'.$linktext.'</a>'; |
|
my $msg = &mt('The page you requested does not exist.'); |
my $msg = &mt('The page you requested does not exist.'); |
&Apache::loncommon::content_type($r,'text/html'); |
&Apache::loncommon::content_type($r,'text/html'); |
$r->send_http_header; |
$r->send_http_header; |