--- loncom/publisher/lonpublisher.pm 2004/01/20 22:52:17 1.162 +++ loncom/publisher/lonpublisher.pm 2004/02/27 17:27:51 1.164 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Publication Handler # -# $Id: lonpublisher.pm,v 1.162 2004/01/20 22:52:17 albertel Exp $ +# $Id: lonpublisher.pm,v 1.164 2004/02/27 17:27:51 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -920,11 +920,11 @@ sub publish { $allowstr.="\n".''; } $scrout.='
'; - unless ($thisdep=~/\*/) { + if ($thisdep!~/\*/ && $thisdep!~m|^/adm/|) { $scrout.=''; } $scrout.=''.$thisdep.''; - unless ($thisdep=~/\*/) { + if ($thisdep!~/\*/ && $thisdep!~m|^/adm/|) { $scrout.=''; if ( &Apache::lonnet::getfile($Apache::lonnet::perlvar{'lonDocRoot'}.'/'. @@ -1840,12 +1840,14 @@ sub handler { return HTTP_NOT_ACCEPTABLE; } - unless (&Apache::lonnet::homeserver($cuname,$cudom) - eq $r->dir_config('lonHostID')) { + my $home=&Apache::lonnet::homeserver($cuname,$cudom); + 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. ' trying to publish file '.$ENV{'form.filename'}. - ' ('.$fn.') - not homeserver ('. - &Apache::lonnet::homeserver($cuname,$cudom).')', + ' ('.$fn.') - not homeserver ('.$home.')', $r->filename); return HTTP_NOT_ACCEPTABLE; }