--- loncom/auth/lonroles.pm 2006/07/14 17:05:02 1.163 +++ loncom/auth/lonroles.pm 2006/12/05 02:55:56 1.172 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # User Roles Screen # -# $Id: lonroles.pm,v 1.163 2006/07/14 17:05:02 www Exp $ +# $Id: lonroles.pm,v 1.172 2006/12/05 02:55:56 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -40,8 +40,9 @@ use Apache::lonhtmlcommon; use Apache::lonannounce; use Apache::lonlocal; use Apache::lonpageflip(); +use Apache::lonnavdisplay(); use GDBM_File; -use LONCAPA; +use LONCAPA qw(:DEFAULT :match); sub redirect_user { @@ -53,8 +54,8 @@ sub redirect_user { my $swinfo=&Apache::lonmenu::rawconfig(); my $navwindow; if ($launch_nav eq 'on') { - $navwindow.=&Apache::lonnavmaps::launch_win('now',undef,undef, - ($url =~ m-^/adm/whatsnew-)); + $navwindow.=&Apache::lonnavdisplay::launch_win('now',undef,undef, + ($url =~ m-^/adm/whatsnew-)); } else { $navwindow.=&Apache::lonnavmaps::close(); } @@ -125,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_courseid)$-)) { if ($dcroles{$domain}) { &check_privs($domain,$coursenum,$then,$now); } @@ -164,7 +165,7 @@ sub handler { my $authnum=$cnum; if ($env{'course.'.$cdom.'_'.$cnum.'.keyauth'}) { ($authnum,$authdom)= - split(/\W/,$env{'course.'.$cdom.'_'.$cnum.'.keyauth'}); + split(/:/,$env{'course.'.$cdom.'_'.$cnum.'.keyauth'}); } # check with key authority unless (&Apache::lonnet::validate_access_key( @@ -312,7 +313,7 @@ ENDENTERKEY } } # Are we allowed to look at the first resource? - if (!&Apache::lonnet::allowed('bre',$furl)) { + if ($furl !~ m|^/adm/|) { # Guess not ... $furl=&Apache::lonpageflip::first_accessible_resource(); } @@ -485,8 +486,11 @@ ENDHEADER $tstatus='selected'; } my $tbg; - if (($tstatus eq 'is') || ($tstatus eq 'selected') || - ($env{'form.showall'})) { + if (($tstatus eq 'is') + || ($tstatus eq 'selected') + || ($tstatus eq 'will') + || ($tstatus eq 'future') + || ($env{'form.showall'})) { if ($tstatus eq 'is') { $tbg='#77FF77'; $tfont='#003300'; @@ -659,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) { @@ -686,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,''); } @@ -831,7 +836,7 @@ sub build_roletext { $roletext.='