version 1.2, 2004/06/12 04:44:31
|
version 1.3, 2004/06/18 15:13:07
|
Line 69 sub print_item {
|
Line 69 sub print_item {
|
|
|
sub handler { |
sub handler { |
my $r=shift; |
my $r=shift; |
if($ENV{'form.action'} eq 'stage2') { |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, |
|
['filename']); |
|
my $filename = $ENV{'form.filename'}; |
|
my $source = &Apache::lonnet::metadata($filename,'sourceavail'); |
|
if ($source ne 'open') { |
|
$ENV{'user.error.msg'}="$filename:cre:1:1:Source code not available"; |
|
return HTTP_NOT_ACCEPTABLE; |
|
} |
|
if ((!&Apache::lonnet::allowed('cre')) || |
|
(!&Apache::lonnet::allowed('bre',$filename))) { |
|
$ENV{'user.error.msg'}="$filename:bre:1:1:Access to resource denied"; |
|
return HTTP_NOT_ACCEPTABLE; |
|
} |
|
if ($ENV{'form.action'} eq 'stage2') { |
&stage_2($r, $ENV{'form.filename'}); |
&stage_2($r, $ENV{'form.filename'}); |
} else { |
} else { |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, |
|
['filename']); |
|
if (!&Apache::lonnet::allowed('cre',$ENV{'form.filename'})) { |
|
return FORBIDDEN; |
|
} |
|
&Apache::loncommon::content_type($r,'text/html'); |
&Apache::loncommon::content_type($r,'text/html'); |
my $filename = $ENV{'form.filename'}; |
|
$r->send_http_header; |
$r->send_http_header; |
$r->print(' <form name="copy" action="/adm/source/" target="_parent" method="post"> |
$r->print(' <form name="copy" action="/adm/source/" target="_parent" method="post"> |
<input type="button" value="Close Window" name="close" onClick="window.close()"> |
<input type="button" value="Close Window" name="close" onClick="window.close()"> |