[LON-CAPA-cvs] cvs: loncom /interface loncommon.pm loncreatecourse.pm loncreateuser.pm lonrequestcourse.pm lonuserutils.pm /lonnet/perl lonnet.pm

raeburn raeburn at source.lon-capa.org
Thu Aug 10 20:25:31 EDT 2017


raeburn		Fri Aug 11 00:25:31 2017 EDT

  Modified files:              
    /loncom/interface	loncommon.pm loncreatecourse.pm loncreateuser.pm 
                     	lonrequestcourse.pm lonuserutils.pm 
    /loncom/lonnet/perl	lonnet.pm 
  Log:
  - Trust Settings
    - lonnet::trusted_domains() returns array or array refs, for passing to
      loncommon::select_dom_form() or lonnet::will_trust().
  
  
-------------- next part --------------
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.1287 loncom/interface/loncommon.pm:1.1288
--- loncom/interface/loncommon.pm:1.1287	Mon Aug  7 20:22:13 2017
+++ loncom/interface/loncommon.pm	Fri Aug 11 00:24:52 2017
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.1287 2017/08/07 20:22:13 raeburn Exp $
+# $Id: loncommon.pm,v 1.1288 2017/08/11 00:24:52 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -10138,15 +10138,15 @@
         $domform = &select_dom_form($currdom,'srchdomain',$allow_blank,1,undef,[$currdom]);
     } else {
         my $defdom = $env{'request.role.domain'};
-        my ($trustedref,$untrustedref);
+        my ($trusted,$untrusted);
         if (($context eq 'requestcrs') || ($context eq 'course')) {
-            ($trustedref,$untrustedref) = &Apache::lonnet::trusted_domains('enroll',$defdom);
+            ($trusted,$untrusted) = &Apache::lonnet::trusted_domains('enroll',$defdom);
         } elsif ($context eq 'author') {
-            ($trustedref,$untrustedref) = &Apache::lonnet::trusted_domains('othcoau',$defdom);
+            ($trusted,$untrusted) = &Apache::lonnet::trusted_domains('othcoau',$defdom);
         } elsif ($context eq 'domain') {
-            ($trustedref,$untrustedref) = &Apache::lonnet::trusted_domains('domroles',$defdom);
+            ($trusted,$untrusted) = &Apache::lonnet::trusted_domains('domroles',$defdom);
         }
-        $domform = &select_dom_form($currdom,'srchdomain',$allow_blank,1,undef,$trustedref,$untrustedref);
+        $domform = &select_dom_form($currdom,'srchdomain',$allow_blank,1,undef,$trusted,$untrusted);
     }
     my $srchinsel = ' <select name="srchin">';
 
Index: loncom/interface/loncreatecourse.pm
diff -u loncom/interface/loncreatecourse.pm:1.166 loncom/interface/loncreatecourse.pm:1.167
--- loncom/interface/loncreatecourse.pm:1.166	Mon Aug  7 20:22:13 2017
+++ loncom/interface/loncreatecourse.pm	Fri Aug 11 00:24:53 2017
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Create a course
 #
-# $Id: loncreatecourse.pm,v 1.166 2017/08/07 20:22:13 raeburn Exp $
+# $Id: loncreatecourse.pm,v 1.167 2017/08/11 00:24:53 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -106,8 +106,8 @@
         $course_home .= qq{>$server $host_servers{$server}</option>};
     }
     $course_home .= "\n</select>\n";
-    my ($trustedref,$untrustedref) = &Apache::lonnet::trusted_domains('enroll',$defdom);
-    my $domform = &Apache::loncommon::select_dom_form($defdom,'ccdomain',undef,undef,undef,$trustedref,$untrustedref);
+    my ($trusted,$untrusted) = &Apache::lonnet::trusted_domains('enroll',$defdom);
+    my $domform = &Apache::loncommon::select_dom_form($defdom,'ccdomain',undef,undef,undef,$trusted,$untrusted);
     my $cloneform=&Apache::loncommon::select_dom_form
 	($env{'request.role.domain'},'clonedomain').
 		     &Apache::loncommon::selectcourse_link
Index: loncom/interface/loncreateuser.pm
diff -u loncom/interface/loncreateuser.pm:1.445 loncom/interface/loncreateuser.pm:1.446
--- loncom/interface/loncreateuser.pm:1.445	Thu Aug 10 21:14:58 2017
+++ loncom/interface/loncreateuser.pm	Fri Aug 11 00:24:53 2017
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Create a user
 #
