--- loncom/publisher/lonpublisher.pm 2000/11/29 12:28:46 1.2 +++ loncom/publisher/lonpublisher.pm 2000/11/29 19:52:34 1.3 @@ -14,6 +14,8 @@ use Apache::File; use Apache::Constants qw(:common :http :methods); use HTML::TokeParser; +my %addid; + sub publish { my ($source,$target,$style)=@_; my $logfile; @@ -23,6 +25,21 @@ sub publish { print $logfile "\n\n================== Publish ".localtime()." =================\n"; + if (($style eq 'ssi') || ($style eq 'rat')) { +# ------------------------------------------------------- This needs processing + my $copyfile=$source.'.save'; + { + my $org=Apache::File->new($source); + my $cop=Apache::File->new('>'.$copyfile); + while (my $line=<$org>) { print $cop $line; } + } + if (-e $copyfile) { + print $logfile "Copied original file to ".$copyfile."\n"; + } else { + return "Failed to write backup copy, FAIL"; + } + + } my $version=''; return 'Version '.$version.', SUCCESS'; @@ -74,6 +91,14 @@ sub handler { # --------------------------------- File is there and owned, init lookup tables + %addid=(); + + { + my $fh=Apache::File->new($r->dir_config('lonTabDir').'/addid.tab'); + while (<$fh>=~/(\w+)\s+(\w+)/) { + $addid{$1}=$2; + } + } # ----------------------------------------------------------- Start page output $r->content_type('text/html');