[LON-CAPA-cvs] cvs: loncom /auth lonroles.pm

albertel lon-capa-cvs@mail.lon-capa.org
Fri, 02 Jun 2006 21:22:12 -0000


albertel		Fri Jun  2 17:22:12 2006 EDT

  Modified files:              
    /loncom/auth	lonroles.pm 
  Log:
  -make use of new hash interface
  
  
Index: loncom/auth/lonroles.pm
diff -u loncom/auth/lonroles.pm:1.153 loncom/auth/lonroles.pm:1.154
--- loncom/auth/lonroles.pm:1.153	Fri Jun  2 09:58:37 2006
+++ loncom/auth/lonroles.pm	Fri Jun  2 17:22:10 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # User Roles Screen
 #
-# $Id: lonroles.pm,v 1.153 2006/06/02 13:58:37 raeburn Exp $
+# $Id: lonroles.pm,v 1.154 2006/06/02 21:22:10 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1037,17 +1037,11 @@
     my $area = '/'.$dcdom.'/'.$pickedcourse;
     my $role = 'cc';
     my $spec = $role.'.'.$area;
-    my $userroles = &Apache::lonnet::set_arearole($role,$area,'','',$dcdom,$env{'user.name'});
+    my %userroles = &Apache::lonnet::set_arearole($role,$area,'','',$dcdom,$env{'user.name'});
     my %ccrole = ();
     &Apache::lonnet::standard_roleprivs(\%ccrole,$role,$dcdom,$spec,$pickedcourse,$area);
-    my ($author,$adv)= &Apache::lonnet::set_userprivs(\$userroles,\%ccrole);
-    my @newprivs = split/\n/,$userroles;
-    my %newccroles = ();
-    foreach (@newprivs) {
-        my ($key,$val) = split/=/,$_;
-        $newccroles{$key} = $val;
-    }
-    &Apache::lonnet::appenv(%newccroles);
+    my ($author,$adv)= &Apache::lonnet::set_userprivs(\%userroles,\%ccrole);
+    &Apache::lonnet::appenv(%userroles);
     &Apache::lonnet::log($env{'user.domain'},
                          $env{'user.name'},
                          $env{'user.home'},