-# $Id: loncreateuser.pm,v 1.445 2017/08/10 21:14:58 raeburn Exp $
+# $Id: loncreateuser.pm,v 1.446 2017/08/11 00:24:53 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -886,15 +886,15 @@
         (!(($env{'form.action'} eq 'singleuser') && ($context eq 'domain') &&
         (!&Apache::lonnet::allowed('mau',$env{'request.role.domain'}))))) {
         my $defdom=$env{'request.role.domain'};
-        my ($trustedref,$untrustedref);
+        my ($trusted,$untrusted);
         if ($context eq 'course') {
-            ($trustedref,$untrustedref) = &Apache::lonnet::trusted_domains('enroll',$defdom);
+            ($trusted,$untrusted) = &Apache::lonnet::trusted_domains('enroll',$defdom);
         } elsif ($context eq 'author') {
-            ($trustedref,$untrustedref) = &Apache::lonnet::trusted_domains('othcoau',$defdom);
+            ($trusted,$untrusted) = &Apache::lonnet::trusted_domains('othcoau',$defdom);
         } elsif ($context eq 'domain') {
-            ($trustedref,$untrustedref) = &Apache::lonnet::trusted_domains('domroles',$defdom); 
+            ($trusted,$untrusted) = &Apache::lonnet::trusted_domains('domroles',$defdom); 
         }
-        my $domform = &Apache::loncommon::select_dom_form($defdom,'srchdomain',undef,undef,undef,$trustedref,$untrustedref);
+        my $domform = &Apache::loncommon::select_dom_form($defdom,'srchdomain',undef,undef,undef,$trusted,$untrusted);
         my %lt=&Apache::lonlocal::texthash(
                   'enro' => 'Enroll one student',
                   'enrm' => 'Enroll one member',
@@ -6148,11 +6148,11 @@
                 } elsif ($curr_types eq '') {
                     $add_domtitle = &mt('Users in other domain:');
                 }
-                my ($trustedref,$untrustedref) = &Apache::lonnet::trusted_domains('enroll',$cdom);
+                my ($trusted,$untrusted) = &Apache::lonnet::trusted_domains('enroll',$cdom);
                 $output .= &Apache::loncommon::start_data_table_row()
                            .'<td colspan="2"><span class="LC_nobreak">'.$add_domtitle.'</span><br />'
                            .&Apache::loncommon::select_dom_form('','selfenroll_newdom',
-                                                                $includeempty,$showdomdesc,'',$trustedref,$untrustedref,$readonly)
+                                                                $includeempty,$showdomdesc,'',$trusted,$untrusted,$readonly)
                            .'<input type="hidden" name="selfenroll_types_total" value="'.$num.'" />'
                            .'</td>'.&Apache::loncommon::end_data_table_row()
                            .&Apache::loncommon::end_data_table();
Index: loncom/interface/lonrequestcourse.pm
diff -u loncom/interface/lonrequestcourse.pm:1.100 loncom/interface/lonrequestcourse.pm:1.101
--- loncom/interface/lonrequestcourse.pm:1.100	Mon Aug  7 20:22:13 2017
+++ loncom/interface/lonrequestcourse.pm	Fri Aug 11 00:24:53 2017
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Request a course
 #
-# $Id: lonrequestcourse.pm,v 1.100 2017/08/07 20:22:13 raeburn Exp $
+# $Id: lonrequestcourse.pm,v 1.101 2017/08/11 00:24:53 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2121,7 +2121,7 @@
             }
         }
     }
