--- loncom/interface/lonmenu.pm 2011/10/24 23:29:33 1.354 +++ loncom/interface/lonmenu.pm 2011/10/31 13:44:30 1.356 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines to control the menu # -# $Id: lonmenu.pm,v 1.354 2011/10/24 23:29:33 www Exp $ +# $Id: lonmenu.pm,v 1.356 2011/10/31 13:44:30 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -491,9 +491,12 @@ sub innerregister { $uploaded = &is_course_upload($file,$cnum,$cdom); } if (!$uploaded) { - $file=~s/^($match_domain)\/($match_username)/\/priv\/$1\/$2/; + + $file=~s{^($match_domain)/($match_username)}{/priv/$1/$2}; + # Check that the user has permission to edit this resource - ($cfuname,$cfudom)=&Apache::loncacc::constructaccess($file); + my $setpriv = 1; + ($cfuname,$cfudom)=&Apache::loncacc::constructaccess($file,$setpriv); if (defined($cfudom)) { $home=&Apache::lonnet::homeserver($cfuname,$cfudom); my $allowed=0; @@ -575,9 +578,9 @@ sub innerregister { # We are in construction space # - + my $londocroot = $Apache::lonnet::perlvar{'lonDocRoot'}; my ($udom,$uname,$thisdisfn) = - ($env{'request.filename'}=~m|^/home/httpd/html/priv/([^/]+)/([^/]+)/(.*)$|); + ($env{'request.filename'}=~m{^\Q$londocroot/priv/\E([^/]+)/([^/]+)/(.*)$}); my $currdir = '/priv/'.$udom.'/'.$uname.'/'.$thisdisfn; if ($currdir =~ m-/$-) { $is_const_dir = 1;