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

matthew lon-capa-cvs@mail.lon-capa.org
Tue, 23 Apr 2002 21:04:00 -0000


matthew		Tue Apr 23 17:04:00 2002 EDT

  Modified files:              
    /loncom/interface	londropadd.pm 
  Log:
  Javascript bugfix and added calls to &Apache::loncommon::select_dom_form().
  
  
Index: loncom/interface/londropadd.pm
diff -u loncom/interface/londropadd.pm:1.28 loncom/interface/londropadd.pm:1.29
--- loncom/interface/londropadd.pm:1.28	Mon Apr 22 11:26:46 2002
+++ loncom/interface/londropadd.pm	Tue Apr 23 17:03:59 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to drop and add students in courses 
 #
-# $Id: londropadd.pm,v 1.28 2002/04/22 15:26:46 matthew Exp $
+# $Id: londropadd.pm,v 1.29 2002/04/23 21:03:59 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -166,15 +166,15 @@
 	alert('You need to specify the username field');
         return;
     }
-    if (vf.login.value == null) {
+    if (current.radiovalue == null || current.radiovalue == 'nochange') {
         // They did not check any of the login radiobuttons.
         alert('You must choose an authentication type');
         return;
     }
     foundatype=1;
-    if (vf.login.argfield.value == '') {
+    if (current.argfield == null || current.argfield == '') {
         var alertmsg = '';
-        switch (vf.login.value) {
+        switch (current.value) {
             case 'krb': 
                 alertmsg = 'You need to specify the Kerberos domain';
                 break;
@@ -382,6 +382,8 @@
     my $krbform = &Apache::loncommon::authform_kerberos(%param);
     my $intform = &Apache::loncommon::authform_internal(%param);
     my $locform = &Apache::loncommon::authform_local(%param);
+    # Set up domain selection form
+    my $domform = &Apache::loncommon::select_dom_form($defdom,'lcdomain');    
     $r->print(<<ENDPICK);
 </table>
 <input type=hidden name=nfields value=$i>
@@ -398,7 +400,7 @@
 $locform
 </p>
 <h3>LON-CAPA Domain for Students</h3>
-LON-CAPA domain: <input type=text size=10 value=$defdom name=lcdomain><p>
+LON-CAPA domain: $domform <p>
 <h3>Starting and Ending Dates</h3>
 <input type="hidden" value=''          name="pres_value"  >
 <input type="hidden" value=''          name="pres_type"   >
@@ -472,6 +474,7 @@
 sub enroll_single_student {
     my $r=shift;
     $r->print('<h3>Enrolling Student</h3>');
+    $r->print($ENV{'form.cuname'}." in domain ".$ENV{'form.cdomain'}.": ");
     if (($ENV{'form.cuname'})&&($ENV{'form.cuname'}!~/\W/)&&
         ($ENV{'form.cdomain'})&&($ENV{'form.cdomain'}!~/\W/)) {
 	my $amode='';
@@ -519,6 +522,8 @@
     my $krbform = &Apache::loncommon::authform_kerberos(%param);
     my $intform = &Apache::loncommon::authform_internal(%param);
     my $locform = &Apache::loncommon::authform_local(%param);
+    # Set up domain selection form
+    my $domform = &Apache::loncommon::select_dom_form($defdom,'cdomain');    
     # Print it all out
     $r->print(<<ENDSENROLL);
 <script type="text/javascript" language="Javascript">
@@ -569,7 +574,7 @@
 
 <h3>Login Data</h3>
 <p>Username: <input type="text" name="cuname"  size="15"></p>
-<p>Domain:   <input type="text" name="cdomain" size="10" value="$defdom"></p>
+<p>Domain:   $domform</p>
 <p>Note: login settings below  will not take effect if the user already exists
 </p><p>
 $krbform