version 1.7, 2004/08/23 19:34:00
|
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 50 sub content_date_check {
|
Line 50 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 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; |