--- loncom/auth/lonroles.pm 2006/10/20 22:05:55 1.169 +++ loncom/auth/lonroles.pm 2006/11/23 01:49:41 1.170 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # User Roles Screen # -# $Id: lonroles.pm,v 1.169 2006/10/20 22:05:55 albertel Exp $ +# $Id: lonroles.pm,v 1.170 2006/11/23 01:49:41 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -42,7 +42,7 @@ use Apache::lonlocal; use Apache::lonpageflip(); use Apache::lonnavdisplay(); use GDBM_File; -use LONCAPA; +use LONCAPA qw(:DEFAULT :match); sub redirect_user { @@ -126,7 +126,7 @@ sub handler { if ($numdc > 0) { foreach my $envkey (keys %env) { if (my ($domain,$coursenum) = - ($envkey =~ m-^form\.cc\./(\w+)/(\w+)$-)) { + ($envkey =~ m-^form\.cc\./($match_domain)/($match_username)$-)) { if ($dcroles{$domain}) { &check_privs($domain,$coursenum,$then,$now); } @@ -663,7 +663,8 @@ ENDHEADER foreach (sort(keys(%recent_roles))) { if (defined($roletext{'user.role.'.$_})) { $output.=$roletext{'user.role.'.$_}; - if ($_ =~ m-dc\./(\w+)/- && $dcroles{$1}) { + if ($_ =~ m-dc\./($match_domain)/- + && $dcroles{$1}) { $output .= &allcourses_row($1,'recent'); } } elsif ($numdc > 0) { @@ -690,7 +691,7 @@ ENDHEADER foreach my $which (sort {uc($a) cmp uc($b)} (keys(%sortrole))) { if ($roleclass{$sortrole{$which}} =~ /^\Q$type\E/) { $output.=$roletext{$sortrole{$which}}; - if ($sortrole{$which} =~ m-dc\./(\w+)/-) { + if ($sortrole{$which} =~ m-dc\./($match_domain)/-) { if ($dcroles{$1}) { $output .= &allcourses_row($1,''); } @@ -890,7 +891,7 @@ sub check_fordc { my $numdc = 0; if ($env{'user.adv'}) { foreach my $envkey (sort keys %env) { - if ($envkey=~/^user\.role\.dc\.\/(\w+)\/$/) { + if ($envkey=~/^user\.role\.dc\.\/($match_domain)\/$/) { my $dcdom = $1; my $livedc = 1; my ($tstart,$tend)=split(/\./,$env{$envkey}); @@ -987,7 +988,7 @@ sub display_cc_role { my $advanced = $env{'user.adv'}; my $tryagain = $env{'form.tryagain'}; unless ($rolekey =~/^error\:/) { - if ($rolekey =~ m-^user\.role.cc\./(\w+)/(\w+)$-) { + if ($rolekey =~ m-^user\.role.cc\./($match_domain)/($match_username)$-) { my $tcourseid = $1.'_'.$2; my $trolecode = 'cc./'.$1.'/'.$2; my $twhere;