
| Current Path : /var/www/web-klick.de/dsh/50_dev2017/1300__perllib/scripts/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/web-klick.de/dsh/50_dev2017/1300__perllib/scripts/autotest.cgi |
#!/usr/bin/perl
@INC = ("/akt","/akt/appserv","/u","/u/appserv",@main::INC);
use CGI;
use CGI::Ajax;
eval("use _CalParam"); print ($@); _CalParam->new();
eval("use DivBasicF::CGIRequest"); print ($@);
eval("use DivBasicF::FileCom"); print ($@);
my $url = "http://localhost/cgi-bin/autotest.cgi";
my $query = CGI->new();
my @parnames = $query->param();
my $o;
my $text = [];
my $session = "";
foreach $o (sort @parnames) {
if ($o eq "session") {
$session = $query->param($o);
} else {
push(@$text,$o."_".$query->param($o));
}
}
if (@ARGV) {
if ($ARGV[0] =~ /^session\=(.*)$/) {
$session = $1;
shift(@ARGV);
}
$text =[@ARGV];
}
$main::tt = $text;
#if (!$session) {
# $com->connect(650000);
# $session = $com->set_msg() . "." . $com->set_get();
#} else {
# $session =~ /^(.*)\.(.*)$/;
# $com->set_msg($1);
# $com->set_get($2);
#}
#$text = $com->query($text);
#$text = $client->query($text)->[0];
#$text =~ s/---SESSION---/$session/g;
#print "CONTENT-type: text/html\n\n\n" . $text; exit;
my $ajax = CGI::Ajax->new("func",\&ajax_func);
print $ajax->build_html($query,\&site);
sub site { return(ajax_func(@$main::tt)); }
sub ajax_func {
$text = [@_];
my $com = DivBasicF::FileCom->new("/tmp/com/","",$PAR::serializer);
if (!$session) {
$com->connect(650000);
$session = $com->set_msg() . "." . $com->set_get();
} else {
$session =~ /^(.*)\.(.*)$/;
$com->set_msg($1);
$com->set_get($2);
}
my $client = DivBasicF::CGIRequest->new($url,$session);
$text = $com->query($text);
if ($text->[0] eq "___CONNECTION_CLOSED___") {
$text = ["render",<<'TEXT_ENDE'];
<HTML><BODY><H2>Connection to Server Lost!</H2></BODY></HTML>
TEXT_ENDE
$text = $client->query($text)->[0];
} else {
$text = $client->query($text)->[0];
if ($text =~ s/---DISCONNECT---//) {
$com->disconnect();
}
}
#return(<<'TEXT_ENDE');
#<HTML><BODY>
# <A id="par" OnMouseOver="func(['par','abc'],['xxx']);">klick</A>
# <input type="hidden" value="qwer" id="abc">
# <P>
# hier: <div id="xxx"></div>
#</BODY></HTML>
#TEXT_ENDE
return($text);
}