--- loncom/publisher/londiff.pm 2011/10/23 23:46:07 1.29 +++ loncom/publisher/londiff.pm 2011/10/29 19:11:46 1.30 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to show differences between file versions # -# $Id: londiff.pm,v 1.29 2011/10/23 23:46:07 www Exp $ +# $Id: londiff.pm,v 1.30 2011/10/29 19:11:46 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -84,7 +84,7 @@ sub handler { if ($env{'form.filename'}=~/^\/res\//) { ($cudom,$cuname,$env{'form.filename'})= - ($env{'form.filename'}=~m{^/res/($LONCAPA::domain_re)/($LONCAPA::username_re)/(.*)$}); + ($env{'form.filename'}=~m{^/res/($LONCAPA::domain_re)/($LONCAPA::username_re)(/.*)$}); } else { unless (($cuname,$cudom)= &Apache::loncacc::constructaccess($env{'form.filename'}, @@ -99,7 +99,7 @@ sub handler { my $efn=$env{'form.filename'}; - $efn=~s{/\~($LONCAPA::username_re)}{}g; + $efn=~s{^/priv/$LONCAPA::domain_re/$LONCAPA::username_re}{}; my @f1=(); my @f2=(); @@ -127,12 +127,11 @@ sub handler { || $efn =~ /\.meta$/) { $r->print('

'); if ($env{'form.versionone'} eq 'priv') { - my $fn='/home/httpd/html/priv/'.$cudom.'/'.$cuname.'/'.$efn; + my $fn=$r->dir_config('lonDocRoot')."/priv/$cudom/$cuname".$efn; @f1=&get_split_file($fn,'local'); $r->print(''.&mt('Construction Space Version').''); } else { - my $fn= - '/home/httpd/html/res/'.$cudom.'/'.$cuname.'/'; + my $fn=$r->dir_config('lonDocRoot')."/res/$cudom/$cuname"; if ($env{'form.versionone'}) { my ($main,$suffix,$is_meta)= &Apache::lonretrieve::get_file_info($efn); @@ -152,12 +151,12 @@ sub handler { if ($env{'form.filetwo'}) { my $efn2=$env{'form.filetwo'}; - $efn2=~s{/\~($LONCAPA::username_re)}{}g; - my $fn='/home/httpd/html/priv/'.$cudom.'/'.$cuname.'/'.$efn2; + $efn2=~s{^/priv/$LONCAPA::domain_re/$LONCAPA::username_re}{}; + my $fn=$r->dir_config('lonDocRoot')."/priv/$cudom/$cuname".$efn2; @f2=&get_split_file($fn,'local'); $r->print(''.$efn2.''); } elsif ($env{'form.versiontwo'} eq 'priv') { - my $fn='/home/httpd/html/priv/'.$cudom.'/'.$cuname.'/'.$efn; + my $fn=$r->dir_config('lonDocRoot')."/priv/$cudom/$cuname".$efn; @f2=&get_split_file($fn,'local'); $r->print(''.&mt('Construction Space Version').''); } else {