--- loncom/publisher/lonretrieve.pm 2009/08/11 15:15:01 1.41 +++ loncom/publisher/lonretrieve.pm 2011/10/31 01:30:38 1.45 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to retrieve an old version of a file # -# $Id: lonretrieve.pm,v 1.41 2009/08/11 15:15:01 bisitz Exp $ +# $Id: lonretrieve.pm,v 1.45 2011/10/31 01:30:38 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -121,7 +121,7 @@ sub phaseone { if (-e $resfn) { $r->print('
'. - ''. + ''. ''. &Apache::loncommon::start_data_table(). &Apache::loncommon::start_data_table_header_row(). @@ -162,8 +162,8 @@ sub phaseone { if ($is_meta || &Apache::loncommon::fileembstyle($suffix) eq 'ssi') { $r->print( - ''.&mt('Diffs with Version').' '.$version. ''); @@ -185,8 +185,8 @@ sub phaseone { if ($is_meta || &Apache::loncommon::fileembstyle($suffix) eq 'ssi') { $r->print( - ''.&mt('Diffs with current Version').''); } @@ -209,7 +209,7 @@ sub phaseone { .'/'; $r->print(&Apache::lonhtmlcommon::start_funclist() .&Apache::lonhtmlcommon::add_item_funclist( - '' + '' .&mt('Back to Resource') .'') .&Apache::lonhtmlcommon::add_item_funclist( @@ -233,7 +233,7 @@ sub phasetwo { my ($main,$suffix,$is_meta) = &get_file_info($fn); my $logfile; - my $ctarget='/home/'.$uname.'/public_html'.$fn; + my $ctarget=$r->dir_config('lonDocRoot').'/priv/'.$udom.'/'.$uname.$fn; my $vfn=$fn; if ($version ne 'new') { $vfn=~s/\.(\Q$suffix\E)$/\.$version\.$1/; @@ -266,7 +266,7 @@ sub phasetwo { print $logfile "Copy failed: $error\n\n"; } $r->print('

' - .'

' + .'

' .&mt('Back to Resource') .'

'); } else { @@ -319,9 +319,8 @@ sub handler { my $uname; my $udom; - ($uname,$udom)= - &Apache::loncacc::constructaccess($fn,$r->dir_config('lonDefDomain')); - unless (($uname) && ($udom)) { + ($uname,$udom) = &Apache::loncacc::constructaccess($fn); + unless (($uname ne '') && ($udom ne '')) { $r->log_reason($uname.' at '.$udom. ' trying to publish file '.$env{'form.filename'}. ' ('.$fn.') - not authorized', @@ -329,7 +328,7 @@ sub handler { 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'); $r->send_http_header; @@ -357,7 +356,7 @@ sub handler { .'

'); if (($uname ne $env{'user.name'}) || ($udom ne $env{'user.domain'})) { - $r->print('

' + $r->print('

' .&mt('Co-Author [_1]' ,&Apache::loncommon::plainname($uname,$udom) .' ('.$uname.':'.$udom.')')