--- loncom/publisher/lonpublisher.pm 2003/12/31 03:02:49 1.159 +++ loncom/publisher/lonpublisher.pm 2004/01/04 00:28:22 1.160 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Publication Handler # -# $Id: lonpublisher.pm,v 1.159 2003/12/31 03:02:49 www Exp $ +# $Id: lonpublisher.pm,v 1.160 2004/01/04 00:28:22 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1697,6 +1697,63 @@ sub publishdirectory { } closedir(DIR); } + +######################################### +# publish a default.meta file + +sub defaultmetapublish { + my ($r,$fn,$cuname,$cudom)=@_; + $fn=~s/^\/\~$cuname\//\/home\/$cuname\/public_html\//; + unless (-e $fn) { + return HTTP_NOT_FOUND; + } + my $target=$fn; + $target=~s/^\/home\/$cuname\/public_html\//$Apache::lonnet::perlvar{'lonDocRoot'}\/res\/$cudom\/$cuname\//; + + + &Apache::loncommon::content_type($r,'text/html'); + $r->send_http_header; + + $r->print('
'.&mt('Created directory').' '.$parts[$count].'
'); + mkdir($path,0777); + } + } + + if (copy($fn,$copyfile)) { + $r->print(''.&mt('Copied source file').'
'); + } else { + return "". + &mt('Failed to copy source').", $!, ".&mt('FAIL').""; + } + +# --------------------------------------------------- Send update notifications + + my @subscribed=&get_subscribed_hosts($target); + foreach my $subhost (@subscribed) { + $r->print(''.&mt('Notifying host').' '.$subhost.':');$r->rflush; + my $reply=&Apache::lonnet::critical('update:'.$target,$subhost); + $r->print($reply.'