Diff for /loncom/auth/lonroles.pm between versions 1.94 and 1.100

version 1.94, 2004/07/04 05:53:35 version 1.100, 2004/11/01 23:23:33
Line 40  use Apache::lonannounce; Line 40  use Apache::lonannounce;
 use Apache::lonlocal;  use Apache::lonlocal;
   
 sub redirect_user {  sub redirect_user {
     my ($r,$title,$url,$msg) = @_;      my ($r,$title,$url,$msg,$launch_nav) = @_;
     $msg = $title if (! defined($msg));      $msg = $title if (! defined($msg));
     &Apache::loncommon::content_type($r,'text/html');      &Apache::loncommon::content_type($r,'text/html');
     &Apache::loncommon::no_cache($r);      &Apache::loncommon::no_cache($r);
     $r->send_http_header;      $r->send_http_header;
     my $swinfo=&Apache::lonmenu::rawconfig();      my $swinfo=&Apache::lonmenu::rawconfig();
       my $navwindow;
       if ($launch_nav eq 'on') {
    $navwindow.=&Apache::lonnavmaps::launch_win('now');
       } else {
    $navwindow.=&Apache::lonnavmaps::close();
       }
     my $bodytag=&Apache::loncommon::bodytag('Switching Role');      my $bodytag=&Apache::loncommon::bodytag('Switching Role');
 # Note to style police:   # Note to style police: 
 # This must only replace the spaces, nothing else, or it bombs elsewhere.  # This must only replace the spaces, nothing else, or it bombs elsewhere.
Line 56  sub redirect_user { Line 62  sub redirect_user {
 </head>  </head>
 <html>  <html>
 $bodytag  $bodytag
 <script>  <script type="text/javascript">
 $swinfo  $swinfo
 </script>  </script>
   $navwindow
 <h1>$msg</h1>  <h1>$msg</h1>
   <a href="$url">Continue</a>
 </body>  </body>
 </html>  </html>
 ENDREDIR  ENDREDIR
Line 76  sub handler { Line 84  sub handler {
   
   
 # ================================================================== Roles Init  # ================================================================== Roles Init
   
     if ($ENV{'form.selectrole'}) {      if ($ENV{'form.selectrole'}) {
  if ($ENV{'request.course.id'}) {   if ($ENV{'request.course.id'}) {
     my %temp=('logout_'.$ENV{'request.course.id'} => time);      my %temp=('logout_'.$ENV{'request.course.id'} => time);
     &Apache::lonnet::put('email_status',\%temp);      &Apache::lonnet::put('email_status',\%temp);
         }      &Apache::lonnet::delenv('user.state.'.$ENV{'request.course.id'});
    }
  &Apache::lonnet::appenv("request.course.id"   => '',   &Apache::lonnet::appenv("request.course.id"   => '',
  "request.course.fn"   => '',   "request.course.fn"   => '',
  "request.course.uri"  => '',   "request.course.uri"  => '',
Line 246  ENDENTERKEY Line 254  ENDENTERKEY
                             #                              #
                             # Send the user to the course they selected                              # Send the user to the course they selected
                             &redirect_user($r,&mt('Entering Course'),                              &redirect_user($r,&mt('Entering Course'),
                                            $furl,$msg);                                             $furl,$msg,
      $ENV{'environment.remotenavmap'});
                             return OK;                              return OK;
  }   }
     }      }
Line 452  ENDHEADER Line 461  ENDHEADER
                          $Apache::lonnet::hostname{$home}.                           $Apache::lonnet::hostname{$home}.
                          '/adm/login?domain='.$ENV{'user.domain'}.                           '/adm/login?domain='.$ENV{'user.domain'}.
   '&username='.$ENV{'user.name'}.    '&username='.$ENV{'user.name'}.
                           '&firsturl=/priv/'.$trest);                            '&firsturl=/priv/'.$trest.'/');
                     }                      }
                     #next if ($home eq 'no_host');                      #next if ($home eq 'no_host');
                     $home = $Apache::lonnet::hostname{$home};                      $home = $Apache::lonnet::hostname{$home};
Line 476  ENDHEADER Line 485  ENDHEADER
                          $Apache::lonnet::hostname{$home}.                           $Apache::lonnet::hostname{$home}.
                           '/adm/login?domain='.$ENV{'user.domain'}.                            '/adm/login?domain='.$ENV{'user.domain'}.
    '&username='.$ENV{'user.name'}.     '&username='.$ENV{'user.name'}.
                            '&firsturl=/priv/'.$ENV{'user.name'});                             '&firsturl=/priv/'.$ENV{'user.name'}.'/');
                     }                      }
                     #next if ($home eq 'no_host');                      #next if ($home eq 'no_host');
                     $home = $Apache::lonnet::hostname{$home};                      $home = $Apache::lonnet::hostname{$home};
Line 597  ENDHEADER Line 606  ENDHEADER
     unless ($nochoose) { $r->print('<th>&nbsp;</th>'); }      unless ($nochoose) { $r->print('<th>&nbsp;</th>'); }
     $r->print('<th>'.&mt('User Role').'</th><th colspan=2>'.&mt('Extent').      $r->print('<th>'.&mt('User Role').'</th><th colspan=2>'.&mt('Extent').
          '</th><th>'.&mt('Start').'</th><th>'.&mt('End').'</th><th>'.           '</th><th>'.&mt('Start').'</th><th>'.&mt('End').'</th><th>'.
       &mt('Remark').'</th></tr>'."\n");        &mt('Remarks and Calendar Announcements').'</th></tr>'."\n");
     my $doheaders=-1;      my $doheaders=-1;
     foreach my $type ('Construction Space','Course','Domain','System') {      foreach my $type ('Construction Space','Course','Domain','System') {
  my $haverole=0;   my $haverole=0;
Line 612  ENDHEADER Line 621  ENDHEADER
  my $output;   my $output;
  foreach my $which (sort {uc($a) cmp uc($b)} (keys(%sortrole))) {   foreach my $which (sort {uc($a) cmp uc($b)} (keys(%sortrole))) {
     if ($roleclass{$sortrole{$which}} =~ /^\Q$type\E/) {       if ($roleclass{$sortrole{$which}} =~ /^\Q$type\E/) { 
  $output.=&mt($roletext{$sortrole{$which}});   $output.=$roletext{$sortrole{$which}};
     }      }
  }   }
  if ($output) {   if ($output) {

Removed from v.1.94  
changed lines
  Added in v.1.100


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