Diff for /loncom/auth/lonroles.pm between versions 1.359 and 1.364

version 1.359, 2021/11/30 15:55:40 version 1.364, 2022/05/25 18:04:17
Line 181  ENDREDIR Line 181  ENDREDIR
   
 sub finish_loading_course {  sub finish_loading_course {
     my ($r,$msg,$url) = @_;      my ($r,$msg,$url) = @_;
     my $link = '<div id="LC_course_loaded" style="display:none"><a href="'.$url.'">'.&mt('Continue').'</a></div>';      my $link = '<div id="LC_course_loaded" style="display:none"><a href="'.
                  &HTML::Entities::encode($url,'"<>&').'">'.&mt('Continue').'</a></div>';
     my $end_page = &Apache::loncommon::end_page();      my $end_page = &Apache::loncommon::end_page();
     my $js_url = &js_escape($url);      my $js_url = &js_escape($url);
     $r->print(<<END);      $r->print(<<END);
Line 195  $msg Line 196  $msg
     var url = "$js_url";      var url = "$js_url";
     \$(location).attr('href',url);      \$(location).attr('href',url);
 });  });
   // ]]>
 </script>  </script>
 $link  $link
 $end_page  $end_page
Line 897  ENDCLOSE Line 899  ENDCLOSE
                                         ($env{'request.lti.rosterid'} || $env{'request.lti.passbackid'})) {                                          ($env{'request.lti.rosterid'} || $env{'request.lti.passbackid'})) {
                                         &process_lti($r,$cdom,$cnum);                                          &process_lti($r,$cdom,$cnum);
                                     }                                      }
                                       if ($env{'request.deeplink.login'}) {
                                           &set_deeplink_target($cnum,$cdom);
                                       }
                                     $msg = '<p>'.&mt('Entering [_1] ...',                                      $msg = '<p>'.&mt('Entering [_1] ...',
                                                      $env{'course.'.$cdom.'_'.$cnum.'.description'}).                                                       $env{'course.'.$cdom.'_'.$cnum.'.description'}).
                                            '</p>';                                             '</p>';
Line 928  ENDCLOSE Line 933  ENDCLOSE
                                     ($env{'request.lti.rosterid'} || $env{'request.lti.passbackid'})) {                                      ($env{'request.lti.rosterid'} || $env{'request.lti.passbackid'})) {
                                     &process_lti($r,$cdom,$cnum);                                      &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    # Check to see if the user is a CC entering a course 
  # for the first time   # for the first time
  if ((($role eq 'cc') || ($role eq 'co'))    if ((($role eq 'cc') || ($role eq 'co')) 
Line 1991  sub findcourse_advice { Line 1999  sub findcourse_advice {
     } else {      } else {
         $r->print('<p>'.&mt('If you were expecting to see an active role listed for a particular course, that course may not have been created yet.').'</p>');          $r->print('<p>'.&mt('If you were expecting to see an active role listed for a particular course, that course may not have been created yet.').'</p>');
         if ($elapsed > 600) {          if ($elapsed > 600) {
             $r->print('<p>'.&mt('You may also have been assigned to a course in the time since you last logged-in, or checked for changes').              $r->print('<p>'.&mt('You may also have been assigned to a course in the time since you last logged-in, or checked for changes.').
                       '<br />'.                        '<br />'.
                       &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.').'</p>');                        &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.').'</p>');
         }            }  
Line 3546  sub ltienroll { Line 3554  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;  1;
 __END__  __END__
   

Removed from v.1.359  
changed lines
  Added in v.1.364


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