Changeset 4072
- Timestamp:
- 2003-04-02T00:09:26+12:00 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/cgi-bin/perl.cgi
r3904 r4072 1 1 #!/usr/bin/perl 2 3 use usabcgi; 2 4 3 5 print "Content-type:text/html\n\n"; 4 6 5 open(FILEIN, "gsdlsite.cfg") or die "Could not open site configuration file\n";6 @config=<FILEIN>;7 close(FILEIN);8 7 9 foreach $line (@config)10 {11 if($line=~/(gsdlhome)\s+(\S+)/)12 {13 $fileoutloc=$2;14 $fileoutloc =~ s/\"//g;15 if(!($fileoutloc=~ /\/$/)) {$fileoutloc.="/"; }16 $fileoutloc.= "etc/usability.txt";17 }18 elsif($line=~/(httpimg)\s+(\S+)/)19 {20 $imageloc =$2;21 if(!($2=~/http/)){22 $imageloc="http://".$ENV{HTTP_HOST}."\/".$2;23 }24 }25 }26 8 27 9 … … 29 11 $idno =~ s/\.//g; 30 12 $idno .= time; 31 32 if(!($fileoutloc=~/etc\/usability\.txt/))33 {34 die "Could not open log file etc/usability.txt\n";35 }36 13 37 14 print "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n"; … … 43 20 print "<style type=\"text/css\">\n"; 44 21 print "\th1 \{font-family: sans-serif; font-size: 20px}\n"; 22 print "\tp.sans {font-family: sans-serif}\n"; 23 print "\ttd.sans {font-family: sans-serif}\n"; 45 24 print "</style>\n" 46 25 } … … 61 40 #print "}\n"; 62 41 #print "\n"; 63 print "function viewdetails() {\n"; 64 print "\talert(\"This function is still being researched, please try again later\");\n}\n"; 65 print "</script>"; 42 66 43 print "</head><body onLoad=\"if(parseInt(navigator.appVersion)>3)\{window.resizeTo(420,300);\}\" bgcolor=\"#FFFFFF\">\n"; 44 45 ($imageloc) = usabcgi::get_config_info("httpimg"); 46 if(!($imageloc =~ "http")) {$imageloc="http://".$ENV{HTTP_HOST}.$imageloc;} 67 47 print "<table width=\"400px\"><tr>\n<td><h1>Greenstone Usability - Thank you</h1></td>\n"; 68 48 print "<td align=\"right\">"; 69 49 if ($imageloc) { print "<img src=\"$imageloc\/usabbanner.gif\" alt=\"Greenstone koru design\" title=\"Greenstone koru design\">"; } 70 50 print "</td>\n</tr></table>"; 71 print "<p><a href=\"http://nzdl2.cs.waikato.ac.nz/cgi-bin/dana/library?a=p&p=Usability\" target=\"_blank\">About</a> • <a href=\"http://nzdl2.cs.waikato.ac.nz/cgi-bin/dana/library?a=p&p=Privacy\" target=\"_blank\">Privacy</a>"; 51 52 ($fileoutloc) = usabcgi::get_config_info("gsdlhome"); 53 if(!($fileoutloc =~/\/$/)) {$fileoutloc.="/";} 54 $fileoutloc .= "etc/usability.txt"; 55 56 if(!(-e $fileoutloc)){ 57 open FILEOUT, (">>$fileoutloc"); 58 } 59 else { 60 open FILEOUT, (">$fileoutloc"); 61 } 62 63 print "<p class=\"sans\"><a href=\"http://nzdl2.cs.waikato.ac.nz/cgi-bin/dana/library?a=p&p=Usability\" target=\"_blank\">About</a> • <a href=\"http://nzdl2.cs.waikato.ac.nz/cgi-bin/dana/library?a=p&p=Privacy\" target=\"_blank\">Privacy</a>"; 72 64 print "<p>Your comments have been noted. Thank you for helping us make Greenstone more usable!"; 73 65 print "<table width=\"400px\"><tr>\n"; 74 print "<td ><a href=\"readresults.cgi?$idno\" target=\"_blank\">View report details</a></td>\n";75 print "<td ><a href=\"http://nzdl2.cs.waikato.ac.nz/dana/gsdl/test.html\" target=\"_blank\">Track report</a></td>";76 print "<td align=\"right\">< p><form action=\"\"><input type=\"Button\" value=\"Close Window\" onClick=\"window.close();\"></form></td>\n";66 print "<td class=\"sans\"><a href=\"readresults.cgi?$idno\" target=\"_blank\">View report details</a></td>\n"; 67 print "<td class=\"sans\"><a href=\"http://nzdl2.cs.waikato.ac.nz/dana/gsdl/test.html\" target=\"_blank\">Track report</a></td>"; 68 print "<td align=\"right\"><form action=\"\"><button type=\"button\" onClick=\"window.close();\"><b>Close Window</b></button></form></td>\n"; 77 69 print"</tr></table>\n"; 78 70 … … 97 89 else { open FILEOUT, (">$fileoutloc") or print "cannot open file $fileoutloc\n"; } 98 90 #print FILEOUT "-------------------------------------\n"; 99 print FILEOUT "report-id := $idno\ n";91 print FILEOUT "report-id := $idno\&usabend;\n"; 100 92 foreach $key (keys(%FORM)) { 101 93 if($key eq "URL") { … … 103 95 $url =~s/\&/\&\;/g; 104 96 } 105 print FILEOUT "$key := $FORM{$key}\ n";97 print FILEOUT "$key := $FORM{$key}\&usabend;\n"; 106 98 } 107 print FILEOUT "browser-read-by-server := $ENV{HTTP_USER_AGENT}\ n";108 print FILEOUT "browser-ip-no := $ENV{REMOTE_ADDR}\ n";109 print FILEOUT "server-ip-no := $ENV{SERVER_ADDR}\ n";110 print FILEOUT "time := ".scalar(localtime(time))."\ n";99 print FILEOUT "browser-read-by-server := $ENV{HTTP_USER_AGENT}\&usabend;\n"; 100 print FILEOUT "browser-ip-no := $ENV{REMOTE_ADDR}\&usabend;\n"; 101 print FILEOUT "server-ip-no := $ENV{SERVER_ADDR}\&usabend;\n"; 102 print FILEOUT "time := ".scalar(localtime(time))."\&usabend;\n"; 111 103 print FILEOUT "----------------------------------------------\n"; 112 104 close (FILEOUT);
Note:
See TracChangeset
for help on using the changeset viewer.