#!/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 "\n"; print "\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 = ; 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.
\n$chmodok - $!\n"; # } } print "Site configuration updated.
\n"; print "\n"; print "\n"; }