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

raeburn lon-capa-cvs-allow@mail.lon-capa.org
Tue, 18 Sep 2007 23:57:18 -0000


raeburn		Tue Sep 18 19:57:18 2007 EDT

  Modified files:              
    /loncom/interface	loncreateuser.pm 
  Log:
  - style
  - portfolio priv check should be for domain of user being modified, not of requestor's role. 
  
  
Index: loncom/interface/loncreateuser.pm
diff -u loncom/interface/loncreateuser.pm:1.185 loncom/interface/loncreateuser.pm:1.186
--- loncom/interface/loncreateuser.pm:1.185	Wed Sep 12 19:42:37 2007
+++ loncom/interface/loncreateuser.pm	Tue Sep 18 19:57:15 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Create a user
 #
-# $Id: loncreateuser.pm,v 1.185 2007/09/12 23:42:37 raeburn Exp $
+# $Id: loncreateuser.pm,v 1.186 2007/09/18 23:57:15 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1070,11 +1070,8 @@
             $loginscript  = &Apache::loncommon::authform_header(%param);
 	}
 	# Check for a bad authentication type
-        unless ($currentauth=~/^krb(4|5):/ or
-		$currentauth=~/^unix:/ or
-		$currentauth=~/^internal:/ or
-		$currentauth=~/^localauth:/
-		) { # bad authentication scheme
+        if ($currentauth !~ /^(krb4|krb5|unix|internal|localauth):/) { 
+            # bad authentication scheme
 	    if (&Apache::lonnet::allowed('mau',$ccdomain)) {
                 &initialize_authen_forms();
 		my %lt=&Apache::lonlocal::texthash(
@@ -1169,11 +1166,22 @@
 ENDNOPRIV
                 } 
             }
-            if (&Apache::lonnet::allowed('mpq',$env{'request.role.domain'})) {
-                # Current user has quota modification privileges
-                $r->print(&portfolio_quota($ccuname,$ccdomain));
-            }
         }  ## End of "check for bad authentication type" logic
+        if (&Apache::lonnet::allowed('mpq',$ccdomain)) {
+            # Current user has quota modification privileges
+            $r->print(&portfolio_quota($ccuname,$ccdomain));
+        } elsif (&Apache::lonnet::allowed('mpq',$env{'request.role.domain'})) {
+            my %lt=&Apache::lonlocal::texthash(
+                'dska'  => "Disk space allocated to user's portfolio files",
+                'youd'  => "You do not have privileges to modify the portfolio quota for this user.",
+                'ichr'  => "If a change is required, contact a domain coordinator for the domain",
+            );
+            $r->print(<<ENDNOPORTPRIV);
+<hr />
+<h3>$lt{'dska'}</h3>
+$lt{'youd'} $lt{'ichr'}: $ccdomain
+ENDNOPORTPRIV
+        }
     } ## End of new user/old user logic
     $r->print('<hr /><h3>'.&mt('Add Roles').'</h3>');
 #