-    my ($trustedref,$untrustedref) = &Apache::lonnet::trusted_domains('enroll',$dom);
+    my ($trusted,$untrusted) = &Apache::lonnet::trusted_domains('enroll',$dom);
     for (my $i=0; $i<$persontotal; $i++) {
         my @linkargs = map { 'person_'.$i.'_'.$_ } (@items);
         my $linkargstr = join("','", at linkargs);
@@ -2129,7 +2129,7 @@
         my $onchange = 'javascript:fix_domain('."'$formname','person_".$i."_dom',".
                        "'person_".$i."_hidedom','person_".$i."_uname'".');';
         my $udom_form = &Apache::loncommon::select_dom_form($dom,'person_'.$i.'_dom','',
-                                                            1,$onchange,undef,$trustedref,$untrustedref).
+                                                            1,$onchange,undef,$trusted,$untrusted).
                         '<input type="hidden" name="person_'.$i.'_hidedom" value="" />';
         my %form_elems;
         foreach my $item (@items) {
Index: loncom/interface/lonuserutils.pm
diff -u loncom/interface/lonuserutils.pm:1.187 loncom/interface/lonuserutils.pm:1.188
--- loncom/interface/lonuserutils.pm:1.187	Wed Aug  9 19:20:50 2017
+++ loncom/interface/lonuserutils.pm	Fri Aug 11 00:24:53 2017
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Utility functions for managing LON-CAPA user accounts
 #
-# $Id: lonuserutils.pm,v 1.187 2017/08/09 19:20:50 raeburn Exp $
+# $Id: lonuserutils.pm,v 1.188 2017/08/11 00:24:53 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -943,14 +943,14 @@
                 &Apache::lonhtmlcommon::row_closure();
     }
 
-    my ($trustedref,$untrustedref);
+    my ($trusted,$untrusted);
     if ($context eq 'course') {
-        ($trustedref,$untrustedref) = &Apache::lonnet::trusted_domains('enroll',$defdom);
+        ($trusted,$untrusted) = &Apache::lonnet::trusted_domains('enroll',$defdom);
     } elsif ($context eq 'author') {
-        ($trustedref,$untrustedref) = &Apache::lonnet::trusted_domains('othcoau',$defdom);
+        ($trusted,$untrusted) = &Apache::lonnet::trusted_domains('othcoau',$defdom);
     }
     $Str .= &Apache::lonhtmlcommon::row_title(&mt('Default domain'))
-           .&Apache::loncommon::select_dom_form($defdom,'defaultdomain',undef,1,undef,$trustedref,$untrustedref)
+           .&Apache::loncommon::select_dom_form($defdom,'defaultdomain',undef,1,undef,$trusted,$untrusted)
            .&Apache::lonhtmlcommon::row_closure();
 
     $Str .= &Apache::lonhtmlcommon::row_title(&mt('Starting and Ending Dates'))
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.1348 loncom/lonnet/perl/lonnet.pm:1.1349
--- loncom/lonnet/perl/lonnet.pm:1.1348	Tue Aug  8 15:33:13 2017
+++ loncom/lonnet/perl/lonnet.pm	Fri Aug 11 00:25:30 2017
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.1348 2017/08/08 15:33:13 raeburn Exp $
+# $Id: lonnet.pm,v 1.1349 2017/08/11 00:25:30 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1600,17 +1600,17 @@
 
 sub trusted_domains {
     my ($cmdtype,$calldom) = @_;
-    my (%trusted,%untrusted);
+    my ($trusted,$untrusted);
     if (&domain($calldom) eq '') {
-        return (\%trusted,\%untrusted);
+        return ($trusted,$untrusted);
     }
     unless ($cmdtype =~ /^(content|shared|enroll|coaurem|domroles|catalog|reqcrs|msg)$/) {
-        return (\%trusted,\%untrusted);
+        return ($trusted,$untrusted);
     }
     my $callprimary = &domain($calldom,'primary');
     my $intcalldom = &Apache::lonnet::internet_dom($callprimary);
     if ($intcalldom eq '') {
-        return (\%trusted,\%untrusted);
+        return ($trusted,$untrusted);
     }
 
     my ($trustconfig,$cached)=&Apache::lonnet::is_cached_new('trust',$calldom);
@@ -1660,17 +1660,17 @@
             }
             foreach my $exc (@allexc) {
                 if (ref($doms_by_intdom{$exc}) eq 'ARRAY') {
-                    map { $untrusted{$_}; } @{$doms_by_intdom{$exc}};
+                    $untrusted = $doms_by_intdom{$exc};
                 }
             }
             foreach my $inc (@allinc) {
                 if (ref($doms_by_intdom{$inc}) eq 'ARRAY') {
-                    map { $trusted{$_}; } @{$doms_by_intdom{$inc}};
+                    $trusted = $doms_by_intdom{$inc};
                 }
             }
         }
     }
-    return(\%trusted,\%untrusted);
+    return ($trusted,$untrusted);
 }
 
 sub will_trust {


More information about the LON-CAPA-cvs mailing list