#!/usr/bin/perl ############################################################################### # Copyright 2006-2023, Way to the Web Limited # URL: http://www.configserver.com # Email: sales@waytotheweb.com ############################################################################### # start main use strict; use File::Find; use Fcntl qw(:DEFAULT :flock); use Sys::Hostname qw(hostname); use IPC::Open3; use lib '/usr/local/csf/lib'; use ConfigServer::DisplayUI; use ConfigServer::Config; our ($script, $images, $myv, %FORM, %in); my $config = ConfigServer::Config->loadconfig(); my %config = $config->config; open (my $IN, "<", "/etc/csf/version.txt") or die $!; $myv = <$IN>; close ($IN); chomp $myv; $script = "/list/csf/frame.php"; $images = "/list/csf/images"; my $buffer = $ENV{'QUERY_STRING'}; if ($buffer eq "") {$buffer = $ENV{POST}} if ($buffer eq "") {read(STDIN, $buffer,$ENV{'CONTENT_LENGTH'})} if ($buffer eq "") {foreach my $item (@ARGV) {$buffer .= $item."&"}} my @pairs = split(/&/, $buffer); foreach my $pair (@pairs) { my ($name, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $FORM{$name} = $value; } print "content-type: text/html\n\n"; #foreach my $key (keys %ENV) { # print "$key = [$ENV{$key}]
\n"; #} my $bootstrapcss = ""; my $jqueryjs = ""; my $bootstrapjs = ""; unless ($FORM{action} eq "tailcmd" or $FORM{action} =~ /^cf/ or $FORM{action} eq "logtailcmd" or $FORM{action} eq "loggrepcmd") { print < ConfigServer Security & Firewall $bootstrapcss $jqueryjs $bootstrapjs \n"; print <

ConfigServer Security & Firewall - csf v$myv

EOF } my $templatehtml; open (my $SCRIPTOUT, '>', \$templatehtml); select $SCRIPTOUT; ConfigServer::DisplayUI::main(\%FORM, $script, $script, $images, $myv); close ($SCRIPTOUT); select STDOUT; $templatehtml =~ s/csfframe\?/csfframe\&/g; print $templatehtml; unless ($FORM{action} eq "tailcmd" or $FORM{action} =~ /^cf/ or $FORM{action} eq "logtailcmd" or $FORM{action} eq "loggrepcmd") { print < \n"; print "\n"; print "\n"; } 1;