Diff for /loncom/auth/lonroles.pm between versions 1.19 and 1.25

version 1.19, 2000/12/28 21:46:08 version 1.25, 2001/05/25 19:38:42
Line 6 Line 6
 # 11/23 Gerd Kortemeyer)  # 11/23 Gerd Kortemeyer)
 # 1/14,03/06,06/01,07/22,07/24,07/25,  # 1/14,03/06,06/01,07/22,07/24,07/25,
 # 09/04,09/06,09/28,09/29,09/30,10/2,10/5,10/26,10/28,  # 09/04,09/06,09/28,09/29,09/30,10/2,10/5,10/26,10/28,
 # 12/08,12/28 Gerd Kortemeyer  # 12/08,12/28,
 #  # 01/15/01 Gerd Kortemeyer
   # 02/27/01 Scott Harrison
   # 03/02,05/03,05/25 Gerd Kortemeyer
   
 package Apache::lonroles;  package Apache::lonroles;
   
 use strict;  use strict;
Line 55  sub handler { Line 58  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'}) && 
                             ($ENV{'form.orgurl'}!~/^\/adm\/flip/)) {
                          $r->internal_redirect($ENV{'form.orgurl'});                           $r->internal_redirect($ENV{'form.orgurl'});
                          return OK;                           return OK;
      } else {       } else {
                          $r->internal_redirect($furl);                   $r->content_type('text/html');
                          return OK;                           $r->send_http_header;
                            print (<<ENDREDIR);
   <head><title>Entering Course</title>
   <meta HTTP-EQUIV="Refresh" CONTENT="1; url=$furl">
   </head>
   <html>
   <body bgcolor="#FFFFFF">
   Entering course ...
   </body>
   </html>
   ENDREDIR
                               return OK;
                      }                       }
                    }                     }
                }                 }
             }               } 
   }    }
         }          }
     }     }
                   
   
 # =============================================================== No Roles Init  # =============================================================== No Roles Init
Line 84  sub handler { Line 99  sub handler {
 <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>
 ENDHEADER  ENDHEADER
   
 # ------------------------------------------ Get Error Message from Environment  # ------------------------------------------ Get Error Message from Environment
Line 114  ENDHEADER Line 130  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 166  ENDHEADER Line 187  ENDHEADER
                 $tpstart=localtime($tstart);                  $tpstart=localtime($tstart);
             }              }
             if ($tend) {              if ($tend) {
                 if ($tend<$then) { $tstatus='expired'; }                  if ($tend<$then) { 
                 if ($tend<$now) { $tstatus='will_not'; }                     $tstatus='expired'; 
                   } elsif ($tend<$now) { 
                      $tstatus='will_not'; 
                   }
                 $tpend=localtime($tend);                  $tpend=localtime($tend);
             }              }
             if ($ENV{'request.role'} eq $trolecode) {              if ($ENV{'request.role'} eq $trolecode) {
Line 203  ENDHEADER Line 227  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 219  ENDHEADER Line 248  ENDHEADER
                         $ENV{'course.'.$tcourseid.'.description'}=$twhere;                          $ENV{'course.'.$tcourseid.'.description'}=$twhere;
                     }                      }
                 }                  }
         }
             } elsif ($tdom) {              } elsif ($tdom) {
                 $ttype='Domain';                  $ttype='Domain';
                 $twhere=$tdom;                  $twhere=$tdom;
Line 263  ENDHEADER Line 293  ENDHEADER
     unless ($nochoose) {      unless ($nochoose) {
  $r->print("</form>\n");   $r->print("</form>\n");
     }      }
 # ------------------------------------------------------------ Priviledges Info  # ------------------------------------------------------------ Privileges Info
   if ($advanced) {    if ($advanced) {
     $r->print('<hr><h2>Current Priviledges</h2>');      $r->print('<hr><h2>Current Privileges</h2>');
   
     foreach $envkey (sort keys %ENV) {      foreach $envkey (sort keys %ENV) {
         if ($envkey=~/^user\.priv\.$ENV{'request.role'}\./) {          if ($envkey=~/^user\.priv\.$ENV{'request.role'}\./) {
Line 276  ENDHEADER Line 306  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.19  
changed lines
  Added in v.1.25


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>
500 Internal Server Error

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at root@localhost to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.