version 1.4, 2004/08/23 18:57:16
|
version 1.8, 2005/04/07 06:56:21
|
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 OK; |
} |
} |
my ($status,$open,$close,$msg)=&content_date_check(); |
my ($status,$open,$close,$msg)=&content_date_check(); |
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)); |