[LON-CAPA-cvs] cvs: loncom /interface lonuserutils.pm

raeburn lon-capa-cvs-allow@mail.lon-capa.org
Sat, 12 Jul 2008 23:56:17 -0000


raeburn		Sat Jul 12 19:56:17 2008 EDT

  Modified files:              
    /loncom/interface	lonuserutils.pm 
  Log:
  - &can_modify_userinfo() called in "selfcreate" context will check which types of (blank) user information can be entered when a user creates his/her own account, depending on institutional status.
  
  
Index: loncom/interface/lonuserutils.pm
diff -u loncom/interface/lonuserutils.pm:1.59 loncom/interface/lonuserutils.pm:1.60
--- loncom/interface/lonuserutils.pm:1.59	Tue Jun 24 12:17:05 2008
+++ loncom/interface/lonuserutils.pm	Sat Jul 12 19:56:13 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Utility functions for managing LON-CAPA user accounts
 #
-# $Id: lonuserutils.pm,v 1.59 2008/06/24 16:17:05 bisitz Exp $
+# $Id: lonuserutils.pm,v 1.60 2008/07/12 23:56:13 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -4573,10 +4573,14 @@
                         if (ref($userroles) eq 'ARRAY') {
                             foreach my $role (@{$userroles}) {
                                 my $testrole;
-                                if ($role =~ /^cr\//) {
-                                    $testrole = 'cr';
-                                } else {
+                                if ($context eq 'selfcreate') {
                                     $testrole = $role;
+                                } else {
+                                    if ($role =~ /^cr\//) {
+                                        $testrole = 'cr';
+                                    } else {
+                                        $testrole = $role;
+                                    }
                                 }
                                 if (ref($domconfig{'usermodification'}{$context}{$testrole}) eq 'HASH') {
                                     if ($domconfig{'usermodification'}{$context}{$testrole}{$field}) {