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

raeburn raeburn at source.lon-capa.org
Tue Jan 24 00:34:37 EST 2017


raeburn		Tue Jan 24 05:34:37 2017 EDT

  Modified files:              
    /loncom/interface	loncreateuser.pm 
  Log:
  - Removing trailing white space, and some empty lines. No code changes.
  
  
-------------- next part --------------
Index: loncom/interface/loncreateuser.pm
diff -u loncom/interface/loncreateuser.pm:1.429 loncom/interface/loncreateuser.pm:1.430
--- loncom/interface/loncreateuser.pm:1.429	Wed Jan 18 21:00:05 2017
+++ loncom/interface/loncreateuser.pm	Tue Jan 24 05:34:37 2017
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Create a user
 #
-# $Id: loncreateuser.pm,v 1.429 2017/01/18 21:00:05 raeburn Exp $
+# $Id: loncreateuser.pm,v 1.430 2017/01/24 05:34:37 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -860,7 +860,7 @@
         $output = '<p>'.$userpicker.'</p>';
     }
     if (($env{'form.phase'} eq '') && ($env{'form.action'} ne 'accesslogs') &&
-        (!(($env{'form.action'} eq 'singleuser') && ($context eq 'domain') && 
+        (!(($env{'form.action'} eq 'singleuser') && ($context eq 'domain') &&
         (!&Apache::lonnet::allowed('mau',$env{'request.role.domain'}))))) {
         my $defdom=$env{'request.role.domain'};
         my $domform = &Apache::loncommon::select_dom_form($defdom,'srchdomain');
@@ -1435,7 +1435,7 @@
         $r->print('<div class="LC_left_float">');
         $r->print(&personal_data_display($ccuname,$ccdomain,$newuser,$context,
                                          $inst_results{$ccuname.':'.$ccdomain}));
-        if ((&Apache::lonnet::allowed('ccc',$env{'request.role.domain'})) || 
+        if ((&Apache::lonnet::allowed('ccc',$env{'request.role.domain'})) ||
             (&Apache::lonnet::allowed('udp',$env{'request.role.domain'}))) {
             $r->print('<br /><h3>'.&mt('User Can Request Creation of Courses/Communities in this Domain?').'</h3>'.
                       &Apache::loncommon::start_data_table());
@@ -1455,7 +1455,7 @@
         if ((!$isauthor) && 
             ((&Apache::lonnet::allowed('cau',$env{'request.role.domain'})) ||
              (&Apache::lonnet::allowed('udp',$env{'request.role.domain'}))) &&
-            ($env{'request.role.domain'} eq $ccdomain)) {
+             ($env{'request.role.domain'} eq $ccdomain)) {
             $user_text{'requestauthor'} = &domainrole_req($ccuname,$ccdomain);
         }
         $user_text{'auth'} =  &user_authentication($ccuname,$ccdomain,$formname);
@@ -1526,7 +1526,7 @@
         } elsif (($context eq 'course') && ((&Apache::lonnet::allowed('vcl',$env{'request.course.id'})) ||
                  ($env{'request.course.sec'} &&
                   &Apache::lonnet::allowed('vcl',$env{'request.course.id'}.'/'.$env{'request.course.sec'})))) {
-            $statuses = ['active'];   
+            $statuses = ['active'];
         }
         if ($env{'form.action'} ne 'singlestudent') {
             &display_existing_roles($r,$ccuname,$ccdomain,\%inccourses,$context,
@@ -1760,7 +1760,7 @@
         if ($active) {
             next unless($showall || $showactive);
         } else {
-            next unless($showall || $showexpired); 
+            next unless($showall || $showexpired);
         }
 # Is this a custom role? Get role owner and title.
         my ($croleudom,$croleuname,$croletitle)=
@@ -1905,7 +1905,7 @@
             } else {
                 $row.=' ';
             }
-            $row.= '</td>'; 
+            $row.= '</td>';
         }
         my $plaintext='';
         if (!$croletitle) {
@@ -4384,7 +4384,6 @@
               );
     my $args = { bread_crumbs          => $brcrum,
                  bread_crumbs_component => 'User Management'};
- 
     $r->print(&Apache::loncommon::start_page('Custom Role Editor',
                                              $head_script,$args).
               $body_top);
@@ -5025,7 +5024,7 @@
             } elsif ($env{'form.state'} eq 'done') {
                 $r->print('<h3>'.&mt('Enrollment request processing').'</h3>'."\n");
                 $r->print(&Apache::loncoursequeueadmin::update_request_queue($context,
-                               $cdom,$cnum,$coursedesc));
+                              $cdom,$cnum,$coursedesc));
             }
         } else {
             $r->print(&header(undef,{'no_nav_bar' => 1}).
@@ -5045,7 +5044,7 @@
                     &update_helpdeskaccess($r,$permission,$brcrum);
                 } else {
                     &print_helpdeskaccess_display($r,$permission,$brcrum);
-                }    
+                }
             } else {
                 &print_helpdeskaccess_display($r,$permission,$brcrum);
             }
