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

raeburn lon-capa-cvs@mail.lon-capa.org
Mon, 20 Nov 2006 23:36:41 -0000


raeburn		Mon Nov 20 18:36:41 2006 EDT

  Modified files:              
    /loncom/interface	loncreateuser.pm 
  Log:
  Don't offer the opportunity to change a user's authentication unless change has mau priv in user's domain. 
  
  
Index: loncom/interface/loncreateuser.pm
diff -u loncom/interface/loncreateuser.pm:1.131 loncom/interface/loncreateuser.pm:1.132
--- loncom/interface/loncreateuser.pm:1.131	Thu Nov  9 17:25:27 2006
+++ loncom/interface/loncreateuser.pm	Mon Nov 20 18:36:40 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Create a user
 #
-# $Id: loncreateuser.pm,v 1.131 2006/11/09 22:25:27 raeburn Exp $
+# $Id: loncreateuser.pm,v 1.132 2006/11/20 23:36:40 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -781,7 +781,7 @@
 		$currentauth=~/^internal:/ or
 		$currentauth=~/^localauth:/
 		) { # bad authentication scheme
-	    if (&Apache::lonnet::allowed('mau',$env{'request.role.domain'})) {
+	    if (&Apache::lonnet::allowed('mau',$ccdomain)) {
                 &initialize_authen_forms();
 		my %lt=&Apache::lonlocal::texthash(
                                'err'   => "ERROR",
@@ -804,7 +804,7 @@
 <p>$authformloc</p>
 ENDBADAUTH
             } else { 
-                # This user is not allowed to modify the users 
+                # This user is not allowed to modify the user's 
                 # authentication scheme, so just notify them of the problem
 		my %lt=&Apache::lonlocal::texthash(
                                'err'   => "ERROR",
@@ -813,9 +813,6 @@
 						   );
 		$r->print(<<ENDBADAUTH);
 <hr />
-<script type="text/javascript" language="Javascript">
-$loginscript
-</script>
 <font color="#ff0000"> $lt{'err'}: </font>
 $lt{'uuas'} ($currentauth). $lt{'adcs'}.
 <hr />
@@ -846,7 +843,7 @@
                     "<p>$authformint</p><p>$authformfsys</p>";
 	    }
             $authformcurrent.=' <i>(will override current values)</i><br />';
-            if (&Apache::lonnet::allowed('mau',$env{'request.role.domain'})) {
+            if (&Apache::lonnet::allowed('mau',$ccdomain)) {
 		# Current user has login modification privileges
 		my %lt=&Apache::lonlocal::texthash(
                                'ccld'  => "Change Current Login Data",
@@ -864,6 +861,19 @@
 <h3>$lt{'enld'}</h3>
 $authform_other
 ENDOTHERAUTHS
+            } else {
+                if (&Apache::lonnet::allowed('mau',$env{'request.role.domain'})) {
+                    my %lt=&Apache::lonlocal::texthash(
+                               'ccld'  => "Change Current Login Data",
+                               'yodo'  => "You do not have privileges to modify the authentication configuration for this user.",
+                               'ifch'  => "If a change is required, contact a domain coordinator for the domain",
+                    );
+                    $r->print(<<ENDNOPRIV);
+<hr />
+<h3>$lt{'ccld'}</h3>
+$lt{'yodo'} $lt{'ifch'}: $ccdomain 
+ENDNOPRIV
+                } 
             }
         }  ## End of "check for bad authentication type" logic
     } ## End of new user/old user logic