Diff for /loncom/auth/londatecheck.pm between versions 1.4 and 1.9

version 1.4, 2004/08/23 18:57:16 version 1.9, 2005/04/25 21:21:17
Line 26 Line 26
   
 use strict;  use strict;
 package Apache::londatecheck;  package Apache::londatecheck;
 use Apache::lonnet();  use Apache::lonnet;
 use Apache::lonlocal;  use Apache::lonlocal;
 use Apache::Constants qw(:common :http :methods);  use Apache::Constants qw(:common :http :methods);
   
 sub content_date_check {  sub content_date_check {
     my $symb=$ENV{'request.symb'};      my $symb=$env{'request.symb'};
     my $open=&Apache::lonnet::EXT('resource.0.contentopen',$symb);      my $open=&Apache::lonnet::EXT('resource.0.contentopen',$symb);
     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) ) {
Line 49  sub content_date_check { Line 49  sub content_date_check {
   
 sub handler {  sub handler {
     my ($r)=@_;      my ($r)=@_;
     if (&Apache::lonnet::allowed('bre',$ENV{'request.filename'}) 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 58  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>Go Away!</title>');   $r->print('<html><head><title>'.&mt("Not Open").'</title>');
  my $addentries=' onLoad="'.&Apache::lonmenu::loadevents().   my $addentries=' onLoad="'.&Apache::lonmenu::loadevents().
     '" onUnload="'.&Apache::lonmenu::unloadevents().'"';      '" onUnload="'.&Apache::lonmenu::unloadevents().'"';
  $r->print(&Apache::lonmenu::registerurl(1));   $r->print(&Apache::lonmenu::registerurl(1));
Line 68  sub handler { Line 68  sub handler {
   
  $r->print($msg);   $r->print($msg);
  $r->print('</body></html>');   $r->print('</body></html>');
    return OK;
     }      }
     return OK;      return DECLINED;
 }  }
 1;  1;

Removed from v.1.4  
changed lines
  Added in v.1.9


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