@@ -5306,9 +5305,8 @@
                 );
   if ($linkcontext eq 'domain') {
       unless ($permission->{'cusr'}) {
-          $links{'domain'}{'singleuser'} = 'View a User'; 
+          $links{'domain'}{'singleuser'} = 'View a User';
           $linktitles{'domain'}{'singleuser'} = 'View information about a user in the domain';
-          
       }
   } elsif ($linkcontext eq 'course') {
       unless ($permission->{'cusr'}) {
@@ -6062,7 +6060,7 @@
             } elsif ($item eq 'approval') {
                 my ($currnotified,$currapproval,%appchecked);
                 my %selfdescs = &Apache::lonuserutils::selfenroll_default_descs();
-                if (ref($currsettings) eq 'HASH') { 
+                if (ref($currsettings) eq 'HASH') {
                     $currnotified = $currsettings->{'selfenroll_notifylist'};
                     $currapproval = $currsettings->{'selfenroll_approval'};
                 }
@@ -6596,7 +6594,7 @@
             }
         }
         if (($context eq 'course') && ($viewablesec ne '')) {
-            next if ($roleslog{$id}{'logentry'}{'section'} ne $viewablesec); 
+            next if ($roleslog{$id}{'logentry'}{'section'} ne $viewablesec);
         }
         $count ++;
         next if ($count < $minshown);
@@ -7201,7 +7199,7 @@
     my ($numstatustypes, at jsarray);
     my ($othertitle,$usertypes,$types) = &Apache::loncommon::sorted_inst_types($cdom);
     if (ref($types) eq 'ARRAY') {
-        if (@{$types} > 0) {                
+        if (@{$types} > 0) {
             $numstatustypes = scalar(@{$types});
             push(@accesstypes,'status');
             @jsarray = ('bystatus');
@@ -7251,7 +7249,7 @@
                 $elements{$role.'_staff_inc'} = 'checkbox';
                 $elements{$role.'_staff_exc'} = 'checkbox';
             }
-            $elements{$role.'_override'} = 'checkbox';      
+            $elements{$role.'_override'} = 'checkbox';
             if (ref($settings{$role}) eq 'HASH') {
                 if ($settings{$role}{'access'} ne '') {
                     my $curraccess = $settings{$role}{'access'};
@@ -7315,7 +7313,7 @@
         }
     }
     return false;
-}         
+}
 
 function helpdeskAccess(role) {
     var curraccess = null;
@@ -7329,11 +7327,11 @@
     var shown = Array();
     var hidden = Array();
     if (curraccess == 'none') {
-        hidden = Array ('$hiddenstr'); 
+        hidden = Array ('$hiddenstr');
     } else {
         if (curraccess == 'status') {
-            shown = Array ('bystatus','privs'); 
-            hidden = Array ('notinc','notexc');    
+            shown = Array ('bystatus','privs');
+            hidden = Array ('notinc','notexc');
         } else {
             if (curraccess == 'exc') {
                 shown = Array ('notexc','privs');
@@ -7352,7 +7350,7 @@
     if (hidden.length > 0) {
         for (var i=0; i<hidden.length; i++) {
             if (document.getElementById(role+'_'+hidden[i])) {
-                document.getElementById(role+'_'+hidden[i]).style.display = 'none'; 
+                document.getElementById(role+'_'+hidden[i]).style.display = 'none';
             }
         }
     }
@@ -7377,7 +7375,7 @@
             if (document.$formname.elements[role+'_incrs'][i].checked) {
                 if (document.$formname.elements[role+'_incrs'][i].value == 1) {
                     document.getElementById(role+'_setindom').style.display = 'none';
-                    document.getElementById(role+'_setincrs').style.display = 'block'; 
+                    document.getElementById(role+'_setincrs').style.display = 'block';
                 } else {
                     document.getElementById(role+'_setincrs').style.display = 'none';
                     document.getElementById(role+'_setindom').style.display = 'block';
@@ -7409,7 +7407,7 @@
                     'all'    => 'All',
                     'none'   => 'None',
                     'status' => 'Determined based on institutional status',
-                    'inc'    => 'Include all, but exclude specific personnel',  
+                    'inc'    => 'Include all, but exclude specific personnel',
                     'exc'    => 'Exclude all, but include specific personnel',
                     'hel'    => 'Helpdesk',
                     'rpr'    => 'Role privileges',
@@ -7445,7 +7443,7 @@
         my @roles_by_num = ();
         foreach my $item (sort {$a <=> $b } (keys(%ordered))) {
             push(@roles_by_num,$ordered{$item});
-        } 
+        }
         $r->print('<p>'.$lt{'tfh'}.': <i>'.join('</i>, <i>',map { $description{$_}; } @roles_by_num).'</i>.');
         if ($permission->{'owner'}) {
             $r->print('<br />'.$lt{'aco'}.'</p><p>');
@@ -7468,7 +7466,7 @@
             my $id;
             if ($count == 0) {
                 $id=' id="LC_current_minitab"';
-                $visibility{$role} = ' style="display:block"';    
+                $visibility{$role} = ' style="display:block"';
             } else {
                 $visibility{$role} = ' style="display:none"';
             }
@@ -7488,11 +7486,11 @@
                                 priv   => 'block',
                              );
             my (%selected,$overridden,$incrscheck,$indomcheck,$indomvis,$incrsvis);
-            if (ref($settings{$role}) eq 'HASH') { 
+            if (ref($settings{$role}) eq 'HASH') {
                 if ($settings{$role}{'access'} ne '') {
                     $indomvis = ' style="display:none"';
                     $incrsvis = ' style="display:block"';
-                    $incrscheck = ' checked="checked"'; 
+                    $incrscheck = ' checked="checked"';
                     if ($settings{$role}{'access'} ne 'all') {
                         $usecheck{$settings{$role}{'access'}} = $usecheck{'all'};
                         delete($usecheck{'all'});
@@ -7519,7 +7517,7 @@
                 }
             } else {
                 $indomcheck = ' checked="checked"';
-                $indomvis = ' style="display:block"'; 
+                $indomvis = ' style="display:block"';
                 $incrsvis = ' style="display:none"';
             }
             $r->print('<div class="LC_left_float" id="'.$role.'_maindiv"'.$visibility{$role}.'>'.
@@ -7719,13 +7717,13 @@
                 $checked = ' checked="checked"';
             }
             $customstatus = '<img src="/adm/lonIcons/navmap.wrong.gif" alt="'.$lt{'dis'}.'" />';
-            $ineffect = $customstatus; 
+            $ineffect = $customstatus;
         } elsif ((!$levelscurrent->{'course'}{$priv}) && ($on{$priv})) {
             if ($permission->{'owner'}) {
-                $checked = ' checked="checked"'; 
+                $checked = ' checked="checked"';
             }
             $customstatus = '<img src="/adm/lonIcons/navmap.correct.gif" alt="'.$lt{'ena'}.'" />';
-            $ineffect = $customstatus; 
+            $ineffect = $customstatus;
         }
         if ($permission->{'owner'}) {
             $output .= '<input type="checkbox" name="'.$role.'_override" value="'.$priv.'"'.$checked.' />';
@@ -7740,7 +7738,7 @@
 }
 
 sub get_adhocrole_settings {
-    my ($cid,$accesstypes,$types,$customroles,$settings,$overridden) = @_;  
+    my ($cid,$accesstypes,$types,$customroles,$settings,$overridden) = @_;
     return unless ((ref($accesstypes) eq 'ARRAY') && (ref($customroles) eq 'HASH') &&
                    (ref($settings) eq 'HASH') && (ref($overridden) eq 'HASH'));
     foreach my $role (split(/,/,$env{'course.'.$cid.'.internal.adhocaccess'})) {
@@ -7869,7 +7867,7 @@
                     push(@incrs,$role);
                     unless ($current{'access'} eq $access) {
                         $changed{$role}{'access'} = 1;
-                        $storehash{'internal.adhoc.'.$role} = $access; 
+                        $storehash{'internal.adhoc.'.$role} = $access;
                     }
                     if ($access eq 'status') {
                         my @statuses = &Apache::loncommon::get_env_multiple('form.'.$role.'_status');
@@ -7905,7 +7903,7 @@
                         my @currstaff;
                         foreach my $person (sort(@personnel)) {
                             if ($domhelpdesk{$person}) {
-                                push(@stored,$person); 
+                                push(@stored,$person);
                             }
                         }
                         if (ref($current{$access}) eq 'ARRAY') {
@@ -7951,7 +7949,7 @@
                 &Apache::lonuserutils::custom_role_privs($customroles{$role},\%full,\%levels,\%levelscurrent);
                 my (@updatedon, at updatedoff, at override);
                 @override = &Apache::loncommon::get_env_multiple('form.'.$role.'_override');
-                if (@override) { 
+                if (@override) {
                     foreach my $priv (sort(keys(%full))) {
                         next unless ($levels{'course'}{$priv});
                         if (grep(/^\Q$priv\E$/, at override)) {
@@ -7964,7 +7962,7 @@
                     }
                 }
                 if (@updatedon) {
-                    $newsettings{$role}{'on'} = join('</li><li>', map { &Apache::lonnet::plaintext($_,$crstype) } (@updatedon)); 
+                    $newsettings{$role}{'on'} = join('</li><li>', map { &Apache::lonnet::plaintext($_,$crstype) } (@updatedon));
                 }
                 if (@updatedoff) {
                     $newsettings{$role}{'off'} = join('</li><li>', map { &Apache::lonnet::plaintext($_,$crstype) } (@updatedoff));
@@ -8072,13 +8070,13 @@
                     push(@roles_by_num,$ordered{$item});
                 }
                 %domusage = &domain_adhoc_access(\%changed,\%domcurrent,\@accesstypes,$usertypes,$othertitle);
-                $r->print(&mt('Helpdesk access settings have been changed as follows').'<br />'); 
+                $r->print(&mt('Helpdesk access settings have been changed as follows').'<br />');
                 $r->print('<ul>');
                 foreach my $role (@roles_by_num) {
                     next unless (ref($changed{$role}) eq 'HASH');
                     $r->print('<li>'.&mt('Ad hoc role').': <b>'.$description{$role}.'</b>'.
                               '<ul>');
-                    if ($changed{$role}{'access'} || $changed{$role}{'status'} || $changed{$role}{'inc'} || $changed{$role}{'exc'}) { 
+                    if ($changed{$role}{'access'} || $changed{$role}{'status'} || $changed{$role}{'inc'} || $changed{$role}{'exc'}) {
                         $r->print('<li>');
                         if ($env{'form.'.$role.'_incrs'}) {
                             if ($newsettings{$role}{'access'} eq 'all') {
@@ -8088,7 +8086,7 @@
                             } elsif ($newsettings{$role}{'access'} eq 'status') {
                                 if ($newsettings{$role}{'status'}) {
                                     my ($access,$rest) = split(/=/,$storehash{'internal.adhoc.'.$role});
-                                    if (split(/,/,$rest) > 1) {  
+                                    if (split(/,/,$rest) > 1) {
                                         $r->print(&mt('Helpdesk staff can use this role if their institutional type is one of: [_1].',
                                                       $newsettings{$role}{'status'}));
                                     } else {
@@ -8123,15 +8121,15 @@
                                 $r->print('<li>'.&mt('Privileges which are available by default for this ad hoc role, but are disabled for this specific '.lc($crstype).':').
                                           '<ul><li>'.$newsettings{$role}{'off'}.'</li></ul></li>');
                             } else {
-                                $r->print('<li>'.&mt('All privileges available by default for this ad hoc role are enabled.').'</li>'); 
+                                $r->print('<li>'.&mt('All privileges available by default for this ad hoc role are enabled.').'</li>');
                             }
                         }
-                        if ($changed{$role}{'on'}) {  
+                        if ($changed{$role}{'on'}) {
                             if ($newsettings{$role}{'on'}) {
                                 $r->print('<li>'.&mt('Privileges which are not available by default for this ad hoc role, but are enabled for this specific '.lc($crstype).':').
                                           '<ul><li>'.$newsettings{$role}{'on'}.'</li></ul></li>');
                             } else {
-                                $r->print('<li>'.&mt('None of the privileges unavailable by default for this ad hoc role are enabled.').'</li>'); 
+                                $r->print('<li>'.&mt('None of the privileges unavailable by default for this ad hoc role are enabled.').'</li>');
                             }
                         }
                     }
@@ -8140,7 +8138,7 @@
                 $r->print('</ul>');
             }
         } else {
-            $r->print(&mt('No changes made to helpdesk access settings.')); 
+            $r->print(&mt('No changes made to helpdesk access settings.'));
         }
     }
     return;
@@ -8619,7 +8617,6 @@
                                         ,' <a'.$helplink.'>'
                                         ,'</a>')
                                      .'<br />';
-                    
                     }
                 }
             }


More information about the LON-CAPA-cvs mailing list