Diff for /loncom/publisher/loncfile.pm between versions 1.44 and 1.45

version 1.44, 2003/11/19 14:57:32 version 1.45, 2003/11/19 15:06:33
Line 73  use Apache::Log (); Line 73  use Apache::Log ();
 use Apache::lonnet;  use Apache::lonnet;
 use Apache::loncommon();  use Apache::loncommon();
   
 my $DEBUG=2;  my $DEBUG=0;
 my $r; # Needs to be global for some stuff RF.  my $r; # Needs to be global for some stuff RF.
   
 =pod  =pod
Line 110  sub Debug { Line 110  sub Debug {
   # Put out the indicated message butonly if DEBUG is true.    # Put out the indicated message butonly if DEBUG is true.
       
   if ($DEBUG) {    if ($DEBUG) {
    $r->log_reason($message);    $log->debug($message);
   }    }
 }  }
   
 =pod  =pod
   
 =item checksuffix($old, $new)  
           
   Determine if a resource filename suffix (the stuff after the .) would change  
 as a result of this operation.  
   
  Parameters:  
   
 =over 4  
   
 =item  $old   = string [in]  Previous filename.  
   
 =item  $new   = string [in]  Resultant filename.  
   
 =back  
   
 =cut  
   
 =pod  
   
 =item URLToPath($url)  =item URLToPath($url)
   
   Convert a URL to a file system path.    Convert a URL to a file system path.
Line 717  sub phaseone { Line 698  sub phaseone {
       
   my $newfilename=&cleanDest($r,$ENV{'form.newfilename'});    my $newfilename=&cleanDest($r,$ENV{'form.newfilename'});
   $newfilename=&relativeDest($fn,$newfilename,$uname);    $newfilename=&relativeDest($fn,$newfilename,$uname);
  &Debug($r, "Newfile: $newfilename");  
   $r->print('<form action="/adm/cfile" method="post">'.    $r->print('<form action="/adm/cfile" method="post">'.
       '<input type="hidden" name="qualifiedfilename" value="'.$fn.'" />'.        '<input type="hidden" name="qualifiedfilename" value="'.$fn.'" />'.
       '<input type="hidden" name="phase" value="two" />'.        '<input type="hidden" name="phase" value="two" />'.
Line 728  sub phaseone { Line 708  sub phaseone {
   } elsif ($ENV{'form.action'} eq 'delete') {     } elsif ($ENV{'form.action'} eq 'delete') { 
       &Delete1($r, $uname, $udom, $fn);        &Delete1($r, $uname, $udom, $fn);
   } elsif ($ENV{'form.action'} eq 'decompress') {    } elsif ($ENV{'form.action'} eq 'decompress') {
  &Apache::lonnet::appenv('cgi.path' => $newfilename);   
       &Decompress1($r, $uname, $udom, $fn);        &Decompress1($r, $uname, $udom, $fn);
   } elsif ($ENV{'form.action'} eq 'copy') {     } elsif ($ENV{'form.action'} eq 'copy') { 
       if($newfilename) {        if($newfilename) {
Line 1114  sub handler { Line 1093  sub handler {
       $fn=&Apache::lonnet::unescape($ENV{'form.filename'});        $fn=&Apache::lonnet::unescape($ENV{'form.filename'});
       $fn=&URLToPath($fn);        $fn=&URLToPath($fn);
   }      }  
    #Just hijack the script only the first time around to inject the correct information for further processing
     elsif($ENV{'QUERY_STRING'} && $ENV{'form.phase'} ne 'two') {      elsif($ENV{'QUERY_STRING'} && $ENV{'form.phase'} ne 'two') {
   &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['decompress']);    &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['decompress']);
  $fn=&Apache::lonnet::unescape($ENV{'form.decompress'});   $fn=&Apache::lonnet::unescape($ENV{'form.decompress'});

Removed from v.1.44  
changed lines
  Added in v.1.45


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