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

raeburn raeburn at source.lon-capa.org
Mon Nov 14 17:33:28 EST 2022


raeburn		Mon Nov 14 22:33:28 2022 EDT

  Modified files:              
    /loncom/interface	loncreateuser.pm 
  Log:
  - Fewer calls to &userenvironment() and &is_advanced_user() in lonnet.pm
  
  
Index: loncom/interface/loncreateuser.pm
diff -u loncom/interface/loncreateuser.pm:1.461 loncom/interface/loncreateuser.pm:1.462
--- loncom/interface/loncreateuser.pm:1.461	Thu Nov 10 14:08:37 2022
+++ loncom/interface/loncreateuser.pm	Mon Nov 14 22:33:28 2022
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Create a user
 #
-# $Id: loncreateuser.pm,v 1.461 2022/11/10 14:08:37 raeburn Exp $
+# $Id: loncreateuser.pm,v 1.462 2022/11/14 22:33:28 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -261,6 +261,7 @@
                    'lti'        => 'Can request creation of LTI courses',
                    'requestauthor'  => 'Can request author space',
     );
+    $isadv = &Apache::lonnet::is_advanced_user($ccdomain,$ccuname);
     if ($context eq 'requestcourses') {
         %userenv = &Apache::lonnet::userenvironment($ccdomain,$ccuname,
                       'requestcourses.official','requestcourses.unofficial',
@@ -274,7 +275,6 @@
         $colspan = ' colspan="2"';
         %domconfig =
             &Apache::lonnet::get_dom('configuration',['requestcourses'],$ccdomain);
-        $isadv = &Apache::lonnet::is_advanced_user($ccdomain,$ccuname);
     } elsif ($context eq 'requestauthor') {
         %userenv = &Apache::lonnet::userenvironment($ccdomain,$ccuname,
                                                     'requestauthor');
@@ -298,7 +298,8 @@
         $tool_on = 'checked="checked" ';
         $curr_access =  
             &Apache::lonnet::usertools_access($ccuname,$ccdomain,$item,undef,
-                                              $context);
+                                              $context,\%userenv,'',
+                                              {'is_adv' => $isadv});
         if ($context eq 'requestauthor') {
             if ($userenv{$context} ne '') {
                 $cust_on = ' checked="checked" ';




More information about the LON-CAPA-cvs mailing list