';
@@ -844,6 +933,9 @@ ENDCLOSE
($env{'request.lti.rosterid'} || $env{'request.lti.passbackid'})) {
&process_lti($r,$cdom,$cnum);
}
+ if ($env{'request.deeplink.login'}) {
+ &set_deeplink_target($cnum,$cdom);
+ }
# Check to see if the user is a CC entering a course
# for the first time
if ((($role eq 'cc') || ($role eq 'co'))
@@ -1108,7 +1200,7 @@ ENDCLOSE
$start_page=&Apache::loncommon::start_page($pagetitle,undef,
{bread_crumbs=>$brcrum,crstype=>'Placement'});
} else {
- my $crumbsright);
+ my $crumbsright;
unless (($norolelist) && ((split(/:/,$env{'user.error.msg'}))[2])) {
$funcs = &get_roles_functions($showcount,$cattype);
if ($env{'browser.mobile'}) {
@@ -1260,6 +1352,16 @@ ENDHEADER
$r->print('');
$r->print('');
$r->print('');
+ if ($blocked_by_ip) {
+ my $blocked_role = 'student';
+ if ($blocked_type eq 'Community') {
+ $blocked_role = 'member';
+ }
+ $r->print('
'.
+ &mt('The [_1] you selected is not available for access with a [_2] role from your current IP address: [_3].',
+ lc($blocked_type),$blocked_role,$clientip).
+ '
'.&mt('If you were expecting to see an active role listed for a particular course, that course may not have been created yet.').'
');
if ($elapsed > 600) {
- $r->print('
'.&mt('You may also have been assigned to a course in the time since you last logged-in, or checked for changes').
+ $r->print('
'.&mt('You may also have been assigned to a course in the time since you last logged-in, or checked for changes.').
' '.
&mt('If that is the case you can use the "Check for changes" link in the gray Functions bar to update the list of your available course roles.').'
');
}
@@ -3452,6 +3554,34 @@ sub ltienroll {
}
}
+sub set_deeplink_target {
+ my ($cnum,$cdom) = @_;
+ if (($cnum ne '') && ($cdom ne '')) {
+ my $deeplink_symb = &Apache::loncommon::deeplink_login_symb($cnum,$cdom);
+ if ($deeplink_symb ne '') {
+ my $deeplink;
+ if ($deeplink_symb =~ /\.(page|sequence)$/) {
+ my $mapname = &Apache::lonnet::deversion((&Apache::lonnet::decode_symb($deeplink_symb))[2]);
+ my $navmap = Apache::lonnavmaps::navmap->new();
+ if (ref($navmap)) {
+ $deeplink = $navmap->get_mapparam(undef,$mapname,'0.deeplink');
+ }
+ } elsif ($deeplink_symb ne '') {
+ $deeplink = &Apache::lonnet::EXT('resource.0.deeplink',$deeplink_symb);
+ }
+ if ($deeplink ne '') {
+ my ($state,$others,$listed,$scope,$protect,$display,$target) = split(/,/,$deeplink);
+ if ($target ne '') {
+ &Apache::lonnet::appenv({'request.deeplink.target' => $target});
+ } elsif (exists($env{'request.deeplink.target'})) {
+ &Apache::lonnet::delenv('request.deeplink.target');
+ }
+ }
+ }
+ }
+ return;
+}
+
1;
__END__