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

version 1.44, 2011/10/24 22:10:21 version 1.45, 2011/10/31 01:30:38
Line 121  sub phaseone { Line 121  sub phaseone {
           
     if (-e $resfn) {        if (-e $resfn) {  
  $r->print('<form action="/adm/retrieve" method="post">'.   $r->print('<form action="/adm/retrieve" method="post">'.
   '<input type="hidden" name="filename" value="/~'.$uname.$fn.'" />'.    '<input type="hidden" name="filename" value="/priv/'.$udom.'/'.$uname.$fn.'" />'.
   '<input type="hidden" name="phase" value="two" />'.    '<input type="hidden" name="phase" value="two" />'.
   &Apache::loncommon::start_data_table().    &Apache::loncommon::start_data_table().
   &Apache::loncommon::start_data_table_header_row().    &Apache::loncommon::start_data_table_header_row().
Line 162  sub phaseone { Line 162  sub phaseone {
  if ($is_meta   if ($is_meta
     || &Apache::loncommon::fileembstyle($suffix) eq 'ssi') {      || &Apache::loncommon::fileembstyle($suffix) eq 'ssi') {
     $r->print(      $r->print(
       '<td><a target="cat" href="/adm/diff?filename=/~'.        '<td><a target="cat" href="/adm/diff?filename=/priv/'.
       $uname.$fn.        $udom,'/'.$uname.$fn.
       '&amp;versiontwo=priv&amp;versionone='.$version.        '&amp;versiontwo=priv&amp;versionone='.$version.
       '">'.&mt('Diffs with Version').' '.$version.        '">'.&mt('Diffs with Version').' '.$version.
       '</a></td>');        '</a></td>');
Line 185  sub phaseone { Line 185  sub phaseone {
  if ($is_meta    if ($is_meta 
     || &Apache::loncommon::fileembstyle($suffix) eq 'ssi') {      || &Apache::loncommon::fileembstyle($suffix) eq 'ssi') {
     $r->print(      $r->print(
       '<td><a target="cat" href="/adm/diff?filename=/~'.        '<td><a target="cat" href="/adm/diff?filename=/priv/'.
       $uname.$fn.        $udom.'/'.$uname.$fn.
       '&amp;versiontwo=priv'.        '&amp;versiontwo=priv'.
       '">'.&mt('Diffs with current Version').'</a></td>');        '">'.&mt('Diffs with current Version').'</a></td>');
  }   }
Line 319  sub handler { Line 319  sub handler {
   my $uname;    my $uname;
   my $udom;    my $udom;
   
   ($uname,$udom)=    ($uname,$udom) = &Apache::loncacc::constructaccess($fn);
     &Apache::loncacc::constructaccess($fn,$r->dir_config('lonDefDomain'));    unless (($uname ne '') && ($udom ne '')) {
   unless (($uname) && ($udom)) {  
      $r->log_reason($uname.' at '.$udom.       $r->log_reason($uname.' at '.$udom.
          ' trying to publish file '.$env{'form.filename'}.           ' trying to publish file '.$env{'form.filename'}.
          ' ('.$fn.') - not authorized',            ' ('.$fn.') - not authorized', 
Line 329  sub handler { Line 328  sub handler {
      return HTTP_NOT_ACCEPTABLE;       return HTTP_NOT_ACCEPTABLE;
   }    }
   
   $fn=~s{/~($LONCAPA::username_re)}{};    $fn=~s{/priv/$LONCAPA::domain_re/$LONCAPA::username_re}{};
   
   &Apache::loncommon::content_type($r,'text/html');    &Apache::loncommon::content_type($r,'text/html');
   $r->send_http_header;    $r->send_http_header;

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


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