Diff for /loncom/interface/lonchatfetch.pm between versions 1.16 and 1.17

version 1.16, 2005/02/17 08:50:20 version 1.17, 2005/04/07 06:56:22
Line 37  use Apache::lonnet; Line 37  use Apache::lonnet;
 sub handler {  sub handler {
     my $r = shift;      my $r = shift;
   
     if (! &Apache::lonnet::allowed('pch',$ENV{'request.course.id'}.      if (! &Apache::lonnet::allowed('pch',$env{'request.course.id'}.
              ($ENV{'request.course.sec'}?'/'.$ENV{'request.course.sec'}:''))               ($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))
         ) {          ) {
         return HTTP_NOT_ACCEPTABLE;          return HTTP_NOT_ACCEPTABLE;
     }      }
Line 47  sub handler { Line 47  sub handler {
     if ($loaderror) { return $loaderror; }      if ($loaderror) { return $loaderror; }
     $loaderror=      $loaderror=
        &Apache::lonnet::overloaderror($r,         &Apache::lonnet::overloaderror($r,
          $ENV{'course.'.$ENV{'request.course.id'}.'.home'});           $env{'course.'.$env{'request.course.id'}.'.home'});
     if ($loaderror) { return $loaderror; }      if ($loaderror) { return $loaderror; }
   
     &Apache::loncommon::content_type($r,'text/html');      &Apache::loncommon::content_type($r,'text/html');
Line 56  sub handler { Line 56  sub handler {
   
 # ------------------------------------------------------------ retrieve entries  # ------------------------------------------------------------ retrieve entries
   
     my $cnum=$ENV{'course.'.$ENV{'request.course.id'}.'.num'};      my $cnum=$env{'course.'.$env{'request.course.id'}.'.num'};
     my $cdom=$ENV{'course.'.$ENV{'request.course.id'}.'.domain'};      my $cdom=$env{'course.'.$env{'request.course.id'}.'.domain'};
     my $chome=$ENV{'course.'.$ENV{'request.course.id'}.'.home'};      my $chome=$env{'course.'.$env{'request.course.id'}.'.home'};
   
     my @entries=split(/\:/,      my @entries=split(/\:/,
        &Apache::lonnet::reply(         &Apache::lonnet::reply(
         "chatretr:$cdom:$cnum:$ENV{'user.domain'}:$ENV{'user.name'}",$chome));          "chatretr:$cdom:$cnum:$env{'user.domain'}:$env{'user.name'}",$chome));
 # Figure out what the last valid entry-id is  # Figure out what the last valid entry-id is
     my ($lastid,$thentime,$idnum);      my ($lastid,$thentime,$idnum);
     foreach (@entries) {      foreach (@entries) {
Line 73  sub handler { Line 73  sub handler {
  }   }
     }      }
 # ----------------------------------------------------------- Can see identity?  # ----------------------------------------------------------- Can see identity?
     my $crs='/'.$ENV{'request.course.id'};      my $crs='/'.$env{'request.course.id'};
     if ($ENV{'request.course.sec'}) {      if ($env{'request.course.sec'}) {
        $crs.='_'.$ENV{'request.course.sec'};         $crs.='_'.$env{'request.course.sec'};
     }                       }                 
     $crs=~s/\_/\//g;      $crs=~s/\_/\//g;
     my $seeid=&Apache::lonnet::allowed('rin',$crs);      my $seeid=&Apache::lonnet::allowed('rin',$crs);
Line 84  sub handler { Line 84  sub handler {
     my $include=0;      my $include=0;
     my $newstuff='';      my $newstuff='';
     my $bottomid='';      my $bottomid='';
     unless ($ENV{'form.lastid'}) {       unless ($env{'form.lastid'}) { 
        $include=1;          $include=1; 
        my $html=&Apache::lonxml::xmlbegin();         my $html=&Apache::lonxml::xmlbegin();
        $newstuff=$html.'<head></head><body bgcolor="#FFFFFF">';         $newstuff=$html.'<head></head><body bgcolor="#FFFFFF">';
Line 106  sub handler { Line 106  sub handler {
     $contrib=~s/\n/\<br \/\>/g;      $contrib=~s/\n/\<br \/\>/g;
     ($contrib,my $errors)=&Apache::lontexconvert::msgtexconverted($contrib);      ($contrib,my $errors)=&Apache::lontexconvert::msgtexconverted($contrib);
     if ($errors) { $contrib.="[Message not fully displayed due to incorrect embedded TeX]"; }      if ($errors) { $contrib.="[Message not fully displayed due to incorrect embedded TeX]"; }
     if ($errors && $snum eq $ENV{'user.name'} &&      if ($errors && $snum eq $env{'user.name'} &&
  $sdom eq $ENV{'user.domain'} ) {   $sdom eq $env{'user.domain'} ) {
  $contrib.="<br />[TeX error message: $errors]";   $contrib.="<br />[TeX error message: $errors]";
     }      }
     $contrib=~s/\n/ /g;      $contrib=~s/\n/ /g;
Line 146  sub handler { Line 146  sub handler {
     $bottomid=$id;      $bottomid=$id;
  } else {   } else {
     $_=~/^(\w+)/;      $_=~/^(\w+)/;
     if ($1 eq $ENV{'form.lastid'}) { $include=1; }      if ($1 eq $env{'form.lastid'}) { $include=1; }
  }   }
     }      }
     my $participant_output=join('<br />',sort @participants);      my $participant_output=join('<br />',sort @participants);

Removed from v.1.16  
changed lines
  Added in v.1.17


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