You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

62 lines
1.9 KiB

#!/usr/bin/perl
#
# $Id: configure.pl,v 1.3 2006/01/23 21:39:30 ddoughty Exp $
#
# Source File: configure.pl
# Get config
require 'sitecfg.pl';
&app_initialize;
print "Content-Type: text/html\n\n";
if (&get_session($FORM{'tid'})) {
if ($FORM{'lang'} ne $SESSION{'lang'}) { &set_session($FORM{'tid'},'lang',$FORM{'lang'});}
&get_client_configuration();
$SESSION{'lang'} = ($SYSTEM{'DEFAULTLANG'} eq '') ? "enu" : $SYSTEM{'DEFAULTLANG'};
$SESSION{'lang'} = ($FORM{'lang'} eq '') ? $SESSION{'lang'} : $FORM{'lang'};
&LoadLanguage($SESSION{'lang'});
&log_entry($SESSION{'clid'}, $SESSION{'uid'}, "3", "DDL $FORM{'dbfilepath'}");
print "<HTML>\n";
print "<BODY>\n";
&put_client_configuration();
&get_client_configuration();
if ($SESSION{'uac'} eq 'gadmin') {
$cfgfile = join($pathsep, $cfgroot, "sitecfg.pl");
# $chmodok = chmod 0766, $cfgfile;
# if ($chmodok != 0) {
open (CFGFILE, "<$cfgfile");
@lines = <CFGFILE>;
close CFGFILE;
open (CFGFILE, ">$cfgfile");
foreach $line (@lines) {
if ($line =~ /ipfilter = / ) {
$line = "\$ipfilter = \"$FORM{'ipfilter'}\"\;\n";
} elsif ($line =~ /acceptget = / ) {
$repl = ($FORM{'acceptget'} ne '') ? 1 : 0;
$line = "\$acceptget = $repl\;\n";
} elsif ($line =~ /acceptpost = / ) {
$repl = ($FORM{'acceptpost'} ne '') ? 1 : 0;
$line = "\$acceptpost = $repl\;\n";
} elsif ($line =~ /allowmultilogin = / ) {
$repl = ($FORM{'allowmultilogin'} ne '') ? 1 : 0;
$line = "\$allowmultilogin = $repl\;\n";
} elsif ($line =~ /autologout = / ) {
if ($FORM{'autologout'} ne '') {
$line = "\$autologout = $FORM{'autologout'}\;\n";
}
}
print CFGFILE "$line";
}
close CFGFILE;
# $chmodok = chmod 0755, $cfgfile;
# } else {
# print "Access to $cfgfile denied.<BR>\n$chmodok - $!\n";
# }
}
print "Site configuration updated.<BR>\n";
print "</BODY>\n";
print "</HTML>\n";
}