Diff for /loncom/publisher/lonupload.pm between versions 1.53.2.1 and 1.54

version 1.53.2.1, 2011/11/07 13:38:45 version 1.54, 2011/10/23 23:46:07
Line 256  sub phasetwo { Line 256  sub phasetwo {
     &Debug($r, "Filename is ".$tfn);      &Debug($r, "Filename is ".$tfn);
     if ($tfn) {      if ($tfn) {
  &Debug($r, "Filename for tfn = ".$tfn);   &Debug($r, "Filename for tfn = ".$tfn);
  my $target='/home/'.$uname.'/public_html'.$tfn;   my $target='/home/httpd/html/priv/'.$udom.'/'.$uname.'/'.$tfn;
  &Debug($r, "target -> ".$target);   &Debug($r, "target -> ".$target);
 #     target is the full filesystem path of the destination file.  #     target is the full filesystem path of the destination file.
  my $base = &File::Basename::basename($fn);   my $base = &File::Basename::basename($fn);
Line 407  sub phasethree { Line 407  sub phasethree {
     } elsif ($mode eq 'imsimport') {      } elsif ($mode eq 'imsimport') {
         $action = '/adm/imsimport';          $action = '/adm/imsimport';
     }      }
     my $dir_root = '/home/'.$uname.'/public_html';      my $dir_root = '/home/httpd/html/priv/'.$udom.'/'.$uname;
     my $url_root = '/priv/'.$uname;      my $url_root = '/priv/'.$udom.'/'.$uname;
     my $path = &File::Basename::dirname($fn);      my $path = &File::Basename::dirname($fn);
     my $filename = &HTML::Entities::encode($env{'form.filename'},'<>&"');      my $filename = &HTML::Entities::encode($env{'form.filename'},'<>&"');
     my $state = &embedded_form_elems('modify_orightml',$filename,$mode).      my $state = &embedded_form_elems('modify_orightml',$filename,$mode).
Line 444  sub phasefour { Line 444  sub phasefour {
         $action = '/adm/imsimport';          $action = '/adm/imsimport';
     }      }
     my $result;      my $result;
     my $dir_root = '/home/'.$uname.'/public_html';      my $dir_root = '/home/httpd/html/priv/'.$udom.'/'.$uname;
     my $url_root = '/priv/'.$uname;      my $url_root = '/priv/'.$udom.'/'.$uname;
     my $path = &File::Basename::dirname($fn);      my $path = &File::Basename::dirname($fn);
     $result .= &Apache::loncommon::modify_html_refs($mode,$path,      $result .= &Apache::loncommon::modify_html_refs($mode,$path,
                               $uname,$udom,$dir_root);                                $uname,$udom,$dir_root);
Line 503  function verifyForm() { Line 503  function verifyForm() {
  return HTTP_NOT_ACCEPTABLE;   return HTTP_NOT_ACCEPTABLE;
     }      }
           
     my ($fn,$trailfile);      my $fn;
     if ($env{'form.filename'}) {      if ($env{'form.filename'}) {
  $fn=$env{'form.filename'};   $fn=$env{'form.filename'};
  $fn=~s/^https?\:\/\/[^\/]+\///;   $fn=~s/^https?\:\/\/[^\/]+\///;
  $fn=~s/^\///;   $fn=~s/^\///;
  $fn=~s{(~|priv/)($LONCAPA::username_re)}{};   $fn=~s{(~|priv/)($LONCAPA::username_re)}{};
  $fn=~s/\/+/\//g;   $fn=~s/\/+/\//g;
         $trailfile = "/home/$uname/public_html/".$trailfile;  
         $trailfile=~s{//+}{/}g;  
     } else {      } else {
  $r->log_reason($env{'user.name'}.' at '.$env{'user.domain'}.   $r->log_reason($env{'user.name'}.' at '.$env{'user.domain'}.
        ' unspecified filename for upload', $r->filename);          ' unspecified filename for upload', $r->filename); 
Line 536  function verifyForm() { Line 534  function verifyForm() {
                                              $javascript,                                               $javascript,
                                              {'bread_crumbs' => $brcrum,})                                               {'bread_crumbs' => $brcrum,})
              .&Apache::loncommon::head_subbox(               .&Apache::loncommon::head_subbox(
                 &Apache::loncommon::CSTR_pageheader($trailfile))                  &Apache::loncommon::CSTR_pageheader())
     );      );
       
     if (($uname ne $env{'user.name'}) || ($udom ne $env{'user.domain'})) {      if (($uname ne $env{'user.name'}) || ($udom ne $env{'user.domain'})) {

Removed from v.1.53.2.1  
changed lines
  Added in v.1.54


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