Diff for /loncom/auth/lonroles.pm between versions 1.170 and 1.181.2.1

version 1.170, 2006/11/23 01:49:41 version 1.181.2.1, 2008/03/22 03:40:58
Line 126  sub handler { Line 126  sub handler {
         if ($numdc > 0) {          if ($numdc > 0) {
             foreach my $envkey (keys %env) {              foreach my $envkey (keys %env) {
                 if (my ($domain,$coursenum) =                  if (my ($domain,$coursenum) =
     ($envkey =~ m-^form\.cc\./($match_domain)/($match_username)$-)) {      ($envkey =~ m-^form\.cc\./($match_domain)/($match_courseid)$-)) {
                     if ($dcroles{$domain}) {                      if ($dcroles{$domain}) {
                         &check_privs($domain,$coursenum,$then,$now);                          &check_privs($domain,$coursenum,$then,$now);
                     }                      }
Line 165  sub handler { Line 165  sub handler {
  my $authnum=$cnum;   my $authnum=$cnum;
  if ($env{'course.'.$cdom.'_'.$cnum.'.keyauth'}) {   if ($env{'course.'.$cdom.'_'.$cnum.'.keyauth'}) {
     ($authnum,$authdom)=      ($authnum,$authdom)=
  split(/\W/,$env{'course.'.$cdom.'_'.$cnum.'.keyauth'});   split(/:/,$env{'course.'.$cdom.'_'.$cnum.'.keyauth'});
  }   }
 # check with key authority  # check with key authority
  unless (&Apache::lonnet::validate_access_key(   unless (&Apache::lonnet::validate_access_key(
Line 201  sub handler { Line 201  sub handler {
  }   }
  $r->print(<<ENDENTEREDKEY);   $r->print(<<ENDENTEREDKEY);
 $start_page  $start_page
 <script>  <script type="text/javascript">
 $swinfo  $swinfo
 </script>  </script>
 <form method="post">  <form method="post">
Line 224  ENDENTEREDKEY Line 224  ENDENTEREDKEY
  my $end_page=&Apache::loncommon::end_page();   my $end_page=&Apache::loncommon::end_page();
  $r->print(<<ENDENTERKEY);   $r->print(<<ENDENTERKEY);
 $start_page  $start_page
 <script>  <script type="text/javascript">
 $swinfo  $swinfo
 </script>  </script>
 <form method="post">  <form method="post">
Line 365  ENDENTERKEY Line 365  ENDENTERKEY
     my $start_page=&Apache::loncommon::start_page('User Roles');      my $start_page=&Apache::loncommon::start_page('User Roles');
     my $standby=&mt('Role selected. Please stand by.');      my $standby=&mt('Role selected. Please stand by.');
     $standby=~s/\n/\\n/g;      $standby=~s/\n/\\n/g;
       my $noscript='<span class="LC_error">'.&mt('Use of LON-CAPA requires Javascript to be enabled in your web browser.').'<br />'.&mt('As this is not the case, most functionality in the system will be unavailable.').'</span><br />';
   
     $r->print(<<ENDHEADER);      $r->print(<<ENDHEADER);
 $start_page  $start_page
 <br />  <br />
 <script>  <noscript>
   $noscript
   </noscript>
   <script type="text/javascript">
 $swinfo  $swinfo
 window.focus();  window.focus();
   
Line 407  ENDHEADER Line 411  ENDHEADER
 # --------------------------------------------------------------- Error Header?  # --------------------------------------------------------------- Error Header?
     if ($error) {      if ($error) {
  $r->print("<h1>LON-CAPA Access Control</h1>");   $r->print("<h1>LON-CAPA Access Control</h1>");
         $r->print("<!-- LONCAPAACCESSCONTROLERRORSCREEN --><hr /><pre>Access  : ".   $r->print("<!-- LONCAPAACCESSCONTROLERRORSCREEN --><hr /><pre>");
                   Apache::lonnet::plaintext($priv)."\n");   if ($priv ne '') {
         $r->print("Resource: ".&Apache::lonenc::check_encrypt($fn)."\n");      $r->print("Access  : ".&Apache::lonnet::plaintext($priv)."\n");
         $r->print("Action  : $msg\n</pre><hr />");   }
    if ($fn ne '') {
       $r->print("Resource: ".&Apache::lonenc::check_encrypt($fn)."\n");
    }
    if ($msg ne '') {
       $r->print("Action  : $msg\n");
    }
    $r->print("</pre><hr />");
  my $url=$fn;   my $url=$fn;
  my $last;   my $last;
  if (tie(my %hash,'GDBM_File',$env{'request.course.fn'}.'_symb.db',   if (tie(my %hash,'GDBM_File',$env{'request.course.fn'}.'_symb.db',
Line 431  ENDHEADER Line 442  ENDHEADER
     }      }
 # -------------------------------------------------------- Choice or no choice?  # -------------------------------------------------------- Choice or no choice?
     if ($nochoose) {      if ($nochoose) {
  $r->print("<h2>".&mt('Sorry ...')."</h2>\n".   $r->print("<h2>".&mt('Sorry ...')."</h2>\n<span class='LC_error'>".
   &mt('This action is currently not authorized.').    &mt('This action is currently not authorized.').'</span>'.
   &Apache::loncommon::end_page());    &Apache::loncommon::end_page());
  return OK;   return OK;
     } else {      } else {
         if ($advanced) {  
     $r->print(&mt("Your home server is ").  
       $Apache::lonnet::hostname{&Apache::lonnet::homeserver  
                       ($env{'user.name'},$env{'user.domain'})}.  
       "<br />\n");  
     $r->print(&mt(  
       "Author and Co-Author roles are not available on servers other than their respective home servers."));  
         }  
         if (($ENV{'REDIRECT_QUERY_STRING'}) && ($fn)) {          if (($ENV{'REDIRECT_QUERY_STRING'}) && ($fn)) {
        $fn.='?'.$ENV{'REDIRECT_QUERY_STRING'};         $fn.='?'.$ENV{'REDIRECT_QUERY_STRING'};
         }          }
Line 454  ENDHEADER Line 457  ENDHEADER
     }      }
     if ($env{'user.adv'}) {      if ($env{'user.adv'}) {
  $r->print(   $r->print(
       '<br /><label>'.&mt('Show all roles').': <input type="checkbox" name="showall"');        '<br /><span class="LC_rolesinfo"><label>'.&mt('Show all roles').': <input type="checkbox" name="showall"');
  if ($env{'form.showall'}) { $r->print(' checked="checked" '); }   if ($env{'form.showall'}) { $r->print(' checked="checked" '); }
  $r->print(' /></label><input type="submit" value="'.&mt('Display').'" />');   $r->print(' /></label><input type="submit" value="'.&mt('Display').'" /></span>');
     }      }
   
     my (%roletext,%sortrole,%roleclass);      my (%roletext,%sortrole,%roleclass);
Line 539  ENDHEADER Line 542  ENDHEADER
                         $switchserver='otherserver='.$home.'&role='.$trolecode;                          $switchserver='otherserver='.$home.'&role='.$trolecode;
                     }                      }
                     #next if ($home eq 'no_host');                      #next if ($home eq 'no_host');
                     $home = $Apache::lonnet::hostname{$home};                      $home = &Apache::lonnet::hostname($home);
                     $ttype='Construction Space';                      $ttype='Construction Space';
                     $twhere=&mt('User').': '.$trest.'<br />'.&mt('Domain').                      $twhere=&mt('User').': '.$trest.'<br />'.&mt('Domain').
  ': '.$tdom.'<br />'.   ': '.$tdom.'<br />'.
Line 559  ENDHEADER Line 562  ENDHEADER
                         $switchserver='otherserver='.$home.'&role='.$trolecode;                          $switchserver='otherserver='.$home.'&role='.$trolecode;
                     }                      }
                     #next if ($home eq 'no_host');                      #next if ($home eq 'no_host');
                     $home = $Apache::lonnet::hostname{$home};                      $home = &Apache::lonnet::hostname($home);
                     $ttype='Construction Space';                      $ttype='Construction Space';
                     $twhere=&mt('Domain').': '.$tdom.'<br />'.&mt('Server').                      $twhere=&mt('Domain').': '.$tdom.'<br />'.&mt('Server').
  ':&nbsp;'.$home;   ':&nbsp;'.$home;
Line 597  ENDHEADER Line 600  ENDHEADER
                         }                          }
                     }                      }
                     if ($tsection) {                      if ($tsection) {
                         $twhere.='<br />'.&mt('Section/Group').': '.$tsection;                          $twhere.='<br />'.&mt('Section').': '.$tsection;
     }      }
     if ($role ne 'st') { $twhere.="<br />".&mt('Domain').":".$tdom; }      if ($role ne 'st') { $twhere.="<br />".&mt('Domain').":".$tdom; }
                 } elsif ($tdom) {                  } elsif ($tdom) {
Line 629  ENDHEADER Line 632  ENDHEADER
 # Is there only one choice?  # Is there only one choice?
     } elsif (($countactive==1) && ($env{'request.role'} eq 'cm')) {      } elsif (($countactive==1) && ($env{'request.role'} eq 'cm')) {
  $r->print('<h3>'.&mt('Please stand by.').'</h3>'.   $r->print('<h3>'.&mt('Please stand by.').'</h3>'.
     '<input type="hidden" name="'.$possiblerole.'" value="1" />');      '<input type="hidden" name="'.$possiblerole.'" value="1" />'.
               '<noscript><br /><input type="submit" name="submit" value="'.&mt('Continue').'" /></noscript>');
  $r->print("</form>\n");   $r->print("</form>\n");
  $r->rflush();   $r->rflush();
  $r->print('<script>document.forms.rolechoice.submit();</script>');   $r->print('<script type="text/javascript">document.forms.rolechoice.submit();</script>');
  $r->print(&Apache::loncommon::end_page());   $r->print(&Apache::loncommon::end_page());
  return OK;   return OK;
     }      }
 # More than one possible role  # More than one possible role
 # ----------------------------------------------------------------------- Table  # ----------------------------------------------------------------------- Table
     unless (($advanced) || ($nochoose)) {      unless ((!&Apache::lonmenu::show_course()) || ($nochoose)) {
  $r->print("<h2>".&mt('Select a Course/Group to Enter')."</h2>\n");   $r->print("<h2>".&mt('Select a Course to Enter')."</h2>\n");
     }      }
     $r->print('<br /><table><tr>');      $r->print('<br /><table id="LC_rolesmenu"><tr>');
     unless ($nochoose) { $r->print('<th>&nbsp;</th>'); }      unless ($nochoose) { $r->print('<th>&nbsp;</th>'); }
     $r->print('<th>'.&mt('User Role').'</th><th>'.&mt('Extent').      $r->print('<th>'.&mt('User Role').'</th><th>'.&mt('Extent').
          '</th><th>'.&mt('Start').'</th><th>'.&mt('End').'</th></tr>'."\n");           '</th><th>'.&mt('Start').'</th><th>'.&mt('End').'</th></tr>'."\n");
     my $doheaders=-1;      my $doheaders=-1;
     foreach my $type ('Domain','Construction Space','Course','Group','Unavailable','System') {      foreach my $type ('Domain','Construction Space','Course','Unavailable','System') {
  my $haverole=0;   my $haverole=0;
  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/) { 
Line 686  ENDHEADER Line 690  ENDHEADER
         $r->print(&coursepick_jscript());          $r->print(&coursepick_jscript());
         $r->print(&Apache::loncommon::coursebrowser_javascript());          $r->print(&Apache::loncommon::coursebrowser_javascript());
     }      }
     foreach my $type ('Construction Space','Domain','Course','Group','Unavailable','System') {      foreach my $type ('Construction Space','Domain','Course','Unavailable','System') {
  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/) { 
Line 723  ENDHEADER Line 727  ENDHEADER
     $r->print('<td>&nbsp;</td>');      $r->print('<td>&nbsp;</td>');
  }   }
     }      }
     $r->print('<td colspan="3"><font color="'.$tfont.'">'.&mt('No role specified').      $r->print('<td colspan="3"><font color="'.$tfont.'"><span class="LC_rolesinfo">'.&mt('No role specified').
       '</font></td><td><font color="'.$tfont.'">'.$tremark.        '</font></span></td><td><font color="'.$tfont.'">'.$tremark.
       '&nbsp;</font></td></tr>'."\n");        '&nbsp;</font></td></tr>'."\n");
   
     $r->print('</table>');      $r->print('</table>');
Line 734  ENDHEADER Line 738  ENDHEADER
 # ------------------------------------------------------------ Privileges Info  # ------------------------------------------------------------ Privileges Info
     if (($advanced) && (($env{'user.error.msg'}) || ($error))) {      if (($advanced) && (($env{'user.error.msg'}) || ($error))) {
  $r->print('<hr /><h2>Current Privileges</h2>');   $r->print('<hr /><h2>Current Privileges</h2>');
    $r->print(&privileges_info());
  foreach $envkey (sort keys %env) {  
     if ($envkey=~/^user\.priv\.$env{'request.role'}\./) {  
  my $where=$envkey;  
  $where=~s/^user\.priv\.$env{'request.role'}\.//;  
  my $ttype;  
  my $twhere;  
  my ($tdom,$trest,$tsec)=  
     split(/\//,Apache::lonnet::declutter($where));  
  if ($trest) {  
     if ($env{'course.'.$tdom.'_'.$trest.'.description'} eq 'ca') {  
  $ttype='Construction Space';  
  $twhere='User: '.$trest.', Domain: '.$tdom;  
     } else {  
  $ttype=   
     &Apache::loncommon::course_type($tdom.'_'.$trest);  
  $twhere=$env{'course.'.$tdom.'_'.$trest.'.description'};  
  if ($tsec) {  
     $twhere.=' (Section: '.$tsec.')';  
  }  
     }  
  } elsif ($tdom) {  
     $ttype='Domain';  
     $twhere=$tdom;  
  } else {  
     $ttype='System';  
     $twhere='/';  
  }  
  $r->print("\n<h3>".$ttype.': '.$twhere.'</h3><ul>');  
  foreach (sort split(/:/,$env{$envkey})) {  
     if ($_) {  
  my ($prv,$restr)=split(/\&/,$_);  
  my $trestr='';  
  if ($restr ne 'F') {  
     my $i;  
     $trestr.=' (';  
     for ($i=0;$i<length($restr);$i++) {  
  $trestr.=  
        Apache::lonnet::plaintext(substr($restr,$i,1));  
  if ($i<length($restr)-1) { $trestr.=', '; }  
     }  
     $trestr.=')';  
  }  
  $r->print('<li>'.  
   Apache::lonnet::plaintext($prv).$trestr.  
   '</li>');  
     }  
  }  
  $r->print('</ul>');  
     }  
  }  
     }      }
     $r->print(&Apache::lonnet::getannounce());      $r->print(&Apache::lonnet::getannounce());
     if ($advanced) {      if ($advanced) {
Line 796  ENDHEADER Line 750  ENDHEADER
     return OK;      return OK;
 }  }
   
   sub privileges_info {
       my ($which) = @_;
       my $output;
   
       $which ||= $env{'request.role'};
   
       foreach my $envkey (sort(keys(%env))) {
    next if ($envkey!~/^user\.priv\.\Q$which\E\.(.*)/);
   
    my $where=$1;
    my $ttype;
    my $twhere;
    my (undef,$tdom,$trest,$tsec)=split(m{/},$where);
    if ($trest) {
       if ($env{'course.'.$tdom.'_'.$trest.'.description'} eq 'ca') {
    $ttype='Construction Space';
    $twhere='User: '.$trest.', Domain: '.$tdom;
       } else {
    $ttype= &Apache::loncommon::course_type($tdom.'_'.$trest);
    $twhere=$env{'course.'.$tdom.'_'.$trest.'.description'};
    if ($tsec) {
       my $sec_type = 'Section';
       if (exists($env{"user.role.gr.$where"})) {
    $sec_type = 'Group';
       }
       $twhere.=' ('.$sec_type.': '.$tsec.')';
    }
       }
    } elsif ($tdom) {
       $ttype='Domain';
       $twhere=$tdom;
    } else {
       $ttype='System';
       $twhere='/';
    }
    $output .= "\n<h3>".$ttype.': '.$twhere.'</h3>'."\n<ul>";
    foreach my $priv (sort(split(/:/,$env{$envkey}))) {
       next if (!$priv);
   
       my ($prv,$restr)=split(/\&/,$priv);
       my $trestr='';
       if ($restr ne 'F') {
    $trestr.=' ('.
       join(', ',
    map { &Apache::lonnet::plaintext($_) } 
        (split('',$restr))).') ';
       }
       $output .= "\n\t".
    '<li>'.&Apache::lonnet::plaintext($prv).$trestr.'</li>';
    }
    $output .= "\n".'</ul>';
       }
       return $output;
   }
   
 sub role_status {  sub role_status {
     my ($rolekey,$then,$now,$role,$where,$trolecode,$tstatus,$tstart,$tend) = @_;      my ($rolekey,$then,$now,$role,$where,$trolecode,$tstatus,$tstart,$tend) = @_;
     my @pwhere = ();      my @pwhere = ();
Line 823  sub role_status { Line 832  sub role_status {
   
 sub build_roletext {  sub build_roletext {
     my ($trolecode,$tdom,$trest,$tstatus,$tryagain,$advanced,$tremark,$tbg,$tfont,$trole,$twhere,$tpstart,$tpend,$nochoose,$button,$switchserver) = @_;      my ($trolecode,$tdom,$trest,$tstatus,$tryagain,$advanced,$tremark,$tbg,$tfont,$trole,$twhere,$tpstart,$tpend,$nochoose,$button,$switchserver) = @_;
     my $roletext='<tr bgcolor="'.$tbg.'">';      my $roletext='<tr bgcolor="'.$tbg.'" class="LC_rolesmenu_'.$tstatus.'">';
     my $is_dc=($trolecode =~ m/^dc\./);      my $is_dc=($trolecode =~ m/^dc\./);
     my $rowspan=($is_dc) ? ''      my $rowspan=($is_dc) ? ''
                          : ' rowspan="2" ';                           : ' rowspan="2" ';
Line 833  sub build_roletext { Line 842  sub build_roletext {
         $buttonname=~s/\W//g;          $buttonname=~s/\W//g;
         if (!$button) {          if (!$button) {
             if ($switchserver) {              if ($switchserver) {
                 $roletext.='<td'.$rowspan.'><a href="/adm/switchserver?'.                  $roletext.='<td'.$rowspan.'><span class="LC_rolesinfo"><a href="/adm/switchserver?'.
                 $switchserver.'">'.&mt('Switch Server').'</a></td>';                  $switchserver.'">'.&mt('Switch Server').'</a></span></td>';
             } else {              } else {
                 $roletext.=('<td'.$rowspan.'>&nbsp;</td>');                  $roletext.=('<td'.$rowspan.'>&nbsp;</td>');
             }              }
Line 866  sub build_roletext { Line 875  sub build_roletext {
                '</font></td><td><font color="'.$tfont.'">'.$tpend.                 '</font></td><td><font color="'.$tfont.'">'.$tpend.
                '</font></td></tr>';                 '</font></td></tr>';
     if (!$is_dc) {      if (!$is_dc) {
  $roletext.='<tr bgcolor="'.$tbg.'"><td colspan="4"><font color="'.$tfont.'">'.$tremark.   $roletext.='<tr bgcolor="'.$tbg.'"><td colspan="4"><font color="'.$tfont.'"><span class="LC_rolesinfo">'.$tremark.
     '&nbsp;</font></td></tr><tr><td colspan="5" height="3"></td></tr>'."\n";      '</span>&nbsp;</font></td></tr><tr><td colspan="5" height="3"></td></tr>'."\n";
     }      }
     return $roletext;      return $roletext;
 }  }
Line 912  sub courselink { Line 921  sub courselink {
     my $courseform=&Apache::loncommon::selectcourse_link      my $courseform=&Apache::loncommon::selectcourse_link
                    ('rolechoice','dccourse'.$rowtype.'_'.$dcdom,                     ('rolechoice','dccourse'.$rowtype.'_'.$dcdom,
                     'dcdomain'.$rowtype.'_'.$dcdom,'coursedesc'.$rowtype.'_'.                      'dcdomain'.$rowtype.'_'.$dcdom,'coursedesc'.$rowtype.'_'.
                     $dcdom,$dcdom,undef,$selecttype);                      $dcdom,$dcdom,undef);
     my $hiddenitems = '<input type="hidden" name="dcdomain'.$rowtype.'_'.$dcdom.'" value="'.$dcdom.'" />'.      my $hiddenitems = '<input type="hidden" name="dcdomain'.$rowtype.'_'.$dcdom.'" value="'.$dcdom.'" />'.
                       '<input type="hidden" name="origdom'.$rowtype.'_'.$dcdom.'" value="'.$dcdom.'" />'.                        '<input type="hidden" name="origdom'.$rowtype.'_'.$dcdom.'" value="'.$dcdom.'" />'.
                       '<input type="hidden" name="dccourse'.$rowtype.'_'.$dcdom.'" value="" />'.                        '<input type="hidden" name="dccourse'.$rowtype.'_'.$dcdom.'" value="" />'.
Line 921  sub courselink { Line 930  sub courselink {
 }  }
   
 sub coursepick_jscript {  sub coursepick_jscript {
       my %lt = &Apache::lonlocal::texthash(
                     plsu => "Please use the 'Select Course' link to open a separate pick course window where you may select the course you wish to enter.",
                     youc => 'You can only use this screen to select courses in the current domain.',
               );
     my $verify_script = <<"END";      my $verify_script = <<"END";
 <script>  <script type="text/javascript">
 function verifyCoursePick(caller) {  function verifyCoursePick(caller) {
     var numbutton = getIndex(caller)      var numbutton = getIndex(caller)
     var pickedCourse = document.rolechoice.elements[numbutton+4].value      var pickedCourse = document.rolechoice.elements[numbutton+4].value
Line 936  function verifyCoursePick(caller) { Line 949  function verifyCoursePick(caller) {
             }              }
         }          }
         else {          else {
             alert("Please use the 'Select Course' link to open a separate pick course window where you may select the course you wish to enter.");              alert("$lt{'plsu'}");
         }          }
     }      }
     else {      else {
         alert("You can only use this screen to select courses in the current domain")          alert("$lt{'youc'}");
     }      }
 }  }
 function getIndex(caller) {  function getIndex(caller) {
Line 956  END Line 969  END
     return $verify_script;      return $verify_script;
 }  }
   
 sub processpick {  
     my $process_pick = <<"END";  
 <script>  
 function process_pick(dom) {  
     var pickedCourse=opener.document.rolechoice.$env{'form.cnumelement'}.value;  
     var pickedDomain=opener.document.rolechoice.$env{'form.cdomelement'}.value;  
     var okDomain = 0;  
   
     if (pickedDomain == dom) {  
         if (pickedCourse != '') {  
             var courseTarget = "cc./"+pickedDomain+"/"+pickedCourse  
             opener.document.title='Role selected. Please stand by.';  
             opener.status='Role selected. Please stand by.';  
     opener.document.rolechoice.newrole.value=courseTarget  
             opener.document.rolechoice.submit()  
         }  
     } else {  
         alert("You may only use this screen to select courses in the current domain: "+dom+"\\nPlease return to the roles page window and click the 'Select Course' link for domain: "+pickedDomain+",\\n if you are a Domain Coordinator in that domain, and wish to become a Course Coordinator in a course in the domain");  
     }  
 }  
    
 </script>  
 END  
     return $process_pick;  
 }  
   
 sub display_cc_role {  sub display_cc_role {
     my $rolekey = shift;      my $rolekey = shift;
     my $roletext;      my $roletext;
     my $advanced = $env{'user.adv'};      my $advanced = $env{'user.adv'};
     my $tryagain = $env{'form.tryagain'};      my $tryagain = $env{'form.tryagain'};
     unless ($rolekey =~/^error\:/) {      unless ($rolekey =~/^error\:/) {
         if ($rolekey =~ m-^user\.role.cc\./($match_domain)/($match_username)$-) {          if ($rolekey =~ m-^user\.role.cc\./($match_domain)/($match_courseid)$-) {
             my $tcourseid = $1.'_'.$2;              my $tcourseid = $1.'_'.$2;
             my $trolecode = 'cc./'.$1.'/'.$2;              my $trolecode = 'cc./'.$1.'/'.$2;
             my $twhere;              my $twhere;
Line 1018  sub allcourses_row { Line 1005  sub allcourses_row {
     my ($dcdom,$rowtype) = @_;      my ($dcdom,$rowtype) = @_;
     my $output = '<tr bgcolor="#77FF77">'.      my $output = '<tr bgcolor="#77FF77">'.
                  ' <td colspan="5">';                   ' <td colspan="5">';
     foreach my $type ('Course','Group') {      my $selectlink = &courselink($dcdom,$rowtype);
         my $selectlink = &courselink($dcdom,$rowtype,$type);      my $ccrole = &Apache::lonnet::plaintext('cc');
         my $ccrole = &Apache::lonnet::plaintext('cc',$type);      $output.= '<span class="LC_rolesinfo">'.
         $output.= '<font color="#002200">'.$ccrole.'</font>'.              &mt('[_1]: [_2] from domain [_3]',$ccrole,$selectlink,$dcdom).
               ' <b>'.$selectlink.'</b>'.              '</span><br /></tr><tr><td colspan="5" height="3"></td></tr>'."\n";
               ' from '.&mt('Domain').' '.$dcdom.'<br />';  
     }  
     $output .= '</tr><tr><td colspan="5" height="3"></td></tr>'."\n";  
     return $output;      return $output;
 }  }
   

Removed from v.1.170  
changed lines
  Added in v.1.181.2.1


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