version 1.161, 2004/01/05 22:29:51
|
version 1.165, 2004/03/31 05:24:00
|
Line 204 sub metaeval {
|
Line 204 sub metaeval {
|
if ($newentry !~m|^/res|) { $newentry=$prefix.$newentry; } |
if ($newentry !~m|^/res|) { $newentry=$prefix.$newentry; } |
} |
} |
# actually store |
# actually store |
$metadatafields{$unikey}=$newentry; |
if ( $entry eq 'rule' && exists($metadatafields{$unikey})) { |
|
$metadatafields{$unikey}.=','.$newentry; |
|
} else { |
|
$metadatafields{$unikey}=$newentry; |
|
} |
} |
} |
} |
} |
} |
} |
Line 916 sub publish {
|
Line 920 sub publish {
|
$allowstr.="\n".'<allow src="'.$thisdep.'" />'; |
$allowstr.="\n".'<allow src="'.$thisdep.'" />'; |
} |
} |
$scrout.='<br />'; |
$scrout.='<br />'; |
unless ($thisdep=~/\*/) { |
if ($thisdep!~/\*/ && $thisdep!~m|^/adm/|) { |
$scrout.='<a href="'.$thisdep.'">'; |
$scrout.='<a href="'.$thisdep.'">'; |
} |
} |
$scrout.='<tt>'.$thisdep.'</tt>'; |
$scrout.='<tt>'.$thisdep.'</tt>'; |
unless ($thisdep=~/\*/) { |
if ($thisdep!~/\*/ && $thisdep!~m|^/adm/|) { |
$scrout.='</a>'; |
$scrout.='</a>'; |
if ( |
if ( |
&Apache::lonnet::getfile($Apache::lonnet::perlvar{'lonDocRoot'}.'/'. |
&Apache::lonnet::getfile($Apache::lonnet::perlvar{'lonDocRoot'}.'/'. |
Line 941 sub publish {
|
Line 945 sub publish {
|
} |
} |
$outstring=~s/\n*(\<\/[^\>]+\>)\s*$/$allowstr\n$1\n/s; |
$outstring=~s/\n*(\<\/[^\>]+\>)\s*$/$allowstr\n$1\n/s; |
|
|
### FIXME: is this really what we want? |
|
# I dont' think so, to will corrupt any UTF-8 resources at least, |
|
# and any encoding other than ISO-8859-1 will probably break |
|
#Encode any High ASCII characters |
|
#$outstring=&HTML::Entities::encode($outstring,"\200-\377"); |
|
# ------------------------------------------------------------- Write modified. |
# ------------------------------------------------------------- Write modified. |
|
|
{ |
{ |
Line 1415 sub phasetwo {
|
Line 1414 sub phasetwo {
|
print $mfh ' '.$_.'="'.$value.'"'; |
print $mfh ' '.$_.'="'.$value.'"'; |
} |
} |
print $mfh '>'. |
print $mfh '>'. |
&HTML::Entities::encode($metadatafields{$unikey}) |
&HTML::Entities::encode($metadatafields{$unikey},'<>&"') |
.'</'.$tag.'>'; |
.'</'.$tag.'>'; |
} |
} |
} |
} |
Line 1836 sub handler {
|
Line 1835 sub handler {
|
return HTTP_NOT_ACCEPTABLE; |
return HTTP_NOT_ACCEPTABLE; |
} |
} |
|
|
unless (&Apache::lonnet::homeserver($cuname,$cudom) |
my $home=&Apache::lonnet::homeserver($cuname,$cudom); |
eq $r->dir_config('lonHostID')) { |
my $allowed=0; |
|
my @ids=&Apache::lonnet::current_machine_ids(); |
|
foreach my $id (@ids) { if ($id eq $home) { $allowed = 1; } } |
|
unless ($allowed) { |
$r->log_reason($cuname.' at '.$cudom. |
$r->log_reason($cuname.' at '.$cudom. |
' trying to publish file '.$ENV{'form.filename'}. |
' trying to publish file '.$ENV{'form.filename'}. |
' ('.$fn.') - not homeserver ('. |
' ('.$fn.') - not homeserver ('.$home.')', |
&Apache::lonnet::homeserver($cuname,$cudom).')', |
|
$r->filename); |
$r->filename); |
return HTTP_NOT_ACCEPTABLE; |
return HTTP_NOT_ACCEPTABLE; |
} |
} |