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

harris41 lon-capa-cvs@mail.lon-capa.org
Sat, 17 Aug 2002 19:05:03 -0000


harris41		Sat Aug 17 15:05:03 2002 EDT

  Modified files:              
    /doc/loncapafiles	updatequery.piml 
  Log:
  BUG 649 FIX; This prevents a system administrator from ever specifying
  'adm','userfiles','raw','uploaded', or 'priv' to be the lonDefDomain
  for the machine.  (The goal is to avoid conflicting with namespace
  underneath DocumentRoot which is necessary for emerging LON-CAPA
  functionality.)
  
  
Index: doc/loncapafiles/updatequery.piml
diff -u doc/loncapafiles/updatequery.piml:1.17 doc/loncapafiles/updatequery.piml:1.18
--- doc/loncapafiles/updatequery.piml:1.17	Fri Jun 21 01:30:31 2002
+++ doc/loncapafiles/updatequery.piml	Sat Aug 17 15:05:03 2002
@@ -1,7 +1,7 @@
 <!-- updatequery.piml -->
 <!-- Scott Harrison -->
 
-<!-- $Id: updatequery.piml,v 1.17 2002/06/21 05:30:31 harris41 Exp $ -->
+<!-- $Id: updatequery.piml,v 1.18 2002/08/17 19:05:03 harris41 Exp $ -->
 
 <!--
 
@@ -145,6 +145,11 @@
 }
   my $choice=&lt;&gt;;
   chomp($choice);
+  my $bad_domain_flag=0;
+  my @bad_domain_names=('raw','userfiles','priv','adm','uploaded');
+  foreach my $bad (@bad_domain_names) {
+    $bad_domain_flag=1 if $choice eq $bad;
+  }
   if ($ipdomain and $choice=~/^\s*$/) {
     $choice=$ipdomain;
     open(OUT,'&gt;&gt;/tmp/loncapa_updatequery.out');
@@ -160,6 +165,10 @@
     $lonDefDomain=$choice;
     $r='l';
     $flag=1;
+  }
+  elsif ($bad_domain_flag) {
+    print "Invalid input ('$choice' conflicts with LON-CAPA namespace).\n";
+    print "Please try something different than '$choice'\n";
   }
   else {
     print "Invalid input (only alphanumeric characters supported).\n";