Diff for /loncom/auth/lonroles.pm between versions 1.269.2.34.2.1 and 1.269.2.38

version 1.269.2.34.2.1, 2017/10/14 22:27:40 version 1.269.2.38, 2021/01/04 03:50:53
Line 495  sub handler { Line 495  sub handler {
  my $end_page=&Apache::loncommon::end_page();   my $end_page=&Apache::loncommon::end_page();
  my $buttontext=&mt('Enter Course');   my $buttontext=&mt('Enter Course');
  my $message=&mt('Successfully registered key');   my $message=&mt('Successfully registered key');
                                    my $ip = &Apache::lonnet::get_requestor_ip();
  my $assignresult=   my $assignresult=
      &Apache::lonnet::assign_access_key(       &Apache::lonnet::assign_access_key(
      $env{'form.newkey'},       $env{'form.newkey'},
Line 503  sub handler { Line 504  sub handler {
                                                      $env{'user.domain'},                                                       $env{'user.domain'},
      $env{'user.name'},       $env{'user.name'},
                                                      &mt('Assigned from [_1] at [_2] for [_3]'                                                       &mt('Assigned from [_1] at [_2] for [_3]'
                                                         ,$ENV{'REMOTE_ADDR'}                                                          ,$ip
                                                         ,&Apache::lonlocal::locallocaltime()                                                          ,&Apache::lonlocal::locallocaltime()
                                                         ,$trolecode)                                                          ,$trolecode)
                                                      );                                                       );
Line 688  ENDENTERKEY Line 689  ENDENTERKEY
                                                     }                                                      }
                                                 }                                                  }
                                             }                                              }
                                               if (($dest =~ m{^\Q/public/$cdom/$cnum/syllabus\E.*(\?|\&)usehttp=1}) ||
                                                   ($dest =~ m{^\Q/adm/wrapper/ext/\E(?!https:)})) {
                                                   if ($ENV{'SERVER_PORT'} == 443) {
                                                       unless (&Apache::lonnet::uses_sts()) {
                                                           my $hostname = $r->hostname();
                                                           if ($hostname ne '') {
                                                               $dest = 'http://'.$hostname.$dest;
                                                           }
                                                       }
                                                   }
                                               }
                                             if ($dest =~ m{^/enc/}) {                                              if ($dest =~ m{^/enc/}) {
                                                 if ($env{'request.role.adv'}) {                                                  if ($env{'request.role.adv'}) {
                                                     $dest = &Apache::lonenc::unencrypted($dest);                                                      $dest = &Apache::lonenc::unencrypted($dest);
Line 720  ENDENTERKEY Line 732  ENDENTERKEY
                                         unless (($dest =~ m{^/enc/}) || ($dest =~ /(\?|\&)symb=.+___\d+___.+/)) {                                           unless (($dest =~ m{^/enc/}) || ($dest =~ /(\?|\&)symb=.+___\d+___.+/)) { 
                                             if (($destsymb ne '') && ($destsymb !~ m{^/enc/})) {                                              if (($destsymb ne '') && ($destsymb !~ m{^/enc/})) {
                                                 my $esc_symb = &escape($destsymb);                                                  my $esc_symb = &escape($destsymb);
                                                 $dest .= '?symb='.$esc_symb;                                                  $dest .= (($dest =~/\?/)? '&':'?').'symb='.$esc_symb;
                                             }                                              }
                                         }                                          }
                                         &redirect_user($r, &mt('Entering [_1]',                                          &redirect_user($r, &mt('Entering [_1]',
Line 1019  ENDHEADER Line 1031  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 1537  sub print_rolerows { Line 1553  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>
  </ul>');   <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></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 1562  sub findcourse_advice { Line 1584  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 1623  sub requestcourse_advice { Line 1645  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.269.2.34.2.1  
changed lines
  Added in v.1.269.2.38


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