1 | #!/usr/bin/perl
|
---|
2 |
|
---|
3 | use usabcgi;
|
---|
4 |
|
---|
5 | print "Content-type:text/html\n\n";
|
---|
6 |
|
---|
7 |
|
---|
8 |
|
---|
9 |
|
---|
10 | $idno=$ENV{REMOTE_ADDR};
|
---|
11 | $idno =~ s/\.//g;
|
---|
12 | $idno =~ tr/0123456789/1357902468/;
|
---|
13 | $idno .= time;
|
---|
14 |
|
---|
15 | print "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n";
|
---|
16 | print "<html>\n<head>\n<title>Greenstone Usability Thank you!</title>\n";
|
---|
17 | print "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n";
|
---|
18 |
|
---|
19 | usabcgi::printstyle($ENV{HTTP_USER_AGENT});
|
---|
20 | usabcgi::printscript;
|
---|
21 | #print "timeleft=21;\n";
|
---|
22 | #print "function timerdisplay(){\n";
|
---|
23 | #print "\tif(eval(document.getElementById != undefined )){\n";
|
---|
24 | #print "\t\tif(parseInt(timeleft)>0){\n";
|
---|
25 | #print "\t\t\ttimeleft-=1;\n";
|
---|
26 | #print "\t\t\ttimeforscreen = timeleft+\' second\';\n";
|
---|
27 | #print "\t\t\tif(timeleft>1)\{ timeforscreen += \'s\';\}\n";
|
---|
28 | #print "\t\t\t\tdocument.getElementById(\'timer\').firstChild.nodeValue=timeforscreen;\n";
|
---|
29 | #print "\t\t\t\tsetTimeout(\'timerdisplay()\',1000);\n";
|
---|
30 | #print "\t\t}\n";
|
---|
31 | #print "\t}\n";
|
---|
32 | #print "}\n";
|
---|
33 | #print "\n";
|
---|
34 |
|
---|
35 | print "</head><body onLoad=\"if(parseInt(navigator.appVersion)>3)\{window.resizeTo(420,300);\}\" bgcolor=\"#FFFFFF\">\n";
|
---|
36 |
|
---|
37 |
|
---|
38 | usabcgi::printbanner("Thank You");
|
---|
39 |
|
---|
40 | ($fileoutloc) = usabcgi::get_config_info("gsdlhome");
|
---|
41 | if(!($fileoutloc =~/\/$/)) {$fileoutloc.="/";}
|
---|
42 | $fileoutloc .= "etc/usability.txt";
|
---|
43 |
|
---|
44 | if(-e $fileoutloc){
|
---|
45 | open FILEOUT, (">>$fileoutloc");
|
---|
46 | }
|
---|
47 | else {
|
---|
48 | open FILEOUT, (">$fileoutloc");
|
---|
49 | }
|
---|
50 |
|
---|
51 | usabcgi::printaplinks;
|
---|
52 | print "<p>Your comments have been noted. <p>Thank you for helping us make Greenstone more usable.</p>\n";
|
---|
53 | print "<table width=\"100%\"><tr>\n";
|
---|
54 | print "<td class=\"sans\"><a href=\"readresults.cgi?$idno\" target=\"_blank\">View report details</a></td>\n";
|
---|
55 | print "<td class=\"sans\"><a href=\"trackreport.cgi?$idno\" target=\"_blank\">Track report</a></td>";
|
---|
56 | print "<td align=\"right\"><form action=\"\"><button type=\"button\" onClick=\"window.close();\"><strong>Close Window</strong></button></form></td>\n";
|
---|
57 | print"</tr></table>\n";
|
---|
58 |
|
---|
59 |
|
---|
60 | #print "<h2>Your report ID number is: $idno</h2>";
|
---|
61 | #print "<p>The information has now been sent, thank-you. The information sent is displayed below. This window will close automatically after <span id=\"timer\">20 seconds</span>.";
|
---|
62 | read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
|
---|
63 | @pairs=split(/&/,$buffer);
|
---|
64 |
|
---|
65 | foreach $pair (@pairs) {
|
---|
66 | ($name, $value) = split(/=/,$pair);
|
---|
67 | $value=~ tr/+/ /;
|
---|
68 | $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
|
---|
69 | $FORM{$name} = $value;
|
---|
70 | }
|
---|
71 |
|
---|
72 |
|
---|
73 |
|
---|
74 | if (-e $fileoutloc){
|
---|
75 | open FILEOUT, (">>$fileoutloc");
|
---|
76 | }
|
---|
77 | else { open FILEOUT, (">$fileoutloc") or print "cannot open file $fileoutloc\n"; }
|
---|
78 | #print FILEOUT "-------------------------------------\n";
|
---|
79 | print FILEOUT "report-id := $idno\&usabend;\n";
|
---|
80 | foreach $key (keys(%FORM)) {
|
---|
81 | if($key eq "URL") {
|
---|
82 | $url = $FORM{$key};
|
---|
83 | $url =~s/\&/\&\;/g;
|
---|
84 | }
|
---|
85 | print FILEOUT "$key := $FORM{$key}\&usabend;\n";
|
---|
86 | }
|
---|
87 | print FILEOUT "browser-read-by-server := $ENV{HTTP_USER_AGENT}\&usabend;\n";
|
---|
88 | print FILEOUT "browser-ip-no := $ENV{REMOTE_ADDR}\&usabend;\n";
|
---|
89 | print FILEOUT "server-ip-no := $ENV{SERVER_ADDR}\&usabend;\n";
|
---|
90 | print FILEOUT "time := ".scalar(localtime(time))."\&usabend;\n";
|
---|
91 | print FILEOUT "----------------------------------------------\n";
|
---|
92 | close (FILEOUT);
|
---|
93 |
|
---|
94 |
|
---|
95 | print"</body></html>\n";
|
---|
96 |
|
---|