Diff for /loncom/publisher/lonpublisher.pm between versions 1.113 and 1.114

version 1.113, 2003/03/07 17:52:37 version 1.114, 2003/03/07 17:55:05
Line 809  sub publish { Line 809  sub publish {
     my %allow=();      my %allow=();
   
     unless ($logfile=Apache::File->new('>>'.$source.'.log')) {      unless ($logfile=Apache::File->new('>>'.$source.'.log')) {
  return ('<font color=red>No write permission to user directory, FAIL</font>',1);   return ('<font color="red">No write permission to user directory, FAIL</font>',1);
     }      }
     print $logfile       print $logfile 
 "\n\n================= Publish ".localtime()." Phase One  ================\n";  "\n\n================= Publish ".localtime()." Phase One  ================\n";
Line 823  sub publish { Line 823  sub publish {
     print $logfile "Copied original file to ".$copyfile."\n";      print $logfile "Copied original file to ".$copyfile."\n";
         } else {          } else {
     print $logfile "Unable to write backup ".$copyfile.':'.$!."\n";      print $logfile "Unable to write backup ".$copyfile.':'.$!."\n";
     return ("<font color=red>Failed to write backup copy, $!,FAIL</font>",1);      return ("<font color=\"red\">Failed to write backup copy, $!,FAIL</font>",1);
         }          }
 # ------------------------------------------------------------- IDs and indices  # ------------------------------------------------------------- IDs and indices
   
Line 1202  sub phasetwo { Line 1202  sub phasetwo {
   
     if ($target=~/\_\_\_/) {      if ($target=~/\_\_\_/) {
  $r->print(   $r->print(
  '<font color=red>Unsupported character combination "<tt>___</tt>" in filename, FAIL</font>');   '<font color="red">Unsupported character combination "<tt>___</tt>" in filename, FAIL</font>');
         return 0;          return 0;
     }      }
     $distarget=~s/\/+/\//g;      $distarget=~s/\/+/\//g;
     my $logfile;      my $logfile;
     unless ($logfile=Apache::File->new('>>'.$source.'.log')) {      unless ($logfile=Apache::File->new('>>'.$source.'.log')) {
  $r->print(   $r->print(
         '<font color=red>No write permission to user directory, FAIL</font>');          '<font color="red">No write permission to user directory, FAIL</font>');
         return 0;          return 0;
     }      }
     print $logfile       print $logfile 
Line 1250  sub phasetwo { Line 1250  sub phasetwo {
         my $mfh;          my $mfh;
         unless ($mfh=Apache::File->new('>'.$source.'.meta')) {          unless ($mfh=Apache::File->new('>'.$source.'.meta')) {
             return               return 
                 '<font color=red>Could not write metadata, FAIL</font>';                  '<font color="red">Could not write metadata, FAIL</font>';
         }          }
         foreach (sort keys %metadatafields) {          foreach (sort keys %metadatafields) {
             unless ($_=~/\./) {              unless ($_=~/\./) {
Line 1302  sub phasetwo { Line 1302  sub phasetwo {
         my $srcd=$1;          my $srcd=$1;
         unless ($srcd=~/^\/home\/httpd\/html\/res/) {          unless ($srcd=~/^\/home\/httpd\/html\/res/) {
             print $logfile "\nPANIC: Target dir is ".$srcd;              print $logfile "\nPANIC: Target dir is ".$srcd;
             return "<font color=red>Invalid target directory, FAIL</font>";              return "<font color=\"red\">Invalid target directory, FAIL</font>";
         }          }
         opendir(DIR,$srcd);          opendir(DIR,$srcd);
         while ($filename=readdir(DIR)) {          while ($filename=readdir(DIR)) {
Line 1327  sub phasetwo { Line 1327  sub phasetwo {
             $r->print('<p>Copied old target file');              $r->print('<p>Copied old target file');
         } else {          } else {
     print $logfile "Unable to write ".$copyfile.':'.$!."\n";      print $logfile "Unable to write ".$copyfile.':'.$!."\n";
             return "<font color=red>Failed to copy old target, $!, FAIL</font>";              return "<font color=\"red\">Failed to copy old target, $!, FAIL</font>";
         }          }
                   
 # --------------------------------------------------------------- Copy Metadata  # --------------------------------------------------------------- Copy Metadata
Line 1341  sub phasetwo { Line 1341  sub phasetwo {
     print $logfile "Unable to write metadata ".$copyfile.':'.$!."\n";      print $logfile "Unable to write metadata ".$copyfile.':'.$!."\n";
             if (-e $target.'.meta') {              if (-e $target.'.meta') {
                 return                   return 
                     "<font color=red>Failed to write old metadata copy, $!, FAIL</font>";                      "<font color=\"red\">Failed to write old metadata copy, $!, FAIL</font>";
     }      }
         }          }
                   
Line 1372  sub phasetwo { Line 1372  sub phasetwo {
         $r->print('<p>Copied source file');          $r->print('<p>Copied source file');
     } else {      } else {
         print $logfile "\nUnable to write ".$copyfile.':'.$!."\n";          print $logfile "\nUnable to write ".$copyfile.':'.$!."\n";
         return "<font color=red>Failed to copy source, $!, FAIL</font>";          return "<font color=\"red\">Failed to copy source, $!, FAIL</font>";
     }      }
           
 # --------------------------------------------------------------- Copy Metadata  # --------------------------------------------------------------- Copy Metadata
Line 1385  sub phasetwo { Line 1385  sub phasetwo {
     } else {      } else {
         print $logfile "\nUnable to write metadata ".$copyfile.':'.$!."\n";          print $logfile "\nUnable to write metadata ".$copyfile.':'.$!."\n";
         return           return 
             "<font color=red>Failed to write metadata copy, $!, FAIL</font>";              "<font color=\"red\">Failed to write metadata copy, $!, FAIL</font>";
     }      }
     $r->rflush;      $r->rflush;
 # --------------------------------------------------- Send update notifications  # --------------------------------------------------- Send update notifications

Removed from v.1.113  
changed lines
  Added in v.1.114


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>