Diff for /loncom/interface/selfenroll.pm between versions 1.6 and 1.8

version 1.6, 2008/06/30 17:04:11 version 1.8, 2008/07/10 00:19:56
Line 92  sub handler { Line 92  sub handler {
         foreach my $key (keys(%env)) {          foreach my $key (keys(%env)) {
             if ($key =~ m-^user\.role\.st\./$cdom/$cnum/?(\w*)$-) {              if ($key =~ m-^user\.role\.st\./$cdom/$cnum/?(\w*)$-) {
                 my $sec = $1;                  my $sec = $1;
                 if ($sec eq '') {  
                     $sec = &mt('none');  
                 }   
                 my ($start,$end) = split(/\./,$env{$key});                  my ($start,$end) = split(/\./,$env{$key});
                 my $status = 'active';                  my $status = 'active';
                 if (($end) && ($end<=$now)) {                  if (($end) && ($end<=$now)) {
Line 106  sub handler { Line 103  sub handler {
                 if ($status eq 'active' || $status eq 'future') {                  if ($status eq 'active' || $status eq 'future') {
                      $curr_role{'status'} = $status;                       $curr_role{'status'} = $status;
                      $curr_role{'section'} = $sec;                       $curr_role{'section'} = $sec;
                        if ($curr_role{'section'} eq '') {
                            $curr_role{'section'} = &mt('none'); 
                        }
                      $curr_role{'start'} = &Apache::lonlocal::locallocaltime($start);                       $curr_role{'start'} = &Apache::lonlocal::locallocaltime($start);
                      $curr_role{'role'} = 'st./'.$cdom.'/'.$cnum;                       $curr_role{'role'} = 'st./'.$cdom.'/'.$cnum;
                      if ($sec ne '') {                       if ($sec ne '') {
Line 339  sub process_self_enroll { Line 339  sub process_self_enroll {
                                                 $area);                                                  $area);
             &Apache::lonnet::set_userprivs(\%userroles,\%newrole,%newgroups);              &Apache::lonnet::set_userprivs(\%userroles,\%newrole,%newgroups);
             $userroles{'user.role.'.$spec} = $selfenroll_access_start.'.'.$selfenroll_access_end;              $userroles{'user.role.'.$spec} = $selfenroll_access_start.'.'.$selfenroll_access_end;
             &Apache::lonnet::appenv(\%userroles,[$role]);              &Apache::lonnet::appenv(\%userroles,[$role,'cm']);
             if ($selfenroll_access_end && $selfenroll_access_end <= $now) {              if ($selfenroll_access_end && $selfenroll_access_end <= $now) {
                 $r->print(&mt('The end date for access to this course for users who self-enroll has passed.').'<br />'.&mt('Consequently, although a new role was created for you in the course, it is an inactive role which does not provide access to the course.'));                  $r->print(&mt('The end date for access to this course for users who self-enroll has passed.').'<br />'.&mt('Consequently, although a new role was created for you in the course, it is an inactive role which does not provide access to the course.'));
             } else {              } else {

Removed from v.1.6  
changed lines
  Added in v.1.8


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