Diff for /loncom/auth/londatecheck.pm between versions 1.8 and 1.11

version 1.8, 2005/04/07 06:56:21 version 1.11, 2005/04/25 21:41:37
Line 36  sub content_date_check { Line 36  sub content_date_check {
     my $close=&Apache::lonnet::EXT('resource.0.contentclose',$symb);      my $close=&Apache::lonnet::EXT('resource.0.contentclose',$symb);
     if ( (defined($open)  && $open  ne '' && time < $open) ) {      if ( (defined($open)  && $open  ne '' && time < $open) ) {
  return ('CLOSED',$open,$close,   return ('CLOSED',$open,$close,
    '<h1>'.&mt('Not open to be viewed').'</h1>'.
  &mt("This resource currently isn't open. ".   &mt("This resource currently isn't open. ".
     "It will be available at [_1].",      "It will be available at [_1].",
     &Apache::lonlocal::locallocaltime($open)));      &Apache::lonlocal::locallocaltime($open)));
     }      }
     if ( (defined($close) && $close ne '' && time > $close) ) {      if ( (defined($close) && $close ne '' && time > $close) ) {
  return ('CLOSED',$open,$close,   return ('CLOSED',$open,$close,
    '<h1>'.&mt('Not open to be viewed').'</h1>'.
  &mt("This resource is no longer available to be viewed."));   &mt("This resource is no longer available to be viewed."));
     }      }
     return ('OPEN',$open,$close);      return ('OPEN',$open,$close);
Line 50  sub content_date_check { Line 52  sub content_date_check {
 sub handler {  sub handler {
     my ($r)=@_;      my ($r)=@_;
     if (&Apache::lonnet::allowed('bre',$r->uri) eq 'F') {      if (&Apache::lonnet::allowed('bre',$r->uri) eq 'F') {
  return OK;   return DECLINED;
     }      }
     my ($status,$open,$close,$msg)=&content_date_check();      my ($status,$open,$close,$msg)=&content_date_check();
     if ($status ne 'OPEN') {      if ($status ne 'OPEN') {
Line 58  sub handler { Line 60  sub handler {
  &Apache::loncommon::content_type($r,'text/html');   &Apache::loncommon::content_type($r,'text/html');
  $r->send_http_header;   $r->send_http_header;
  return OK if $r->header_only;   return OK if $r->header_only;
  $r->print('<html><head><title>'.&mt("Not Open").'</title>');   my $html=&Apache::lonxml::xmlbegin();
  my $addentries=' onLoad="'.&Apache::lonmenu::loadevents().   $r->print($html.'<head><title>'.&mt("Not Open").'</title>');
     '" onUnload="'.&Apache::lonmenu::unloadevents().'"';  
  $r->print(&Apache::lonmenu::registerurl(1));   $r->print(&Apache::lonmenu::registerurl(1));
  $r->print('</head>'.   $r->print('</head>'.&Apache::structuretags::body_tag_start('web'));
   &Apache::loncommon::bodytag('','',$addentries,'','',  
       undef));  
   
  $r->print($msg);   $r->print($msg);
  $r->print('</body></html>');   $r->print(&Apache::lonxml::xmlend().'</html>');
    return OK;
     }      }
     return OK;      return DECLINED;
 }  }
 1;  1;

Removed from v.1.8  
changed lines
  Added in v.1.11


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