File:  [LON-CAPA] / loncom / auth / lonroles.pm
Revision 1.119: download - view: text, annotated - select for diffs
Fri Apr 22 20:54:43 2005 UTC (19 years, 2 months ago) by albertel
Branches: MAIN
CVS tags: version_1_99_1_tmcc, HEAD
- nolonger need to clean_env

    1: # The LearningOnline Network with CAPA
    2: # User Roles Screen
    3: #
    4: # $Id: lonroles.pm,v 1.119 2005/04/22 20:54:43 albertel Exp $
    5: #
    6: # Copyright Michigan State University Board of Trustees
    7: #
    8: # This file is part of the LearningOnline Network with CAPA (LON-CAPA).
    9: #
   10: # LON-CAPA is free software; you can redistribute it and/or modify
   11: # it under the terms of the GNU General Public License as published by
   12: # the Free Software Foundation; either version 2 of the License, or
   13: # (at your option) any later version.
   14: #
   15: # LON-CAPA is distributed in the hope that it will be useful,
   16: # but WITHOUT ANY WARRANTY; without even the implied warranty of
   17: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   18: # GNU General Public License for more details.
   19: #
   20: # You should have received a copy of the GNU General Public License
   21: # along with LON-CAPA; if not, write to the Free Software
   22: # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   23: #
   24: # /home/httpd/html/adm/gpl.txt
   25: #
   26: # http://www.lon-capa.org/
   27: #
   28: ###
   29: 
   30: package Apache::lonroles;
   31: 
   32: use strict;
   33: use Apache::lonnet;
   34: use Apache::lonuserstate();
   35: use Apache::Constants qw(:common);
   36: use Apache::File();
   37: use Apache::lonmenu;
   38: use Apache::loncommon;
   39: use Apache::lonhtmlcommon;
   40: use Apache::lonannounce;
   41: use Apache::lonlocal;
   42: 
   43: sub redirect_user {
   44:     my ($r,$title,$url,$msg,$launch_nav) = @_;
   45:     $msg = $title if (! defined($msg));
   46:     &Apache::loncommon::content_type($r,'text/html');
   47:     &Apache::loncommon::no_cache($r);
   48:     $r->send_http_header;
   49:     my $swinfo=&Apache::lonmenu::rawconfig();
   50:     my $navwindow;
   51:     if ($launch_nav eq 'on') {
   52: 	$navwindow.=&Apache::lonnavmaps::launch_win('now');
   53:     } else {
   54: 	$navwindow.=&Apache::lonnavmaps::close();
   55:     }
   56:     my $bodytag=&Apache::loncommon::bodytag('Switching Role');
   57: # Note to style police: 
   58: # This must only replace the spaces, nothing else, or it bombs elsewhere.
   59:     $url=~s/ /\%20/g;
   60:     $r->print(<<ENDREDIR);
   61: <head><title>$title</title>
   62: <meta HTTP-EQUIV="Refresh" CONTENT="1; url=$url">
   63: </head>
   64: <html>
   65: $bodytag
   66: <script type="text/javascript">
   67: $swinfo
   68: </script>
   69: $navwindow
   70: <h1>$msg</h1>
   71: <a href="$url">Continue</a>
   72: </body>
   73: </html>
   74: ENDREDIR
   75:     return;
   76: }
   77: 
   78: sub handler {
   79: 
   80:     my $r = shift;
   81: 
   82:     my $now=time;
   83:     my $then=$env{'user.login.time'};
   84:     my $envkey;
   85:     my %dcroles = ();
   86:     my $numdc = &check_fordc(\%dcroles,$then);
   87: 
   88: # ================================================================== Roles Init
   89:     if ($env{'form.selectrole'}) {
   90: 	if ($env{'request.course.id'}) {
   91: 	    my %temp=('logout_'.$env{'request.course.id'} => time);
   92: 	    &Apache::lonnet::put('email_status',\%temp);
   93: 	    &Apache::lonnet::delenv('user.state.'.$env{'request.course.id'});
   94: 	}
   95: 	&Apache::lonnet::appenv("request.course.id"   => '',
   96: 				"request.course.fn"   => '',
   97: 				"request.course.uri"  => '',
   98: 				"request.course.sec"  => '',
   99: 				"request.role"        => 'cm',
  100:                                 "request.role.adv"    => $env{'user.adv'},
  101: 				"request.role.domain" => $env{'user.domain'});
  102: 
  103: # Check if user is a DC trying to enter a course and needs privs to be created
  104:         if ($numdc > 0) {
  105:             foreach my $envkey (keys %env) {
  106:                 if ($envkey =~ m-^form\.cc\./(\w+)/(\w+)$-) {
  107:                     if ($dcroles{$1}) {
  108:                         my $cckey = 'user.role.cc./'.$1.'/'.$2;
  109:                         &check_privs($cckey,$then,$now);
  110:                     }
  111:                     last;
  112:                 }
  113:             }
  114:         }
  115: 
  116:         foreach $envkey (keys %env) {
  117:             next if ($envkey!~/^user\.role\./);
  118:             my ($where,$trolecode,$role,$tstatus,$tend,$tstart);
  119:             &role_status($envkey,$then,$now,\$role,\$where,\$trolecode,\$tstatus,\$tstart,\$tend);
  120:             if ($env{'form.'.$trolecode}) {
  121: 		if ($tstatus eq 'is') {
  122: 		    $where=~s/^\///;
  123: 		    my ($cdom,$cnum,$csec)=split(/\//,$where);
  124: # store role if recent_role list being kept
  125:                     if ($env{'environment.recentroles'}) {
  126: 			&Apache::lonhtmlcommon::store_recent('roles',
  127: 							     $trolecode,' ');
  128:                     }
  129: 
  130: 
  131: # check for keyed access
  132: 		    if (($role eq 'st') && 
  133:                        ($env{'course.'.$cdom.'_'.$cnum.'.keyaccess'} eq 'yes')) {
  134: # who is key authority?
  135: 			my $authdom=$cdom;
  136: 			my $authnum=$cnum;
  137: 			if ($env{'course.'.$cdom.'_'.$cnum.'.keyauth'}) {
  138: 			    ($authnum,$authdom)=
  139: 				split(/\W/,$env{'course.'.$cdom.'_'.$cnum.'.keyauth'});
  140: 			}
  141: # check with key authority
  142: 			unless (&Apache::lonnet::validate_access_key(
  143: 				     $env{'environment.key.'.$cdom.'_'.$cnum},
  144: 					     $authdom,$authnum)) {
  145: # there is no valid key
  146: 			     if ($env{'form.newkey'}) {
  147: # student attempts to register a new key
  148: 				 &Apache::loncommon::content_type($r,'text/html');
  149: 				 &Apache::loncommon::no_cache($r);
  150: 				 $r->send_http_header;
  151: 				 my $swinfo=&Apache::lonmenu::rawconfig();
  152: 				 my $bodytag=&Apache::loncommon::bodytag
  153: 				    ('Verifying Access Key to Unlock this Course');
  154: 				 my $buttontext=&mt('Enter Course');
  155: 				 my $message=&mt('Successfully registered key');
  156: 				 my $assignresult=
  157: 				     &Apache::lonnet::assign_access_key(
  158: 						     $env{'form.newkey'},
  159: 						     $authdom,$authnum,
  160: 						     $cdom,$cnum,
  161:                                                      $env{'user.domain'},
  162: 						     $env{'user.name'},
  163: 	      'Assigned from '.$ENV{'REMOTE_ADDR'}.' at '.localtime().' for '.
  164:                                                      $trolecode);
  165: 				 unless ($assignresult eq 'ok') {
  166: 				     $assignresult=~s/^error\:\s*//;
  167: 				     $message=&mt($assignresult).
  168: 				     '<br /><a href="/adm/logout">'.
  169: 				     &mt('Logout').'</a>';
  170: 				     $buttontext=&mt('Re-Enter Key');
  171: 				 }
  172: 				 $r->print(<<ENDENTEREDKEY);
  173: <head><title>Verifying Course Access Key</title>
  174: </head>
  175: <html>
  176: $bodytag
  177: <script>
  178: $swinfo
  179: </script>
  180: <form method="post">
  181: <input type="hidden" name="selectrole" value="1" />
  182: <input type="hidden" name="$trolecode" value="1" />
  183: <font size="+2">$message</font><br />
  184: <input type="submit" value="$buttontext" />
  185: </form>
  186: </body></html>
  187: ENDENTEREDKEY
  188:                                  return OK;
  189: 			     } else {
  190: # print form to enter a new key
  191: 				 &Apache::loncommon::content_type($r,'text/html');
  192: 				 &Apache::loncommon::no_cache($r);
  193: 				 $r->send_http_header;
  194: 				 my $swinfo=&Apache::lonmenu::rawconfig();
  195: 				 my $bodytag=&Apache::loncommon::bodytag
  196: 				    ('Enter Access Key to Unlock this Course');
  197: 				 $r->print(<<ENDENTERKEY);
  198: <head><title>Entering Course Access Key</title>
  199: </head>
  200: <html>
  201: $bodytag
  202: <script>
  203: $swinfo
  204: </script>
  205: <form method="post">
  206: <input type="hidden" name="selectrole" value="1" />
  207: <input type="hidden" name="$trolecode" value="1" />
  208: <input type="text" size="20" name="newkey" value="$env{'form.newkey'}" />
  209: <input type="submit" value="Enter key" />
  210: </form>
  211: </body></html>
  212: ENDENTERKEY
  213: 				 return OK;
  214: 			     }
  215: 			 }
  216: 		     }
  217: 		    &Apache::lonnet::log($env{'user.domain'},
  218: 					 $env{'user.name'},
  219: 					 $env{'user.home'},
  220: 					 "Role ".$trolecode);
  221: 		    
  222: 		    &Apache::lonnet::appenv(
  223: 					   'request.role'        => $trolecode,
  224: 					   'request.role.domain' => $cdom,
  225: 					   'request.course.sec'  => $csec);
  226:                     my $tadv=0;
  227: 		    my $msg=&mt('Entering course ...');
  228: 
  229: 		    if (($cnum) && ($role ne 'ca')) {
  230: 			my ($furl,$ferr)=
  231: 			    &Apache::lonuserstate::readmap($cdom.'/'.$cnum);
  232: 			if (($env{'form.orgurl'}) && 
  233: 			    ($env{'form.orgurl'}!~/^\/adm\/flip/)) {
  234: 			    my $dest=$env{'form.orgurl'};
  235: 			    if (&Apache::lonnet::allowed('adv') eq 'F') { $tadv=1; }
  236: 			    &Apache::lonnet::appenv('request.role.adv'=>$tadv);
  237: 			    $r->internal_redirect($dest);
  238: 			    return OK;
  239: 			} else {
  240: 			    unless ($env{'request.course.id'}) {
  241: 				&Apache::lonnet::appenv(
  242: 				      "request.course.id"  => $cdom.'_'.$cnum);
  243: 				$furl='/adm/roles?tryagain=1';
  244: 				$msg=
  245: 				    '<h1><font color=red>'.
  246: 			 &mt('Could not initialize course at this time.').
  247: 		    '</font></h1><h3>'.&mt('Please try again.').'</h3>'.$ferr;
  248: 			    }
  249: 			    if (&Apache::lonnet::allowed('adv') eq 'F') { $tadv=1; }
  250: 			    &Apache::lonnet::appenv('request.role.adv'=>$tadv);
  251: 
  252: 			    # Check to see if the user is a CC entering a course 
  253: 			    # for the first time
  254: 			    my (undef, undef, $role, $courseid) = split(/\./, $envkey);
  255: 			    if (substr($courseid, 0, 1) eq '/') {
  256: 				$courseid = substr($courseid, 1);
  257: 			    }
  258: 			    $courseid =~ s/\//_/;
  259: 			    if ($role eq 'cc' && $env{'course.' . $courseid . 
  260: 							  '.course.helper.not.run'}) {
  261: 				$furl = "/adm/helper/course.initialization.helper";
  262: 			    }
  263:                             # Send the user to the course they selected
  264:                             &redirect_user($r,&mt('Entering Course'),
  265:                                            $furl,$msg,
  266: 					   $env{'environment.remotenavmap'});
  267:                             return OK;
  268: 			}
  269: 		    }
  270:                     #
  271:                     # Send the user to the construction space they selected
  272:                     if ($role =~ /^(au|ca)$/) {
  273:                         my $redirect_url = '/priv/';
  274:                         if ($role eq 'au') {
  275:                             $redirect_url.=$env{'user.name'};
  276:                         } else {
  277:                             $where =~ /\/(.*)$/;
  278:                             $redirect_url .= $1;
  279:                         }
  280:                         $redirect_url .= '/';
  281:                         &redirect_user($r,&mt('Entering Construction Space'),
  282:                                        $redirect_url);
  283:                         return OK;
  284:                     }
  285:                     if ($role eq 'dc') {
  286:                         my $redirect_url = '/adm/menu/';
  287:                         &redirect_user($r,&mt('Loading Domain Coordinator Menu'),
  288:                                        $redirect_url);
  289:                         return OK;
  290:                     }
  291: 		}
  292:             }
  293:         }
  294:     }
  295: 
  296: 
  297: # =============================================================== No Roles Init
  298: 
  299:     &Apache::loncommon::content_type($r,'text/html');
  300:     &Apache::loncommon::no_cache($r);
  301:     $r->send_http_header;
  302:     return OK if $r->header_only;
  303: 
  304:     my $swinfo=&Apache::lonmenu::rawconfig();
  305:     my $bodytag=&Apache::loncommon::bodytag('User Roles');
  306:     my $helptag='<table><tr><td>'.&Apache::loncommon::help_open_menu('','General Intro','General_Intro','User Roles',1,undef,undef,undef,undef,,&mt("Click here for help")).'</td></td></tr></table>';
  307:     $r->print(<<ENDHEADER);
  308: <html>
  309: <head>
  310: <title>LON-CAPA User Roles</title>
  311: </head>
  312: $bodytag
  313: $helptag<br />
  314: <script>
  315: $swinfo
  316: window.focus();
  317: </script>
  318: ENDHEADER
  319: 
  320: # ------------------------------------------ Get Error Message from Environment
  321: 
  322:     my ($fn,$priv,$nochoose,$error,$msg)=split(/:/,$env{'user.error.msg'});
  323:     if ($env{'user.error.msg'}) {
  324: 	$r->log_reason(
  325:    "$msg for $env{'user.name'} domain $env{'user.domain'} access $priv",$fn);
  326:     }
  327: 
  328: # ------------------------------------------------- Can this user re-init, etc?
  329: 
  330:     my $advanced=$env{'user.adv'};
  331:     &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['tryagain']);
  332:     my $tryagain=$env{'form.tryagain'};
  333: 
  334: # -------------------------------------------------------- Generate Page Output
  335: # --------------------------------------------------------------- Error Header?
  336:     if ($error) {
  337: 	$r->print("<h1>LON-CAPA Access Control</h1>");
  338:         $r->print("<hr><pre>Access  : ".
  339:                   Apache::lonnet::plaintext($priv)."\n");
  340:         $r->print("Resource: ".&Apache::lonenc::check_encrypt($fn)."\n");
  341:         $r->print("Action  : $msg\n</pre><hr>");
  342:     } else {
  343:         if ($env{'user.error.msg'}) {
  344: 	    $r->print(
  345:  '<h3><font color=red>'.
  346:  &mt('You need to choose another user role or enter a specific course for this function').'</font></h3>');
  347: 	}
  348:     }
  349: # -------------------------------------------------------- Choice or no choice?
  350:     if ($nochoose) {
  351:         if ($advanced) {
  352: 	    $r->print("<h2>".&mt('Assigned User Roles')."</h2>\n");
  353:         } else {
  354: 	    $r->print("<h2>".&mt('Sorry ...')."</h2>\n".
  355: 		      &mt('This resource might be part of'));
  356: 	    if ($env{'request.course.id'}) {
  357: 		$r->print(&mt(' another'));
  358: 	    } else {
  359: 		$r->print(&mt(' a certain'));
  360: 	    } 
  361: 	    $r->print(&mt(' course.').'</body></html>');
  362: 	    return OK;
  363:         } 
  364:     } else {
  365:         if ($advanced) {
  366: 	    $r->print(&mt("Your home server is ").
  367: 		      $Apache::lonnet::hostname{&Apache::lonnet::homeserver
  368:                       ($env{'user.name'},$env{'user.domain'})}.
  369: 		      "<br />\n");
  370: 	    $r->print(&mt(
  371:       "Author and Co-Author roles may not be available on servers other than your home server."));
  372:         }
  373:         if (($ENV{'REDIRECT_QUERY_STRING'}) && ($fn)) {
  374:     	    $fn.='?'.$ENV{'REDIRECT_QUERY_STRING'};
  375:         }
  376:         $r->print('<form method="post" name="rolechoice" action="'.(($fn)?$fn:$r->uri).'">');
  377:         $r->print('<input type="hidden" name="orgurl" value="'.$fn.'" />');
  378:         $r->print('<input type="hidden" name="selectrole" value="1" />');
  379:     }
  380:     if ($env{'user.adv'}) {
  381: 	$r->print(
  382: 	      '<br /><label>'.&mt('Show all roles').': <input type="checkbox" name="showall"');
  383: 	if ($env{'form.showall'}) { $r->print(' checked="checked" '); }
  384: 	$r->print(' /></label><input type="submit" value="'.&mt('Display').'" />');
  385:     }
  386: 
  387:     my (%roletext,%sortrole,%roleclass);
  388:     my $countactive=0;
  389:     my $inrole=0;
  390:     my $possiblerole='';
  391:     foreach $envkey (sort keys %env) {
  392:         my $button = 1;
  393:         my $switchserver='';
  394: 	my $roletext;
  395: 	my $sortkey;
  396:         if ($envkey=~/^user\.role\./) {
  397:             my ($role,$where,$trolecode,$tstart,$tend,$tremark,$tstatus,$tpstart,$tpend,$tfont);
  398:             &role_status($envkey,$then,$now,\$role,\$where,\$trolecode,\$tstatus,\$tstart,\$tend);
  399:             next if (!defined($role) || $role eq '');
  400:             $tremark='';
  401:             $tpstart='&nbsp;';
  402:             $tpend='&nbsp;';
  403:             $tfont='#000000';
  404:             if ($tstart) {
  405:                 $tpstart=&Apache::lonlocal::locallocaltime($tstart);
  406:             }
  407:             if ($tend) {
  408:                 $tpend=&Apache::lonlocal::locallocaltime($tend);
  409:             }
  410:             if ($env{'request.role'} eq $trolecode) {
  411: 		$tstatus='selected';
  412:             }
  413:             my $tbg;
  414:             if (($tstatus eq 'is') || ($tstatus eq 'selected') ||
  415:                 ($env{'form.showall'})) {
  416:                 if ($tstatus eq 'is') {
  417:                     $tbg='#77FF77';
  418:                     $tfont='#003300';
  419: 		    $possiblerole=$trolecode;
  420: 		    $countactive++;
  421:                 } elsif ($tstatus eq 'future') {
  422:                     $tbg='#FFFF77';
  423:                     $button=0;
  424:                 } elsif ($tstatus eq 'will') {
  425:                     $tbg='#FFAA77';
  426:                     $tremark.=&mt('Active at next login. ');
  427:                 } elsif ($tstatus eq 'expired') {
  428:                     $tbg='#FF7777';
  429:                     $tfont='#330000';
  430:                     $button=0;
  431:                 } elsif ($tstatus eq 'will_not') {
  432:                     $tbg='#AAFF77';
  433:                     $tremark.=&mt('Expired after logout. ');
  434:                 } elsif ($tstatus eq 'selected') {
  435:                     $tbg='#11CC55';
  436:                     $tfont='#002200';
  437: 		    $inrole=1;
  438: 		    $countactive++;
  439:                     $tremark.=&mt('Currently selected. ');
  440:                 }
  441:                 my $trole;
  442:                 if ($role =~ /^cr\//) {
  443:                     my ($rdummy,$rdomain,$rauthor,$rrole)=split(/\//,$role);
  444:                     $tremark.='<br>'.&mt('Defined by ').$rauthor.
  445: 			&mt(' at ').$rdomain.'.';
  446:                     $trole=$rrole;
  447:                 } else {
  448:                     $trole=Apache::lonnet::plaintext($role);
  449:                 }
  450:                 my $ttype;
  451:                 my $twhere;
  452:                 my ($tdom,$trest,$tsection)=
  453:                     split(/\//,Apache::lonnet::declutter($where));
  454:                 # First, Co-Authorship roles
  455:                 if ($role eq 'ca') {
  456:                     my $home = &Apache::lonnet::homeserver($trest,$tdom);
  457: 		    my $allowed=0;
  458: 		    my @ids=&Apache::lonnet::current_machine_ids();
  459: 		    foreach my $id (@ids) { if ($id eq $home) { $allowed=1; } }
  460:                     if (!$allowed) {
  461: 			$button=0;
  462:                         $switchserver=&Apache::lonnet::escape('http://'.
  463:                          $Apache::lonnet::hostname{$home}.
  464:                          '/adm/login?domain='.$env{'user.domain'}.
  465: 			  '&username='.$env{'user.name'}.
  466:                           '&firsturl=/priv/'.$trest.'/');
  467:                     }
  468:                     #next if ($home eq 'no_host');
  469:                     $home = $Apache::lonnet::hostname{$home};
  470:                     $ttype='Construction Space';
  471:                     $twhere=&mt('User').': '.$trest.'<br />'.&mt('Domain').
  472: 			': '.$tdom.'<br />'.
  473:                         ' '.&mt('Server').':&nbsp;'.$home;
  474:                     $env{'course.'.$tdom.'_'.$trest.'.description'}='ca';
  475: 		    $tremark.=&Apache::lonhtmlcommon::authorbombs('/res/'.$tdom.'/'.$trest.'/');
  476: 		    $sortkey=$role."$trest:$tdom";
  477:                 } elsif ($role eq 'au') {
  478:                     # Authors
  479:                     my $home = &Apache::lonnet::homeserver
  480:                         ($env{'user.name'},$env{'user.domain'});
  481: 		    my $allowed=0;
  482: 		    my @ids=&Apache::lonnet::current_machine_ids();
  483: 		    foreach my $id (@ids) { if ($id eq $home) { $allowed=1; } }
  484:                     if (!$allowed) {
  485: 			$button=0;
  486:                         $switchserver=&Apache::lonnet::escape('http://'.
  487:                          $Apache::lonnet::hostname{$home}.
  488:                           '/adm/login?domain='.$env{'user.domain'}.
  489: 			   '&username='.$env{'user.name'}.
  490:                            '&firsturl=/priv/'.$env{'user.name'}.'/');
  491:                     }
  492:                     #next if ($home eq 'no_host');
  493:                     $home = $Apache::lonnet::hostname{$home};
  494:                     $ttype='Construction Space';
  495:                     $twhere=&mt('Domain').': '.$tdom.'<br />'.&mt('Server').
  496: 			':&nbsp;'.$home;
  497:                     $env{'course.'.$tdom.'_'.$trest.'.description'}='ca';
  498: 		    $tremark.=&Apache::lonhtmlcommon::authorbombs('/res/'.$tdom.'/'.$env{'user.name'}.'/');
  499: 		    $sortkey=$role;
  500:                 } elsif ($trest) {
  501:                     $ttype='Course';
  502:                     if ($tsection) {
  503:                         $ttype.='<br>'.&mt('Section/Group').': '.$tsection;
  504: 		    }
  505:                     my $tcourseid=$tdom.'_'.$trest;
  506:                     if ($env{'course.'.$tcourseid.'.description'}) {
  507:                         $twhere=$env{'course.'.$tcourseid.'.description'};
  508: 			$sortkey=$role."\0".$tdom."\0".$twhere."\0".$envkey;
  509:                         unless ($twhere eq &mt('Currently not available')) {
  510: 			    $twhere.=' <font size="-2">'.
  511:         &Apache::loncommon::syllabuswrapper(&mt('Syllabus'),$trest,$tdom,$tfont).
  512:                                     '</font>';
  513: 			}
  514:                     } else {
  515:                         my %newhash=&Apache::lonnet::coursedescription($tcourseid);
  516:                         if (%newhash) {
  517: 			    $sortkey=$role."\0".$tdom."\0".$newhash{'description'}.
  518: 				"\0".$envkey;
  519:                             $twhere=$newhash{'description'}.
  520:                               ' <font size="-2">'.
  521:         &Apache::loncommon::syllabuswrapper(&mt('Syllabus'),$trest,$tdom,$tfont).
  522:                               '</font>';
  523:                         } else {
  524:                             $twhere=&mt('Currently not available');
  525:                             $env{'course.'.$tcourseid.'.description'}=$twhere;
  526: 			    $sortkey=$role."\0".$tdom."\0".$twhere."\0".$envkey;
  527:                         }
  528:                     }
  529: 		    if ($role ne 'st') { $twhere.="<br />".&mt('Domain').":".$tdom; }
  530:                 } elsif ($tdom) {
  531:                     $ttype='Domain';
  532:                     $twhere=$tdom;
  533: 		    $sortkey=$role.$twhere;
  534:                 } else {
  535:                     $ttype='System';
  536:                     $twhere=&mt('system wide');
  537: 		    $sortkey=$role.$twhere;
  538:                 }
  539:  
  540:                 $roletext.=&build_roletext($trolecode,$tdom,$trest,$tstatus,$tryagain,$advanced,$tremark,$tbg,$tfont,$trole,$ttype,$twhere,$tpstart,$tpend,$nochoose,$button,$switchserver);
  541: 		$roletext{$envkey}=$roletext;
  542: 		if (!$sortkey) {$sortkey=$twhere."\0".$envkey;}
  543: 		$sortrole{$sortkey}=$envkey;
  544: 		$roleclass{$envkey}=$ttype;
  545: 	    }
  546:         }
  547:     }
  548: # No active roles
  549:     if ($countactive==0) {
  550: 	if ($inrole) {
  551: 	    $r->print('<h2>'.&mt('Currently no additional roles or courses').'</h2>');
  552: 	} else {
  553: 	    $r->print('<h2>'.&mt('Currently no active roles or courses').'</h2>');
  554: 	}
  555: 	$r->print('</form></body></html>');
  556: 	return OK;
  557: # Is there only one choice?
  558:     } elsif (($countactive==1) && ($env{'request.role'} eq 'cm')) {
  559: 	$r->print('<h3>'.&mt('Please stand by.').'</h3>'.
  560: 	    '<input type="hidden" name="'.$possiblerole.'" value="1" />');
  561: 	$r->print("</form>\n");
  562: 	$r->rflush();
  563: 	$r->print('<script>document.forms.rolechoice.submit();</script>');
  564: 	$r->print('</body></html>');
  565: 	return OK;
  566:     }
  567: # More than one possible role
  568: # ----------------------------------------------------------------------- Table
  569:     unless (($advanced) || ($nochoose)) {
  570: 	$r->print("<h2>".&mt('Select a Course to Enter')."</h2>\n");
  571:     }
  572:     $r->print('<br /><table><tr>');
  573:     unless ($nochoose) { $r->print('<th>&nbsp;</th>'); }
  574:     $r->print('<th>'.&mt('User Role').'</th><th colspan=2>'.&mt('Extent').
  575:          '</th><th>'.&mt('Start').'</th><th>'.&mt('End').'</th><th>'.
  576: 	      &mt('Remarks and Calendar Announcements').'</th></tr>'."\n");
  577:     my $doheaders=-1;
  578:     foreach my $type ('Construction Space','Course','Domain','System') {
  579: 	my $haverole=0;
  580: 	foreach my $which (sort {uc($a) cmp uc($b)} (keys(%sortrole))) {
  581: 	    if ($roleclass{$sortrole{$which}} =~ /^\Q$type\E/) { 
  582: 		$haverole=1;
  583: 	    }
  584: 	}
  585: 	if ($haverole) { $doheaders++; }
  586:     }
  587: 
  588:     if ($env{'environment.recentroles'}) {
  589:         my %recent_roles =
  590:                &Apache::lonhtmlcommon::get_recent('roles',$env{'environment.recentrolesn'});
  591: 	my $output='';
  592: 	foreach (sort(keys(%recent_roles))) {
  593: 	    if (defined($roletext{'user.role.'.$_})) {
  594: 		$output.=$roletext{'user.role.'.$_};
  595: 	    } elsif ($numdc > 0) {
  596:                 unless ($_ =~/^error\:/) {
  597:                     $output.=&display_cc_role('user.role.'.$_);
  598:                 }
  599:             } 
  600: 	}
  601: 	if ($output) {
  602: 	    $r->print("<tr bgcolor='#BBffBB'><td align='center' colspan='7'>".
  603: 		      &mt('Recent Roles')."</td>");
  604: 	    $r->print($output);
  605: 	    $r->print("</tr>");
  606:             $doheaders ++;
  607: 	}
  608:     }
  609: 
  610:     if ($numdc > 0) {
  611:         $r->print(&coursepick_jscript());
  612:         $r->print(&Apache::loncommon::coursebrowser_javascript());
  613:     }
  614:     foreach my $type ('Construction Space','Course','Domain','System') {
  615: 	my $output;
  616: 	foreach my $which (sort {uc($a) cmp uc($b)} (keys(%sortrole))) {
  617: 	    if ($roleclass{$sortrole{$which}} =~ /^\Q$type\E/) { 
  618: 		$output.=$roletext{$sortrole{$which}};
  619:                 if ($sortrole{$which} =~ m-dc\./(\w+)/-) {
  620:                     if ($dcroles{$1}) {
  621:                         $output .= &allcourses_row($1);
  622:                     }
  623:                 }
  624: 	    }
  625: 	}
  626: 	if ($output) {
  627: 	    if ($doheaders > 0) {
  628: 		$r->print("<tr bgcolor='#BBffBB'>".
  629: 			  "<td align='center' colspan='7'>".&mt($type)."</td></tr>");
  630: 	    }
  631: 	    $r->print($output);	
  632: 	}
  633:     }
  634:     my $tremark='';
  635:     my $tfont='#003300';
  636:     if ($env{'request.role'} eq 'cm') {
  637: 	$r->print('<tr bgcolor="#11CC55">');
  638:         $tremark=&mt('Currently selected. ');
  639:         $tfont='#002200';
  640:     } else {
  641:         $r->print('<tr bgcolor="#77FF77">');
  642:     }
  643:     unless ($nochoose) {
  644: 	if ($env{'request.role'} ne 'cm') {
  645: 	    $r->print('<td><input type=submit value="'.
  646: 		      &mt('Select').'" name="cm"></td>');
  647: 	} else {
  648: 	    $r->print('<td>&nbsp;</td>');
  649: 	}
  650:     }
  651:     $r->print('<td colspan=5><font color="'.$tfont.'">'.&mt('No role specified').
  652:       '</font></td><td><font color="'.$tfont.'">'.$tremark.
  653:       '&nbsp;</font></td></tr>'."\n");
  654: 
  655:     $r->print('</table>');
  656:     unless ($nochoose) {
  657: 	$r->print("</form>\n");
  658:     }
  659: # ------------------------------------------------------------ Privileges Info
  660:     if (($advanced) && (($env{'user.error.msg'}) || ($error))) {
  661: 	$r->print('<hr><h2>Current Privileges</h2>');
  662: 
  663: 	foreach $envkey (sort keys %env) {
  664: 	    if ($envkey=~/^user\.priv\.$env{'request.role'}\./) {
  665: 		my $where=$envkey;
  666: 		$where=~s/^user\.priv\.$env{'request.role'}\.//;
  667: 		my $ttype;
  668: 		my $twhere;
  669: 		my ($tdom,$trest,$tsec)=
  670: 		    split(/\//,Apache::lonnet::declutter($where));
  671: 		if ($trest) {
  672: 		    if ($env{'course.'.$tdom.'_'.$trest.'.description'} eq 'ca') {
  673: 			$ttype='Construction Space';
  674: 			$twhere='User: '.$trest.', Domain: '.$tdom;
  675: 		    } else {
  676: 			$ttype='Course';
  677: 			$twhere=$env{'course.'.$tdom.'_'.$trest.'.description'};
  678: 			if ($tsec) {
  679: 			    $twhere.=' (Section/Group: '.$tsec.')';
  680: 			}
  681: 		    }
  682: 		} elsif ($tdom) {
  683: 		    $ttype='Domain';
  684: 		    $twhere=$tdom;
  685: 		} else {
  686: 		    $ttype='System';
  687: 		    $twhere='/';
  688: 		}
  689: 		$r->print("\n<h3>".$ttype.': '.$twhere.'</h3><ul>');
  690: 		foreach (sort split(/:/,$env{$envkey})) {
  691: 		    if ($_) {
  692: 			my ($prv,$restr)=split(/\&/,$_);
  693: 			my $trestr='';
  694: 			if ($restr ne 'F') {
  695: 			    my $i;
  696: 			    $trestr.=' (';
  697: 			    for ($i=0;$i<length($restr);$i++) {
  698: 				$trestr.=
  699: 			       Apache::lonnet::plaintext(substr($restr,$i,1));
  700: 				if ($i<length($restr)-1) { $trestr.=', '; }
  701: 			    }
  702: 			    $trestr.=')';
  703: 			}
  704: 			$r->print('<li>'.
  705: 				  Apache::lonnet::plaintext($prv).$trestr.
  706: 				  '</li>');
  707: 		    }
  708: 		}
  709: 		$r->print('</ul>');
  710: 	    }
  711: 	}
  712:     }
  713:     $r->print(&Apache::lonnet::getannounce());
  714:     if ($advanced) {
  715: 	$r->print('<p><small><i>This is LON-CAPA '.
  716: 		  $r->dir_config('lonVersion').'</i><br />'.
  717: 		  '<a href="/adm/logout">'.&mt('Logout').'</a></small></p>');
  718:     }
  719:     $r->print("</body></html>\n");
  720:     return OK;
  721: }
  722: 
  723: sub role_status {
  724:     my ($rolekey,$then,$now,$role,$where,$trolecode,$tstatus,$tstart,$tend) = @_;
  725:     my @pwhere = ();
  726:     if (exists($env{$rolekey}) && $env{$rolekey} ne '') {
  727:         (undef,undef,$$role,@pwhere)=split(/\./,$rolekey);
  728:         unless (!defined($$role) || $$role eq '') {
  729:             $$where=join('.',@pwhere);
  730:             $$trolecode=$$role.'.'.$$where;
  731:             ($$tstart,$$tend)=split(/\./,$env{$rolekey});
  732:             $$tstatus='is';
  733:             if ($$tstart && $$tstart>$then) {
  734: 		$$tstatus='future';
  735: 		if ($$tstart<$now) { $$tstatus='will'; }
  736:             }
  737:             if ($$tend) {
  738:                 if ($$tend<$then) {
  739:                     $$tstatus='expired';
  740:                 } elsif ($$tend<$now) {
  741:                     $$tstatus='will_not';
  742:                 }
  743:             }
  744:         }
  745:     }
  746: }
  747: 
  748: sub build_roletext {
  749:     my ($trolecode,$tdom,$trest,$tstatus,$tryagain,$advanced,$tremark,$tbg,$tfont,$trole,$ttype,$twhere,$tpstart,$tpend,$nochoose,$button,$switchserver) = @_;
  750:     my $roletext='<tr bgcolor="'.$tbg.'">';
  751:     unless ($nochoose) {
  752:         if (!$button) {
  753:             if ($switchserver) {
  754:                 $roletext.='<td><a href="/adm/logout?handover='.
  755:                 $switchserver.'">'.&mt('Switch Server').'</a></td>';
  756:             } else {
  757:                 $roletext.=('<td>&nbsp;</td>');
  758:             }
  759:         } elsif ($tstatus eq 'is') {
  760:             $roletext.=('<td><input type=submit value="'.
  761:                         &mt('Select').'" name="'.
  762:                         $trolecode.'"></td>');
  763:         } elsif ($tryagain) {
  764:             $roletext.=
  765:                 '<td><input type=submit value="'.
  766:                 &mt('Try Selecting Again').'" name="'.$trolecode.'"></td>';
  767:         } elsif ($advanced) {
  768:             $roletext.=
  769:                 '<td><input type=submit value="'.
  770:                 &mt('Re-Initialize').'" name="'.$trolecode.'"></td>';
  771:         } else {
  772:             $roletext.='<td>&nbsp;</td>';
  773:         }
  774:     }
  775:     $tremark.=&Apache::lonannounce::showday(time,1,
  776:                  &Apache::lonannounce::readcalendar($tdom.'_'.$trest));
  777: 
  778: 
  779:     $roletext.='<td><font color="'.$tfont.'">'.$trole.
  780:                '</font></td><td><font color="'.$tfont.'">'.$ttype.
  781:                '</font></td><td><font color="'.$tfont.'">'.$twhere.
  782:                '</font></td><td><font color="'.$tfont.'">'.$tpstart.
  783:                '</font></td><td><font color="'.$tfont.'">'.$tpend.
  784:                '</font></td><td><font color="'.$tfont.'">'.$tremark.
  785:                '&nbsp;</font></td></tr>'."\n";
  786:     return $roletext;
  787: }
  788: 
  789: sub check_privs {
  790:     my ($cckey,$then,$now) = @_;
  791:     if ($env{$cckey}) {
  792:         my ($role,$where,$trolecode,$tstart,$tend,$tremark,$tstatus,$tpstart,$tpend,$tfont);
  793:         &role_status($cckey,$then,$now,\$role,\$where,\$trolecode,\$tstatus,\$tstart,\$tend);
  794:         unless (($tstatus eq 'is') || ($tstatus eq 'will_not')) {
  795:             &set_privileges($1,$2);
  796:         }
  797:     } else {
  798:         &set_privileges($1,$2);
  799:     }
  800: }
  801: 
  802: sub check_fordc {
  803:     my ($dcroles,$then) = @_;
  804:     my $numdc = 0;
  805:     if ($env{'user.adv'}) {
  806:         foreach my $envkey (sort keys %env) {
  807:             if ($envkey=~/^user\.role\.dc\.\/(\w+)\/$/) {
  808:                 my $dcdom = $1;
  809:                 my $livedc = 1;
  810:                 my ($tstart,$tend)=split(/\./,$env{$envkey});
  811:                 if ($tstart && $tstart>$then) { $livedc = 0; }
  812:                 if ($tend   && $tend  <$then) { $livedc = 0; }
  813:                 if ($livedc) {
  814:                     $$dcroles{$dcdom} = $envkey;
  815:                     $numdc++;
  816:                 }
  817:             }
  818:         }
  819:     }
  820:     return $numdc;
  821: }
  822: 
  823: sub courselink {
  824:     my ($dcdom) = @_;
  825:     my $courseform=&Apache::loncommon::selectcourse_link
  826:                      ('rolechoice','dccourse_'.$dcdom,'dcdomain_'.$dcdom,'coursedesc_'.$dcdom,$dcdom);
  827:     my $hiddenitems = '<input type="hidden" name="dcdomain_'.$dcdom.'" value="'.$dcdom.'" />'.
  828:                       '<input type="hidden" name="origdom_'.$dcdom.'" value="'.$dcdom.'" />'.
  829:                       '<input type="hidden" name="dccourse_'.$dcdom.'" value="" />'.
  830:                       '<input type="hidden" name="coursedesc_'.$dcdom.'" value="" />';
  831:     return $courseform.$hiddenitems;
  832: }
  833: 
  834: sub coursepick_jscript {
  835:     my $verify_script = <<"END";
  836: <script>
  837: function verifyCoursePick(caller) {
  838:     var numbutton = getIndex(caller)
  839:     var pickedCourse = document.rolechoice.elements[numbutton+4].value
  840:     var pickedDomain = document.rolechoice.elements[numbutton+2].value
  841:     if (document.rolechoice.elements[numbutton+2].value == document.rolechoice.elements[numbutton+3].value) {
  842:         if (pickedCourse != '') {
  843:             if (numbutton != -1) {
  844:                 var courseTarget = "cc./"+pickedDomain+"/"+pickedCourse
  845:                 document.rolechoice.elements[numbutton+1].name = courseTarget
  846:                 document.rolechoice.submit()
  847:             }
  848:         }
  849:         else {
  850:             alert("Please use the 'Select Course' link to open a separate pick course window where you may select the course you wish to enter.");
  851:         }
  852:     }
  853:     else {
  854:         alert("You can only use this screen to select courses in the current domain")
  855:     }
  856: }
  857: function getIndex(caller) {
  858:     for (var i=0;i<document.rolechoice.elements.length;i++) {
  859:         if (document.rolechoice.elements[i] == caller) {
  860:             return i;
  861:         }
  862:     }
  863:     return -1;
  864: }
  865: </script>
  866: END
  867:     return $verify_script;
  868: }
  869: 
  870: sub processpick {
  871:     my $dcdom = shift;
  872:     my $process_pick = <<"END";
  873: <script>
  874: function process_pick(dom) {
  875:     var numbutton = getIndex(dom)
  876:     var pickedCourse = opener.document.rolechoice.dccourse_$dcdom.value
  877:     var pickedDomain = opener.document.rolechoice.dcdomain_$dcdom.value
  878:     if (opener.document.rolechoice.dcdomain_$dcdom.value == opener.document.rolechoice.origdom_$dcdom.value) {
  879:         if (pickedCourse != '') {
  880:             if (numbutton != -1) {
  881:                 var courseTarget = "cc./"+pickedDomain+"/"+pickedCourse
  882:                 opener.document.rolechoice.elements[numbutton+1].name = courseTarget
  883:                 opener.document.rolechoice.submit()
  884:             }
  885:         }
  886:     }
  887: }
  888:  
  889: function getIndex(dom) {
  890:     var callername = 'ccpick_'+dom
  891:     for (var i=0;i<opener.document.rolechoice.elements.length;i++) {
  892:         var elemname = opener.document.rolechoice.elements[i].name
  893:         if (elemname == callername) {
  894:             return i;
  895:         }
  896:     }
  897:     return -1;
  898: }
  899: </script>
  900: END
  901:     return $process_pick;
  902: }
  903: 
  904: sub display_cc_role {
  905:     my $rolekey = shift;
  906:     my $roletext;
  907:     my $advanced = $env{'user.adv'};
  908:     my $tryagain = $env{'form.tryagain'};
  909:     unless ($rolekey =~/^error\:/) {
  910:         if ($rolekey =~ m-^user\.role.cc\./(\w+)/(\w+)$-) {
  911:             my $tcourseid = $1.'_'.$2;
  912:             my $trolecode = 'cc./'.$1.'/'.$2;
  913:             my $trole = Apache::lonnet::plaintext('cc');
  914:             my $twhere;
  915:             my $tbg='#77FF77';
  916:             my $tfont='#003300';
  917:             my %newhash=&Apache::lonnet::coursedescription($tcourseid);
  918:             if (%newhash) {
  919:                 $twhere=$newhash{'description'}.
  920:                         ' <font size="-2">'.
  921:                         &Apache::loncommon::syllabuswrapper(&mt('Syllabus'),$2,$1,$tfont).
  922:                         '</font>';
  923:             } else {
  924:                 $twhere=&mt('Currently not available');
  925:                 $env{'course.'.$tcourseid.'.description'}=$twhere;
  926:             }
  927:             $twhere.="<br />".&mt('Domain').":".$1;
  928:             $roletext = &build_roletext($trolecode,$1,$2,'is',$tryagain,$advanced,'',$tbg,$tfont,$trole,&mt('Course'),$twhere,'','','',1,'');
  929:         }
  930:     }
  931:     return $roletext;
  932: }
  933: 
  934: sub allcourses_row {
  935:     my $dcdom = shift;
  936:     my $ccrole = Apache::lonnet::plaintext('cc');
  937:     my $selectlink = &courselink($dcdom);
  938:     my $output = '<tr bgcolor="#77FF77">'.
  939:               '<td><input type="button" value="'.
  940:               &mt('Select').'" name="ccpick_'.$dcdom.'"'.
  941:               'onClick="verifyCoursePick(this)">'.
  942:               '<input type="hidden" name="pick_'.$dcdom.'" value="1"></td>'.
  943:               '<td><font color="#002200">'.
  944:               $ccrole.'</font></td><td>'.&mt('Course').'</td>'.
  945:               '<td><font color="#002200">'.&mt('All courses').':<b>&nbsp;'.
  946:               $selectlink.'</b>'.
  947:               '<br />'.&mt('Domain').':'.$dcdom.'</font>'.
  948:               '<td colspan="4"><font color="#002200">'.
  949:               &mt('Course Coordinator access to all courses in domain').
  950:               ': <b>'.$dcdom.'</b></font></td></tr>'."\n";
  951:     return $output;
  952: }
  953: 
  954: sub recent_filename {
  955:     my $area=shift;
  956:     return 'nohist_recent_'.&Apache::lonnet::escape($area);
  957: }
  958: 
  959: sub set_privileges {
  960:     my ($dcdom,$pickedcourse) = @_;
  961:     my $area = '/'.$dcdom.'/'.$pickedcourse;
  962:     my $role = 'cc';
  963:     my $spec = $role.'.'.$area;
  964:     my $userroles = &Apache::lonnet::set_arearole($role,$area,'','',$dcdom,$env{'user.name'});
  965:     my %ccrole = ();
  966:     &Apache::lonnet::standard_roleprivs(\%ccrole,$role,$dcdom,$spec,$pickedcourse,$area);
  967:     my ($author,$adv)= &Apache::lonnet::set_userprivs(\$userroles,\%ccrole);
  968:     my @newprivs = split/\n/,$userroles;
  969:     my %newccroles = ();
  970:     foreach (@newprivs) {
  971:         my ($key,$val) = split/=/,$_;
  972:         $newccroles{$key} = $val;
  973:     }
  974:     &Apache::lonnet::appenv(%newccroles);
  975:     &Apache::lonnet::log($env{'user.domain'},
  976:                          $env{'user.name'},
  977:                          $env{'user.home'},
  978:                         "Role ".$role);
  979:     &Apache::lonnet::appenv(
  980:                           'request.role'        => $role,
  981:                           'request.role.domain' => $dcdom,
  982:                           'request.course.sec'  => '');
  983:     my $tadv=0;
  984:     if (&Apache::lonnet::allowed('adv') eq 'F') { $tadv=1; }
  985:     &Apache::lonnet::appenv('request.role.adv'    => $tadv);
  986: }
  987: 
  988: 1;
  989: __END__
  990: 
  991: =head1 NAME
  992: 
  993: Apache::lonroles - User Roles Screen
  994: 
  995: =head1 SYNOPSIS
  996: 
  997: Invoked by /etc/httpd/conf/srm.conf:
  998: 
  999:  <Location /adm/roles>
 1000:  PerlAccessHandler       Apache::lonacc
 1001:  SetHandler perl-script
 1002:  PerlHandler Apache::lonroles
 1003:  ErrorDocument     403 /adm/login
 1004:  ErrorDocument	  500 /adm/errorhandler
 1005:  </Location>
 1006: 
 1007: =head1 OVERVIEW
 1008: 
 1009: =head2 Choosing Roles
 1010: 
 1011: C<lonroles> is a handler that allows a user to switch roles in
 1012: mid-session. LON-CAPA attempts to work with "No Role Specified", the
 1013: default role that a user has before selecting a role, as widely as
 1014: possible, but certain handlers for example need specification which
 1015: course they should act on, etc. Both in this scenario, and when the
 1016: handler determines via C<lonnet>'s C<&allowed> function that a certain
 1017: action is not allowed, C<lonroles> is used as error handler. This
 1018: allows the user to select another role which may have permission to do
 1019: what they were trying to do. C<lonroles> can also be accessed via the
 1020: B<CRS> button in the Remote Control. 
 1021: 
 1022: =begin latex
 1023: 
 1024: \begin{figure}
 1025: \begin{center}
 1026: \includegraphics[width=0.45\paperwidth,keepaspectratio]{Sample_Roles_Screen}
 1027:   \caption{\label{Sample_Roles_Screen}Sample Roles Screen} 
 1028: \end{center}
 1029: \end{figure}
 1030: 
 1031: =end latex
 1032: 
 1033: =head2 Role Initialization
 1034: 
 1035: The privileges for a user are established at login time and stored in the session environment. As a consequence, a new role does not become active till the next login. Handlers are able to query for privileges using C<lonnet>'s C<&allowed> function. When a user first logs in, their role is the "common" role, which means that they have the sum of all of their privileges. During a session it might become necessary to choose a particular role, which as a consequence also limits the user to only the privileges in that particular role.
 1036: 
 1037: =head1 INTRODUCTION
 1038: 
 1039: This module enables a user to select what role he wishes to
 1040: operate under (instructor, student, teaching assistant, course
 1041: coordinator, etc).  These roles are pre-established by the actions
 1042: of upper-level users.
 1043: 
 1044: This is part of the LearningOnline Network with CAPA project
 1045: described at http://www.lon-capa.org.
 1046: 
 1047: =head1 HANDLER SUBROUTINE
 1048: 
 1049: This routine is called by Apache and mod_perl.
 1050: 
 1051: =over 4
 1052: 
 1053: =item *
 1054: 
 1055: Roles Initialization (yes/no)
 1056: 
 1057: =item *
 1058: 
 1059: Get Error Message from Environment
 1060: 
 1061: =item *
 1062: 
 1063: Who is this?
 1064: 
 1065: =item *
 1066: 
 1067: Generate Page Output
 1068: 
 1069: =item *
 1070: 
 1071: Choice or no choice
 1072: 
 1073: =item *
 1074: 
 1075: Table
 1076: 
 1077: =item *
 1078: 
 1079: Privileges
 1080: 
 1081: =back
 1082: 
 1083: =cut

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