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

raeburn raeburn at source.lon-capa.org
Thu Mar 30 10:08:19 EDT 2017


raeburn		Thu Mar 30 14:08:19 2017 EDT

  Modified files:              
    /loncom/interface	loncreateuser.pm loncommon.pm 
  Log:
  - Option to search institutional directory not needed in user search 
    when displaying user's access logs.
  
  
Index: loncom/interface/loncreateuser.pm
diff -u loncom/interface/loncreateuser.pm:1.437 loncom/interface/loncreateuser.pm:1.438
--- loncom/interface/loncreateuser.pm:1.437	Sun Mar 26 22:19:24 2017
+++ loncom/interface/loncreateuser.pm	Thu Mar 30 14:08:18 2017
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Create a user
 #
-# $Id: loncreateuser.pm,v 1.437 2017/03/26 22:19:24 raeburn Exp $
+# $Id: loncreateuser.pm,v 1.438 2017/03/30 14:08:18 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -835,11 +835,16 @@
             $inexact = 1;
         }
     }
-    my $cancreate =
-        &Apache::lonuserutils::can_create_user($dom,$context,$usertype);
+    my ($cancreate,$noinstd);
+    if ($env{'form.action'} eq 'accesslogs') {
+        $noinstd = 1;
+    } else {
+        $cancreate =
+            &Apache::lonuserutils::can_create_user($dom,$context,$usertype);
+    }
     my ($userpicker,$cansearch) = 
        &Apache::loncommon::user_picker($dom,$srch,$forcenewuser,
-                                       'document.crtuser',$cancreate,$usertype,$context,$fixeddom);
+                                       'document.crtuser',$cancreate,$usertype,$context,$fixeddom,$noinstd);
     my $srchbutton = &mt('Search');
     if ($env{'form.action'} eq 'singlestudent') {
         $srchbutton = &mt('Search and Enroll');
@@ -1046,7 +1051,7 @@
             $r->print('</h3>');
         } elsif ($env{'form.action'} eq 'accesslogs') {
             $r->print("<b>$lt{'srcva'}</b><br />");
-            $r->print(&entry_form($srch->{'srchdomain'},$srch,undef,'accesslogs',undef,undef,1));
+            $r->print(&entry_form($srch->{'srchdomain'},$srch,undef,$context,undef,undef,1));
             $r->print('<h3>'.$lt{'vacsel'}.'</h3>');
         }
     }
@@ -8260,7 +8265,7 @@
     } else {
         unless (($context eq 'requestcrs') && ($srch->{'srchtype'} eq 'exact')) {
             my $domd_chk = &domdirectorysrch_check($srch);
-            if ($domd_chk ne 'ok') {
+            if (($domd_chk ne 'ok') && ($env{'form.action'} ne 'accesslogs')) {
                 my $instd_chk = &instdirectorysrch_check($srch);
                 $response .= '<span class="LC_warning">'.$domd_chk.'</span><br />';
                 if ($instd_chk eq 'ok') {
@@ -8611,7 +8616,7 @@
             if ($srch->{'srchin'} ne 'alc') {
                 $forcenewuser = 1;
                 my $cansrchinst = 0; 
-                if ($srch->{'srchdomain'}) {
+                if (($srch->{'srchdomain'}) && ($env{'form.action'} ne 'accesslogs')) {
                     my %domconfig = &Apache::lonnet::get_dom('configuration',['directorysrch'],$srch->{'srchdomain'});
                     if (ref($domconfig{'directorysrch'}) eq 'HASH') {
                         if ($domconfig{'directorysrch'}{'available'}) {
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.1278 loncom/interface/loncommon.pm:1.1279
--- loncom/interface/loncommon.pm:1.1278	Tue Mar 21 23:19:29 2017
+++ loncom/interface/loncommon.pm	Thu Mar 30 14:08:18 2017
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.1278 2017/03/21 23:19:29 raeburn Exp $
+# $Id: loncommon.pm,v 1.1279 2017/03/30 14:08:18 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -10038,7 +10038,7 @@
 }
 
 sub user_picker {
-    my ($dom,$srch,$forcenewuser,$caller,$cancreate,$usertype,$context,$fixeddom) = @_;
+    my ($dom,$srch,$forcenewuser,$caller,$cancreate,$usertype,$context,$fixeddom,$noinstd) = @_;
     my $currdom = $dom;
     my @alldoms = &Apache::lonnet::all_domains();
     if (@alldoms == 1) {
@@ -10121,6 +10121,7 @@
         next if ($option eq 'alc');
         next if (($option eq 'crs') && ($env{'form.form'} eq 'requestcrs'));  
         next if ($option eq 'crs' && !$env{'request.course.id'});
+        next if (($option eq 'instd') && ($noinstd));
         if ($curr_selected{'srchin'} eq $option) {
             $srchinsel .= ' 
    <option value="'.$option.'" selected="selected">'.$html_lt{$option}.'</option>';




More information about the LON-CAPA-cvs mailing list