--- loncom/lonnet/perl/lonnet.pm 2005/09/13 19:45:11 1.651.2.3 +++ loncom/lonnet/perl/lonnet.pm 2005/09/13 19:33:58 1.655 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.651.2.3 2005/09/13 19:45:11 albertel Exp $ +# $Id: lonnet.pm,v 1.655 2005/09/13 19:33:58 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -767,6 +767,13 @@ sub validate_access_key { } # ------------------------------------- Find the section of student in a course +sub devalidate_getsection_cache { + my ($udom,$unam,$courseid)=@_; + $courseid=~s/\_/\//g; + $courseid=~s/^(\w)/\/$1/; + my $hashid="$udom:$unam:$courseid"; + &devalidate_cache_new('getsection',$hashid); +} sub getsection { my ($udom,$unam,$courseid)=@_; @@ -1709,11 +1716,7 @@ sub get_course_adv_roles { if ($username eq '' || $domain eq '') { next; } if ((&privileged($username,$domain)) && (!$nothide{$username.':'.$domain})) { next; } - if ($role eq 'cr') { next; } my $key=&plaintext($role); - if ($role =~ /^cr/) { - $key=(split('/',$role))[3]; - } if ($section) { $key.=' (Sec/Grp '.$section.')'; } if ($returnhash{$key}) { $returnhash{$key}.=','.$username.':'.$domain; @@ -2482,6 +2485,7 @@ sub rolesinit { my ($trole,$tend,$tstart); if ($role=~/^cr/) { + &logthis(" $role $area "); if ($role=~m|^(cr/\w+/\w+/[a-zA-Z0-9]+)_(.*)$|) { ($trole,my $trest)=($role=~m|^(cr/\w+/\w+/[a-zA-Z0-9]+)_(.*)$|); ($tend,$tstart)=split('_',$trest); @@ -3775,6 +3779,8 @@ sub modify_student_enrollment { $cdom,$cnum); unless (($reply eq 'ok') || ($reply eq 'delayed')) { return 'error: '.$reply; + } else { + &devalidate_getsection_cache($udom,$uname,$cid); } # Add student role to user my $uurl='/'.$cid; @@ -5890,7 +5896,7 @@ BEGIN { } close($config); # FIXME: dev server don't want this, production servers _do_ want this - &get_iphost(); + #&get_iphost(); } sub get_iphost {