Diff for /loncom/auth/lonroles.pm between versions 1.340 and 1.343

version 1.340, 2018/12/08 15:16:03 version 1.343, 2020/02/04 01:27:04
Line 721  ENDENTERKEY Line 721  ENDENTERKEY
                                             if (($dest =~ m{^\Q/public/$cdom/$cnum/syllabus\E.*(\?|\&)usehttp=1}) ||                                              if (($dest =~ m{^\Q/public/$cdom/$cnum/syllabus\E.*(\?|\&)usehttp=1}) ||
                                                 ($dest =~ m{^\Q/adm/wrapper/ext/\E(?!https:)})) {                                                  ($dest =~ m{^\Q/adm/wrapper/ext/\E(?!https:)})) {
                                                 if ($ENV{'SERVER_PORT'} == 443) {                                                  if ($ENV{'SERVER_PORT'} == 443) {
                                                     my $hostname = $r->hostname();                                                      unless (&Apache::lonnet::uses_sts()) {
                                                     if ($hostname ne '') {                                                          my $hostname = $r->hostname();
                                                         $dest = 'http://'.$hostname.$dest;                                                          if ($hostname ne '') {
                                                               $dest = 'http://'.$hostname.$dest;
                                                           }
                                                     }                                                      }
                                                 }                                                  }
                                             }                                              }
Line 1106  ENDHEADER Line 1108  ENDHEADER
   
 # No active roles  # No active roles
     if ($countactive==0) {      if ($countactive==0) {
         &requestcourse_advice($r,$cattype,$inrole);           my $elapsed = 0;
           if ($now && $update) {
               $elapsed = $now - $update;
           }
           &requestcourse_advice($r,$cattype,$inrole,$elapsed); 
  $r->print('</form>');   $r->print('</form>');
         if ($countfuture) {          if ($countfuture) {
             $r->print(&mt('The following [quant,_1,role,roles] will become active in the future:',$countfuture));              $r->print(&mt('The following [quant,_1,role,roles] will become active in the future:',$countfuture));
Line 1367  sub gather_roles { Line 1373  sub gather_roles {
                         $button=0;                          $button=0;
                         unless ($trustchecked{$tdom}) {                          unless ($trustchecked{$tdom}) {
                             if ((&Apache::lonnet::will_trust('othcoau',$env{'user.domain'},$tdom)) &&                              if ((&Apache::lonnet::will_trust('othcoau',$env{'user.domain'},$tdom)) &&
                                 (&Apache::lonnet::will_trust('coremau',$tdom,$env{'user.domain'}))) {                                  (&Apache::lonnet::will_trust('coaurem',$tdom,$env{'user.domain'}))) {
                                 $willtrust{$tdom} = 1;                                  $willtrust{$tdom} = 1;
                                 $trustchecked{$tdom} = 1;                                  $trustchecked{$tdom} = 1;
                             }                              }
Line 1656  sub print_rolerows { Line 1662  sub print_rolerows {
 }  }
   
 sub findcourse_advice {  sub findcourse_advice {
     my ($r,$cattype) = @_;      my ($r,$cattype,$elapsed) = @_;
     my $domdesc = &Apache::lonnet::domain($env{'user.domain'},'description');      my $domdesc = &Apache::lonnet::domain($env{'user.domain'},'description');
     my $esc_dom = &HTML::Entities::encode($env{'user.domain'},'"<>&');      my $esc_dom = &HTML::Entities::encode($env{'user.domain'},'"<>&');
     if (&Apache::lonnet::auto_run(undef,$env{'user.domain'})) {      if (&Apache::lonnet::auto_run(undef,$env{'user.domain'})) {
         $r->print(&mt('If you were expecting to see an active role listed for a particular course in the [_1] domain, it may be missing for one of the following reasons:',$domdesc).'          $r->print('<p>'.&mt('If you were expecting to see an active role listed for a particular course in the [_1] domain, it may be missing for one of the following reasons:',$domdesc).'
 <ul>  <ul>
  <li>'.&mt('The course has yet to be created.').'</li>   <li>'.&mt('The course has yet to be created.').'</li>
  <li>'.&mt('Automatic enrollment of registered students has not been enabled for the course.').'</li>   <li>'.&mt('Automatic enrollment of registered students has not been enabled for the course.').'</li>
  <li>'.&mt('You are in a section of course for which automatic enrollment in the corresponding LON-CAPA course is not active.').'</li>   <li>'.&mt('You are in a section of course for which automatic enrollment in the corresponding LON-CAPA course is not active.').'</li>
  <li>'.&mt('The start date for automated enrollment has yet to be reached.').'</li>   <li>'.&mt('The start date for automated enrollment has yet to be reached.').'</li>
  <li>'.&mt('You registered for the course recently and there is a time lag between the time you register, and the time this information becomes available for the update of LON-CAPA course rosters.').'</li>   <li>'.&mt('You registered for the course recently and there is a time lag between the time you register, and the time this information becomes available for the update of LON-CAPA course rosters.').'</li>
  <li>'.&mt('Automated enrollment added you to the course in the time since you last logged in.').' '.&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.').'</li>      <li>'.&mt('Automated enrollment added you to the course in the time since you last logged-in.').' '.&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.').'</li>   
  </ul>');   </ul></p>');
     } else {      } else {
         $r->print(&mt('If you were expecting to see an active role listed for a particular course, that course may not have been created yet.').'<br />');          $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) {
               $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 />'.
                         &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>');
           }  
     }      }
     if (($cattype eq 'std') || ($cattype eq 'domonly')) {      if (($cattype eq 'std') || ($cattype eq 'domonly')) {
         $r->print('<h3>'.&mt('Self-Enrollment').'</h3>'.          $r->print('<h3>'.&mt('Self-Enrollment').'</h3>'.
Line 1682  sub findcourse_advice { Line 1693  sub findcourse_advice {
 }  }
   
 sub requestcourse_advice {  sub requestcourse_advice {
     my ($r,$cattype,$inrole) = @_;      my ($r,$cattype,$inrole,$elapsed) = @_;
     my $domdesc = &Apache::lonnet::domain($env{'user.domain'},'description');      my $domdesc = &Apache::lonnet::domain($env{'user.domain'},'description');
     my $esc_dom = &HTML::Entities::encode($env{'user.domain'},'"<>&');      my $esc_dom = &HTML::Entities::encode($env{'user.domain'},'"<>&');
     my (%can_request,%request_doms,$output);      my (%can_request,%request_doms,$output);
Line 1743  sub requestcourse_advice { Line 1754  sub requestcourse_advice {
         } else {          } else {
             $r->print('<h3>'.&mt('Currently no active roles, courses or communities').'</h3>');              $r->print('<h3>'.&mt('Currently no active roles, courses or communities').'</h3>');
         }          }
         &findcourse_advice($r,$cattype);          &findcourse_advice($r,$cattype,$elapsed);
     }      }
     return;      return;
 }  }

Removed from v.1.340  
changed lines
  Added in v.1.343


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