--- loncom/lonnet/perl/lonnet.pm 2005/10/12 16:50:37 1.663 +++ loncom/lonnet/perl/lonnet.pm 2005/10/18 21:29:35 1.666 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.663 2005/10/12 16:50:37 raeburn Exp $ +# $Id: lonnet.pm,v 1.666 2005/10/18 21:29:35 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1862,10 +1862,11 @@ sub dcmaildump { foreach my $tryserver (keys(%libserv)) { if ($hostdom{$tryserver} eq $dom) { %{$returnhash{$tryserver}}=(); - foreach ( - split(/\&/,&reply('dcmaildump:'.$dom.':'. - &escape($startdate).':'.&escape($enddate).':'. - &escape($senders), $tryserver))) { + my $cmd='dcmaildump:'.$dom.':'. + &escape($startdate).':'.&escape($enddate).':'; + my @esc_senders=map { &escape($_)} @$senders; + $cmd.=&escape(join('&',@esc_senders)); + foreach (split(/\&/,&reply($cmd,$tryserver))) { my ($key,$value) = split(/\=/,$_); if (($key) && ($value)) { $returnhash{$tryserver}{&unescape($key)} = &unescape($value); @@ -3075,9 +3076,10 @@ sub allowed { $thisallowed.=$1; } -# URI is an uploaded document for this course +# URI is an uploaded document for this course, default permissions don't matter # not allowing 'edit' access (editupload) to uploaded course docs if (($priv eq 'bre') && ($uri=~m|^uploaded/|)) { + $thisallowed=''; my $refuri=$env{'httpref.'.$orguri}; if ($refuri) { if ($refuri =~ m|^/adm/|) { @@ -5785,14 +5787,15 @@ sub filelocation { sub hreflocation { my ($dir,$file)=@_; unless (($file=~m-^http://-i) || ($file=~m-^/-)) { - my $finalpath=filelocation($dir,$file); - $finalpath=~s-^/home/httpd/html--; - $finalpath=~s-^/home/(\w+)/public_html/-/~$1/-; - return $finalpath; - } elsif ($file=~m-^/home-) { - $file=~s-^/home/httpd/html--; + $file=filelocation($dir,$file); + } + if ($file=~m-^\Q$perlvar{'lonDocRoot'}\E-) { + $file=~s-^\Q$perlvar{'lonDocRoot'}\E--; + } elsif ($file=~m-/home/(\w+)/public_html/-) { $file=~s-^/home/(\w+)/public_html/-/~$1/-; - return $file; + } elsif ($file=~m-^\Q$perlvar{'lonUsersDir'}\E-) { + $file=~s-^/home/httpd/lonUsers/([^/]*)/./././([^/]*)/userfiles/ + -/uploaded/$1/$2/-x; } return $file; }