[LON-CAPA-cvs] cvs: loncom(version_2_0_X) /lonnet/perl lonnet.pm

albertel lon-capa-cvs@mail.lon-capa.org
Tue, 13 Sep 2005 19:45:15 -0000


albertel		Tue Sep 13 15:45:15 2005 EDT

  Modified files:              (Branch: version_2_0_X)
    /loncom/lonnet/perl	lonnet.pm 
  Log:
  - backport 1.655 1.656
  
  
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.651.2.2 loncom/lonnet/perl/lonnet.pm:1.651.2.3
--- loncom/lonnet/perl/lonnet.pm:1.651.2.2	Thu Sep  1 02:48:05 2005
+++ loncom/lonnet/perl/lonnet.pm	Tue Sep 13 15:45:11 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.651.2.2 2005/09/01 06:48:05 albertel Exp $
+# $Id: lonnet.pm,v 1.651.2.3 2005/09/13 19:45:11 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1709,7 +1709,11 @@
 	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;
@@ -2478,8 +2482,12 @@
 	    
             my ($trole,$tend,$tstart);
 	    if ($role=~/^cr/) { 
-		($trole,my $trest)=($role=~m|^(cr/\w+/\w+/[a-zA-Z0-9]+)_(.*)$|);
-		($tend,$tstart)=split('_',$trest);
+		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);
+		} else {
+		    $trole=$role;
+		}
 	    } else {
 		($trole,$tend,$tstart)=split(/_/,$role);
 	    }