Diff for /doc/loncapafiles/updatequery.piml between versions 1.37 and 1.42

version 1.37, 2005/05/21 00:40:01 version 1.42, 2005/10/26 19:38:15
Line 70  you must contact lon-capa\@lon-capa.org. Line 70  you must contact lon-capa\@lon-capa.org.
 3) DEVELOPMENT - you want to do software (not content!) development with  3) DEVELOPMENT - you want to do software (not content!) development with
                  this workstation and eventually link it with the                   this workstation and eventually link it with the
                  workstations of other LON-CAPA software developers.                   workstations of other LON-CAPA software developers.
 4) PRESERVE the existing hosts.tab and domain.tab  4) RUNNING YOUR OWN CLUSTER - this machine is not in the standard LON-CAPA
                 (/home/httpd/lonTabs/hosts.tab and                   clusters and won't be in the future and you want the existing
                  /home/httpd/lonTabs/domain.tab)                   hosts.tab and domain.tab files to be left alone.
                    (This choice is unlikely what you want to select.)
 END  END
 # Option number 26 will install rawhide_hosts.tab, but  # Option number 26 will install rawhide_hosts.tab, but
 # the typical user does not want to be part of an intensive  # the typical user does not want to be part of an intensive
Line 237  END Line 237  END
   my $choice=<>;    my $choice=<>;
   chomp($choice);    chomp($choice);
   my $bad_domain_flag=0;    my $bad_domain_flag=0;
   my @bad_domain_names=('raw','userfiles','priv','adm','uploaded');    my @bad_domain_names=('res','raw','userfiles','priv','adm','uploaded',
    'editupload');
   foreach my $bad (@bad_domain_names) {    foreach my $bad (@bad_domain_names) {
     $bad_domain_flag=1 if $choice eq $bad;      $bad_domain_flag=1 if $choice eq $bad;
   }    }
Line 255  END Line 256  END
     print "Name too long\n";      print "Name too long\n";
   } elsif (length($choice)<2) {    } elsif (length($choice)<2) {
     print "Name too short\n";      print "Name too short\n";
     } elsif ($bad_domain_flag) {
       print "Invalid input ('$choice' conflicts with LON-CAPA namespace).\n";
       print "Please try something different than '$choice'\n";
   } elsif ($choice!~/\_/ and $choice=~/^\w+$/) {    } elsif ($choice!~/\_/ and $choice=~/^\w+$/) {
     open(OUT,'&gt;&gt;/tmp/loncapa_updatequery.out');      open(OUT,'&gt;&gt;/tmp/loncapa_updatequery.out');
     print(OUT 'lonDefDomain'."\t".$choice."\n");      print(OUT 'lonDefDomain'."\t".$choice."\n");
Line 262  END Line 266  END
     $lonDefDomain=$choice;      $lonDefDomain=$choice;
     $r='l';      $r='l';
     $flag=1;      $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 {    } else {
     print "Invalid input (only alphanumeric characters supported).\n";      print "Invalid input (only alphanumeric characters supported).\n";
   }    }
Line 586  This is now the current configuration of Line 587  This is now the current configuration of
 10) Allow only secure connections: $securestatus   10) Allow only secure connections: $securestatus 
 11) Everything is correct up above  11) Everything is correct up above
 END  END
 my $hbug=-1;  
 my $dbug=-1;  
 {  
   my $v=$perlvar{'lonHostID'};  
   $hbug=0;  
   $hbug=1 if $v=~/\W/;  
   $hbug=1 if $v=~/\_/;  
 }  
 {  
   my $v=$1;  
   $dbug=0;  
   $dbug=1 if $v=~/\W/;  
   $dbug=1 if $v=~/\_/;  
 }  
   
 if ($hbug) {  
   print "**** ERROR **** ".  
  "Invalid lonHostID (should only be letters and/or digits)\n";  
 }  
 if ($dbug) {  
   print "**** ERROR **** ".  
  "Invalid lonDefDomain (should only be letters and/or digits)\n";  
 }  
   
   my $error='';
   foreach my $v ($perlvar{'lonDefDomain'},$perlvar{'lonHostID'}) {
      if (length($v)>16) { $error.="\nName $v too long"; }
      if (length($v)<2) { $error.="\nName $v too short"; }
      if ($v=~/capa/i) {
    if ($v!~/^oucapa\d+$/ && 
       ($v!~/^capa\d+$/ && $perlvar{'lonDefDomain'} eq 'uwsp')) {
    $error.="\nName $v contains 'capa'"; 
    }
      }
      foreach my $bad ('res','raw','userfiles','priv','adm','uploaded',
    'editupload') {
         $error.="\nName $v reserved." if $v eq $bad;
      }
      if ($v=~/\W/) { $error.="\nName $v contains special characters"; }
   }
   if ($domainDescription!~/^[\(\)\-\w\s,]+$/) {
      $error.="\nDomain Description contains special characters";
   } 
   foreach my $v ($perlvar{'lonExpire'},$perlvar{'lonLoadLim'}) {
      unless ($v=~/^[\d+\.]+$/) { $error.="\nNumber expected instead of $v"; }
   }
   unless (($perlvar{'lonRole'} eq 'library') || ($perlvar{'lonRole'} eq 'access')) {
      $error.="\nInvalid Role";
   }
   if ($error) { print "\n*** ERRORS: $error\n"; }
   print(&lt;&lt;END);    print(&lt;&lt;END);
 ENTER A CHOICE OF 1-10 TO CHANGE, otherwise ENTER 11:  ENTER A CHOICE OF 1-10 TO CHANGE, otherwise ENTER 11:
 END  END
Line 734  END Line 738  END
     }      }
     ($securestatus,$securenum)=&securesetting(%perlvar);      ($securestatus,$securenum)=&securesetting(%perlvar);
   }    }
   elsif ($choice==11) {    elsif (($choice==11) && (!$error)) {
     $flag=1;      $flag=1;
   }    }
   else {    else {
       print "Invalid input.\n";
   }    }
 }  }
     open(OUT,"&gt;$confdir$filename") or      open(OUT,"&gt;$confdir$filename") or

Removed from v.1.37  
changed lines
  Added in v.1.42


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>