[LON-CAPA-cvs] cvs: doc /loncapafiles updatequery.piml
albertel
lon-capa-cvs@mail.lon-capa.org
Tue, 01 Jun 2004 15:55:02 -0000
albertel Tue Jun 1 11:55:02 2004 EDT
Modified files:
/doc/loncapafiles updatequery.piml
Log:
- ask about allowing, disallowing secure connections, defaults to off for now
Index: doc/loncapafiles/updatequery.piml
diff -u doc/loncapafiles/updatequery.piml:1.30 doc/loncapafiles/updatequery.piml:1.31
--- doc/loncapafiles/updatequery.piml:1.30 Fri May 21 16:40:53 2004
+++ doc/loncapafiles/updatequery.piml Tue Jun 1 11:55:00 2004
@@ -1,6 +1,6 @@
<!-- updatequery.piml -->
-<!-- $Id: updatequery.piml,v 1.30 2004/05/21 20:40:53 www Exp $ -->
+<!-- $Id: updatequery.piml,v 1.31 2004/06/01 15:55:00 albertel Exp $ -->
<!--
@@ -408,10 +408,26 @@
<file>
<target dist='default'>/</target>
<perlscript mode='fg'>
+sub securesetting {
+ my (%perlvar)=@_;
+ my $securestatus='unknown';
+ my $securenum='';
+ if ( $perlvar{'loncAllowInsecure'}&& $perlvar{'londAllowInsecure'}) {
+ $securestatus='no'; $securenum='4';
+ } elsif ( $perlvar{'loncAllowInsecure'}&& !$perlvar{'londAllowInsecure'}) {
+ $securestatus='lond'; $securenum='3';
+ } elsif (!$perlvar{'loncAllowInsecure'}&& $perlvar{'londAllowInsecure'}) {
+ $securestatus='lonc'; $securenum='2';
+ } elsif (!$perlvar{'loncAllowInsecure'}&& !$perlvar{'londAllowInsecure'}) {
+ $securestatus='yes (lond and lonc)'; $securenum='1';
+ }
+ return ($securestatus,$securenum);
+}
# read values from loncapa.conf
my $confdir='/etc/httpd/conf/';
my $filename='loncapa.conf';
my %perlvar;
+my ($securestatus,$securenum);
if (-e "$confdir$filename") {
open(CONFIG,'<'.$confdir.$filename) or
die("Can't read $confdir$filename");
@@ -433,6 +449,13 @@
unless ($perlvar{'lonExpire'} and $perlvar{'lonExpire'}!~/\{\[\[\[\[/) {
$perlvar{'lonExpire'}='86400';
}
+ unless ($perlvar{'londAllowInsecure'} and $perlvar{'londAllowInsecure'}!~/\{\[\[\[\[/) {
+ $perlvar{'londAllowInsecure'}='1';
+ }
+ unless ($perlvar{'loncAllowInsecure'} and $perlvar{'loncAllowInsecure'}!~/\{\[\[\[\[/) {
+ $perlvar{'loncAllowInsecure'}='1';
+ }
+ ($securestatus,$securenum)=&securesetting(%perlvar);
unless ($perlvar{'lonReceipt'} and $perlvar{'lonReceipt'}!~/\{\[\[\[\[/) {
my $lonReceipt='';
srand(time ^ $$ ^ unpack "%L*", `ps axww | gzip`);
@@ -490,15 +513,16 @@
===============================================================================
This is now the current configuration of your machine.
-1) Domain Name: $perlvar{'lonDefDomain'}
-2) Domain Description: $domainDescription
-3) Machine Name: $perlvar{'lonHostID'}
-4) System Administrator's E-mail Address: $perlvar{'lonAdmEMail'}
-5) Role: $perlvar{'lonRole'}
-6) Cache Expiration Time: $perlvar{'lonExpire'}
-7) Server Load: $perlvar{'lonLoadLim'}
-8) User Load: $perlvar{'lonUserLoadLim'}
-9) Everything is correct up above
+ 1) Domain Name: $perlvar{'lonDefDomain'}
+ 2) Domain Description: $domainDescription
+ 3) Machine Name: $perlvar{'lonHostID'}
+ 4) System Administrator's E-mail Address: $perlvar{'lonAdmEMail'}
+ 5) Role: $perlvar{'lonRole'}
+ 6) Cache Expiration Time: $perlvar{'lonExpire'}
+ 7) Server Load: $perlvar{'lonLoadLim'}
+ 8) User Load: $perlvar{'lonUserLoadLim'}
+ 9) Allow only secure connections: $securestatus
+10) Everything is correct up above
END
my $hbug=-1;
my $dbug=-1;
@@ -525,7 +549,7 @@
}
print(<<END);
-ENTER A CHOICE OF 1-8 TO CHANGE, otherwise ENTER 9:
+ENTER A CHOICE OF 1-9 TO CHANGE, otherwise ENTER 10:
END
my $choice=<>;
chomp($choice);
@@ -611,6 +635,35 @@
$perlvar{'lonUserLoadLim'}=$choice2;
}
elsif ($choice==9) {
+ print(<<END);
+9) Allow only secure connections: $securestatus
+The Lon-CAPA communication daemons lonc and lond can be configured to
+allow only secure connections by default.
+
+POSSIBLE CHOICES:
+1) allow only secure connections and don't connect to machines that
+ can not be connected to securely
+2) allow only secure connections but allow this machine to connect to
+ machines that don't support secure connections
+3) allow insecure connections to this machine but only allow connections
+ to machines that support secure connections
+4) allow insecure connections
+ENTER NEW VALUE (currenly $securenum):
+END
+ my $choice2=<>;
+ chomp($choice2);
+ if ($choice2 eq '1') {
+ $perlvar{'loncAllowInsecure'}=0;$perlvar{'londAllowInsecure'}=0;
+ } elsif ($choice2 eq '2') {
+ $perlvar{'loncAllowInsecure'}=0;$perlvar{'londAllowInsecure'}=1;
+ } elsif ($choice2 eq '3') {
+ $perlvar{'loncAllowInsecure'}=1;$perlvar{'londAllowInsecure'}=0;
+ } elsif ($choice2 eq '4') {
+ $perlvar{'loncAllowInsecure'}=1;$perlvar{'londAllowInsecure'}=1;
+ }
+ ($securestatus,$securenum)=&securesetting(%perlvar);
+ }
+ elsif ($choice==10) {
$flag=1;
}
else {