Diff for /loncom/auth/lonroles.pm between versions 1.23 and 1.26

version 1.23, 2001/03/03 00:55:36 version 1.26, 2001/06/02 16:14:40
Line 9 Line 9
 # 12/08,12/28,  # 12/08,12/28,
 # 01/15/01 Gerd Kortemeyer  # 01/15/01 Gerd Kortemeyer
 # 02/27/01 Scott Harrison  # 02/27/01 Scott Harrison
 # 03/02 Gerd Kortemeyer  # 03/02,05/03,05/25,05/30,06/01 Gerd Kortemeyer
   
 package Apache::lonroles;  package Apache::lonroles;
   
Line 18  use Apache::lonnet(); Line 18  use Apache::lonnet();
 use Apache::lonuserstate();  use Apache::lonuserstate();
 use Apache::Constants qw(:common);  use Apache::Constants qw(:common);
 use Apache::File();  use Apache::File();
   use Apache::lonmenu;
   
 sub handler {  sub handler {
   
Line 58  sub handler { Line 59  sub handler {
                    my ($cdom,$cnum,$csec)=split(/\//,$where);                     my ($cdom,$cnum,$csec)=split(/\//,$where);
                    &Apache::lonnet::appenv('request.role' => $trolecode,                     &Apache::lonnet::appenv('request.role' => $trolecode,
                                            'request.course.sec' => $csec);                                             'request.course.sec' => $csec);
                    if ($cnum) {                     if (($cnum) && ($role ne 'ca')) {
       my ($furl,$ferr)=        my ($furl,$ferr)=
   &Apache::lonuserstate::readmap($cdom.'/'.$cnum);    &Apache::lonuserstate::readmap($cdom.'/'.$cnum);
                       if (($ENV{'form.orgurl'}) &&                         if (($ENV{'form.orgurl'}) && 
Line 68  sub handler { Line 69  sub handler {
      } else {       } else {
                  $r->content_type('text/html');                   $r->content_type('text/html');
                          $r->send_http_header;                           $r->send_http_header;
                            my $swinfo=&Apache::lonmenu::rawconfig;
                          print (<<ENDREDIR);                           print (<<ENDREDIR);
 <head><title>Entering Course</title>  <head><title>Entering Course</title>
 <meta HTTP-EQUIV="Refresh" CONTENT="1; url=$furl">  <meta HTTP-EQUIV="Refresh" CONTENT="1; url=$furl">
 </head>  </head>
 <html>  <html>
 <body bgcolor="#FFFFFF">  <body bgcolor="#FFFFFF">
   <script>
   $swinfo
   </script>
 Entering course ...  Entering course ...
 </body>  </body>
 </html>  </html>
Line 94  ENDREDIR Line 99  ENDREDIR
     $r->send_http_header;      $r->send_http_header;
     return OK if $r->header_only;      return OK if $r->header_only;
   
       my $swinfo=&Apache::lonmenu::rawconfig;
   
     $r->print(<<ENDHEADER);      $r->print(<<ENDHEADER);
 <html>  <html>
 <head>  <head>
 <title>LON-CAPA User Roles</title>  <title>LON-CAPA User Roles</title>
 </head><body bgcolor="#FFFFFF">  </head><body bgcolor="#FFFFFF">
 <script>window.focus();</script>  <script>
   $swinfo
   window.focus();
   </script>
 ENDHEADER  ENDHEADER
   
 # ------------------------------------------ Get Error Message from Environment  # ------------------------------------------ Get Error Message from Environment
Line 130  ENDHEADER Line 140  ENDHEADER
         $r->print("Action  : $msg\n</pre><hr>");          $r->print("Action  : $msg\n</pre><hr>");
     } else {      } else {
         $r->print("<h1>LON-CAPA User Roles</h1>");          $r->print("<h1>LON-CAPA User Roles</h1>");
           if ($ENV{'user.error.msg'}) {
       $r->print(
    '<h3><font color=red>You need to choose another user role or '.
    'enter a specific course for this function</font></h3>');
    }
     }      }
 # -------------------------------------------------------- Choice or no choice?  # -------------------------------------------------------- Choice or no choice?
     if ($nochoose) {      if ($nochoose) {
Line 222  ENDHEADER Line 237  ENDHEADER
             my ($tdom,$trest,$tsection)=              my ($tdom,$trest,$tsection)=
                split(/\//,Apache::lonnet::declutter($where));                 split(/\//,Apache::lonnet::declutter($where));
             if ($trest) {              if ($trest) {
         if ($role eq 'ca') {
           $ttype='Construction Space';
                   $twhere='User: '.$trest.'<br>Domain: '.$tdom;
                   $ENV{'course.'.$tdom.'_'.$trest.'.description'}='ca';
                 } else {
  $ttype='Course';   $ttype='Course';
                 if ($tsection) {                  if ($tsection) {
                    $ttype.='<br>Section/Group: '.$tsection;                     $ttype.='<br>Section/Group: '.$tsection;
Line 238  ENDHEADER Line 258  ENDHEADER
                         $ENV{'course.'.$tcourseid.'.description'}=$twhere;                          $ENV{'course.'.$tcourseid.'.description'}=$twhere;
                     }                      }
                 }                  }
         }
             } elsif ($tdom) {              } elsif ($tdom) {
                 $ttype='Domain';                  $ttype='Domain';
                 $twhere=$tdom;                  $twhere=$tdom;
Line 295  ENDHEADER Line 316  ENDHEADER
             my ($tdom,$trest,$tsec)=              my ($tdom,$trest,$tsec)=
                split(/\//,Apache::lonnet::declutter($where));                 split(/\//,Apache::lonnet::declutter($where));
             if ($trest) {              if ($trest) {
         if ($ENV{'course.'.$tdom.'_'.$trest.'.description'} eq 'ca') {
           $ttype='Construction Space';
                   $twhere='User: '.$trest.', Domain: '.$tdom;
                 } else {
  $ttype='Course';   $ttype='Course';
                 $twhere=$ENV{'course.'.$tdom.'_'.$trest.'.description'};                  $twhere=$ENV{'course.'.$tdom.'_'.$trest.'.description'};
                 if ($tsec) {                  if ($tsec) {
     $twhere.=' (Section/Group: '.$tsec.')';      $twhere.=' (Section/Group: '.$tsec.')';
                 }                  }
         }
             } elsif ($tdom) {              } elsif ($tdom) {
                 $ttype='Domain';                  $ttype='Domain';
                 $twhere=$tdom;                  $twhere=$tdom;

Removed from v.1.23  
changed lines
  Added in v.1.26


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