[3881] | 1 | #!/usr/bin/perl
|
---|
| 2 |
|
---|
[4072] | 3 | use usabcgi;
|
---|
| 4 |
|
---|
[3881] | 5 | print "Content-type:text/html\n\n";
|
---|
| 6 |
|
---|
| 7 |
|
---|
| 8 |
|
---|
[3904] | 9 |
|
---|
| 10 | $idno=$ENV{REMOTE_ADDR};
|
---|
| 11 | $idno =~ s/\.//g;
|
---|
[4088] | 12 | $idno =~ tr/0123456789/1357902468/;
|
---|
[3904] | 13 | $idno .= time;
|
---|
| 14 |
|
---|
[3881] | 15 | print "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n";
|
---|
[3904] | 16 | print "<html>\n<head>\n<title>Greenstone Usability Thank you!</title>\n";
|
---|
[3881] | 17 | print "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n";
|
---|
[3904] | 18 |
|
---|
[4085] | 19 | usabcgi::printstyle($ENV{HTTP_USER_AGENT});
|
---|
| 20 | usabcgi::printscript;
|
---|
[4158] | 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";
|
---|
[4072] | 34 |
|
---|
[3904] | 35 | print "</head><body onLoad=\"if(parseInt(navigator.appVersion)>3)\{window.resizeTo(420,300);\}\" bgcolor=\"#FFFFFF\">\n";
|
---|
[4072] | 36 |
|
---|
| 37 |
|
---|
[4131] | 38 | usabcgi::printbanner("Thank You");
|
---|
| 39 |
|
---|
[4072] | 40 | ($fileoutloc) = usabcgi::get_config_info("gsdlhome");
|
---|
| 41 | if(!($fileoutloc =~/\/$/)) {$fileoutloc.="/";}
|
---|
| 42 | $fileoutloc .= "etc/usability.txt";
|
---|
| 43 |
|
---|
[5976] | 44 | if(-e $fileoutloc){
|
---|
[4072] | 45 | open FILEOUT, (">>$fileoutloc");
|
---|
| 46 | }
|
---|
| 47 | else {
|
---|
| 48 | open FILEOUT, (">$fileoutloc");
|
---|
| 49 | }
|
---|
| 50 |
|
---|
[4085] | 51 | usabcgi::printaplinks;
|
---|
[4131] | 52 | print "<p>Your comments have been noted. <p>Thank you for helping us make Greenstone more usable.</p>\n";
|
---|
[4158] | 53 | print "<table width=\"100%\"><tr>\n";
|
---|
[4072] | 54 | print "<td class=\"sans\"><a href=\"readresults.cgi?$idno\" target=\"_blank\">View report details</a></td>\n";
|
---|
[4131] | 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";
|
---|
[3904] | 57 | print"</tr></table>\n";
|
---|
[3881] | 58 |
|
---|
| 59 |
|
---|
[3904] | 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>.";
|
---|
[3881] | 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";
|
---|
[4072] | 79 | print FILEOUT "report-id := $idno\&usabend;\n";
|
---|
[3881] | 80 | foreach $key (keys(%FORM)) {
|
---|
| 81 | if($key eq "URL") {
|
---|
| 82 | $url = $FORM{$key};
|
---|
| 83 | $url =~s/\&/\&\;/g;
|
---|
| 84 | }
|
---|
[4072] | 85 | print FILEOUT "$key := $FORM{$key}\&usabend;\n";
|
---|
[3881] | 86 | }
|
---|
[4072] | 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";
|
---|
[3881] | 91 | print FILEOUT "----------------------------------------------\n";
|
---|
| 92 | close (FILEOUT);
|
---|
| 93 |
|
---|
[3904] | 94 |
|
---|
[3881] | 95 | print"</body></html>\n";
|
---|
| 96 |
|
---|