[LON-CAPA-cvs] cvs: doc /loncapafiles updatequery.piml

raeburn raeburn@source.lon-capa.org
Thu, 13 Jan 2011 17:49:23 -0000


raeburn		Thu Jan 13 17:49:23 2011 EDT

  Modified files:              
    /doc/loncapafiles	updatequery.piml 
  Log:
  - Update list of required fields.
  - Reset $flag to zero before steps to request primary library, protocol
    and internet domain, so those phases are displayed.
  - Default protocol is http   
  
  
Index: doc/loncapafiles/updatequery.piml
diff -u doc/loncapafiles/updatequery.piml:1.67 doc/loncapafiles/updatequery.piml:1.68
--- doc/loncapafiles/updatequery.piml:1.67	Sat Jan  1 21:49:56 2011
+++ doc/loncapafiles/updatequery.piml	Thu Jan 13 17:49:23 2011
@@ -1,6 +1,6 @@
 <!-- updatequery.piml -->
 
-<!-- $Id: updatequery.piml,v 1.67 2011/01/01 21:49:56 raeburn Exp $ -->
+<!-- $Id: updatequery.piml,v 1.68 2011/01/13 17:49:23 raeburn Exp $ -->
 
 <!--
 
@@ -140,6 +140,9 @@
 * LON-CAPA Domain Name
 * LON-CAPA Machine ID Name, and
 * Server Administration E-mail Address.
+* LON-CAPA Domain's Primary Library Server Machine ID
+* Web Server Protocol
+* Internet Domain Name of Your Institution
 ===============================================================================
 
 In addition, a Support E-mail Address can also be included. If
@@ -368,6 +371,8 @@
         $primaryLibServer = $libservers[0];
     }
 }
+
+$flag=0;
 while (!$flag) {
   print(&lt;&lt;END);
 **** Domain's Primary Library Server ID ****
@@ -476,13 +481,16 @@
   }
 }
 
+# get protocol
+# accept if valid, if not valid, tell user and repeat
+$flag=0;
 while (!$flag) {
   print(&lt;&lt;END);
 
 ****  Web Server Protocol ****
 If you plan to run the Apache server with SSL enabled, 
 the protocol should be: https; otherwise it should be http.
-ENTER WEB SERVER PROTOCOL:
+ENTER WEB SERVER PROTOCOL [http]:
 END
 
   my $choice=&lt;&gt;;
@@ -493,12 +501,20 @@
     close(OUT);
     $protocol=$choice;
     $flag=1;
-  }
-  else {
+  } elsif ($choice eq '') {
+    open(OUT,'&gt;&gt;/tmp/loncapa_updatequery.out');
+    print(OUT 'protocol'."\t".'http'."\n");
+    close(OUT);
+    $protocol = 'http';
+    $flag = 1;
+  } else {
     print "Invalid input (only http or https allowed).\n";
   }
 }
 
+# get internet domain
+# accept if valid, if not valid, tell user and repeat
+$flag=0;
 while (!$flag) {
   print(&lt;&lt;END);
 
@@ -517,7 +533,7 @@
   chomp($choice);
   if ($choice =~/[^.]+\.[^.]+/) {
     open(OUT,'&gt;&gt;/tmp/loncapa_updatequery.out');
-    print(OUT 'internet domain'."\t".$intdom."\n");
+    print(OUT 'internet domain'."\t".$choice."\n");
     close(OUT);
     $intdom=$choice;
     $flag=1;