--- loncom/interface/lonmenu.pm 2006/09/05 17:35:10 1.205 +++ loncom/interface/lonmenu.pm 2006/12/05 02:55:53 1.206 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines to control the menu # -# $Id: lonmenu.pm,v 1.205 2006/09/05 17:35:10 albertel Exp $ +# $Id: lonmenu.pm,v 1.206 2006/12/05 02:55:53 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -44,8 +44,7 @@ use Apache::lonhtmlcommon(); use Apache::loncommon(); use Apache::lonenc(); use Apache::lonlocal; -use lib '/home/httpd/lib/perl/'; -use LONCAPA; +use LONCAPA qw{:DEFAULT :match); use vars qw(@desklines $readdesk); @@ -408,7 +407,7 @@ sub innerregister { my $desc = "Enter my resource construction space"; # Set defaults for co-authors if ($env{'request.role'} =~ /^ca/) { - ($cadom,$caname)=($env{'request.role'}=~/(\w+)\/(\w+)$/); + ($cadom,$caname)=($env{'request.role'}=~/($match_domain)\/($match_username)$/); ($top,$bottom) = ('co con-','struct'); $action = "go('/priv/".$caname."');"; $desc = "Enter construction space as co-author"; @@ -430,7 +429,7 @@ sub innerregister { my $cfudom=''; if ($env{'request.filename'}) { my $file=&Apache::lonnet::declutter($env{'request.filename'}); - $file=~s/^(\w+)\/(\w+)/\/priv\/$2/; + $file=~s/^($match_domain)\/($match_username)/\/priv\/$2/; # Check that the user has permission to edit this resource ($cfuname,$cfudom)=&Apache::loncacc::constructaccess($file,$1); if (defined($cfudom)) { @@ -989,7 +988,7 @@ sub rawconfig { my $caname=$env{'user.name'}; if ($prt eq 'rca') { ($cadom,$caname)= - ($env{'request.role'}=~/(\w+)\/(\w+)$/); + ($env{'request.role'}=~/($match_domain)\/($match_username)$/); } $act =~ s/\$caname/$caname/g; my $home = &Apache::lonnet::homeserver($caname,$cadom);