-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCheckResults.cgi
More file actions
153 lines (88 loc) · 6.3 KB
/
Copy pathCheckResults.cgi
File metadata and controls
153 lines (88 loc) · 6.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
#!/usr/bin/perl
use strict;
use CGI;
use CGI::Carp qw ( fatalsToBrowser );
### Description: To retrieval the results for large computing.
### First drafted on August 28, last updated by Dr. Jeff Chen on August 29, 2018.
my $Process_ID = @ARGV[0]; #
my $data_dir = @ARGV[1];
my $Encryption = @ARGV[2];
my $prefix = $ARGV[3];
#print "$Process_ID<br>\n";
#print "$data_dir<br>\n";
my $query = new CGI;
print $query->header ( );
$Process_ID= $query->param("a");
$data_dir = $query->param("b");
$Encryption = $query->param("c");
$prefix = $query->param("d");
my $encription_password= $prefix;
$encription_password =~s/\.//g;
#print "$Process_ID<br>\n";
#print "$data_dir<br>\n";
if($data_dir eq ""){
system ("ls /data/www/TMP > /data/www/TMP/Dir_File_List.$$");
}else{
system ("ls /data/www/TMP/$data_dir > /data/www/TMP/Dir_File_List.$$");
}
print "<br><center><img src=\"../KING.png\"></center>";
my $dir="/data/www/TMP/Dir_File_List.$$";
open (my $fh, '<:encoding(UTF-8)', $dir)
or die "Could not open file==> '$dir' $!";
my $i=0;
print "<br><br><center><table bgcolor=white><tr><td align=center><font color=blue size=+3><b>Download Ancestry Inference Results Here !</b></font><br><hr><br><ol>";
while (my $row =<$fh>){
chomp $row;
#$Process_ID ="175868";
if ($row =~/$Process_ID/ && $row !~m/Data_File_List/){
if($data_dir eq ""){
print "<li><a href=\"http://king.cphg.virginia.edu/TMP/$row\" target=$row>$row</a><br>\n";
}else{
print "<li><a href=\"http://king.cphg.virginia.edu/TMP/$data_dir/$row\" target=$row>$row</a><br>\n";
}
}
$i++;
}
print "</ol></td></tr></table></center><br><hr>";
close ($fh);
system("rm /data/www/TMP/Dir_File_List*");
######################### Display Encrypted Data **********************************************************************************************************************************
print "<center><table><tr><td bgcolor=white>";
if($Encryption eq "PKZIP"){
print "<h2><a href=\"http://king.cphg.virginia.edu/TMP/Encryption/$prefix.tar.zip\"><font color=magenta><b>Download Encrypted Result Data Here</font></a> with Accessing Password: <font color=magenta>$encription_password </b></font><br>";
print "Based on Password Protection of <a href=\"https://courses.cs.ut.ee/MTAT.07.022/2015_fall/uploads/Main/dmitri-report-f15-16.pdf\" target=PKZIP> <b>PKZIP/ZIP2.0</b></a> Format Encryption Mechanism!</h2>";
print "<i>This Encypted File Can Be Opened by ZIP Utilities on Regular Unix/Linix, Microsoft and Mac Windows Operating Systems.</i><br><br>";
}elsif($Encryption eq "AES256"){
print "<br><center>******** <i>As to How to Decrypt the Advanced Encrypted Result Files, Please Contact Dr. Jeff Chen: xc3m\@virginia.edu for Technical Support</i> **********</center>";
print "<h2><a href=\"http://king.cphg.virginia.edu/TMP/Encryption/$prefix.tar.enc\"><font color=magenta><b>Download Encrypted Result Data Here</font></a> with Accessing Password: <font color=magenta>$encription_password </b></font><br>";
print "Based on the <a href=\"https://searchsecurity.techtarget.com/definition/Advanced-Encryption-Standard\" target=AES>Advanced Encryption Standard</a> of <a href=\"https://en.wikipedia.org/wiki/Advanced_Encryption_Standard\" target=AES256><b>AES256</b></a> Encryption Mechanism!</h2>";
}elsif($Encryption eq "AES128"){
print "<br><center>******** <i>As to How to Decrypt the Advanced Encrypted Result Files, Please Contact Dr. Jeff Chen: xc3m\@virginia.edu for Technical Support</i> **********</center>";
print "<h2><a href=\"http://king.cphg.virginia.edu/TMP/Encryption/$prefix.tar.enc\"><font color=magenta><b>Download Encrypted Result Data Here</font></a> with Accessing Password: <font color=magenta>$encription_password </b></font><br>";
print "Based on the <a href=\"https://searchsecurity.techtarget.com/definition/Advanced-Encryption-Standard\" target=AES>Advanced Encryption Standard</a> of <a href=\"https://en.wikipedia.org/wiki/Advanced_Encryption_Standard\" target=AES128><b>AES128</b></a> Encryption Mechanism!</h2>";
}elsif($Encryption eq "AES192"){
print "<br><center>******** <i>As to How to Decrypt the Advanced Encrypted Result Files, Please Contact Dr. Jeff Chen: xc3m\@virginia.edu for Technical Support</i> **********</center>";
print "<h2><a href=\"http://king.cphg.virginia.edu/TMP/Encryption/$prefix.tar.enc\"><font color=magenta><b>Download Encrypted Result Data Here</font></a> with Accessing Password: <font color=magenta>$encription_password </b></font><br>";
print "Based on the <a href=\"https://searchsecurity.techtarget.com/definition/Advanced-Encryption-Standard\" target=AES>Advanced Encryption Standard</a> of <a href=\"https://en.wikipedia.org/wiki/Advanced_Encryption_Standard\" target=AES192><b>AES192</b></a> Encryption Mechanism!</h2>";
}elsif($Encryption eq "Base64"){
print "<br><center>******** <i>As to How to Decrypt the Advanced Encrypted Result Files, Please Contact Dr. Jeff Chen: xc3m\@virginia.edu for Technical Support</i> **********</center>";
print "<center>";
print "<h2><a href=\"http://king.cphg.virginia.edu/TMP/Encryption/$prefix.tar.base64\"><font color=magenta><b>Download Encrypted Result Data Here</font></a> with Accessing Password: <font color=magenta>$encription_password </b></font><br>";
print "Based on the <a href=\"https://searchsecurity.techtarget.com/definition/Advanced-Encryption-Standard\" target=AES>Advanced Encryption Standard</a> of <a href=\"https://en.wikipedia.org/wiki/Base64\" target=base64><b>base64</b></a> Encryption Mechanism!</h2>>";
print "</center>";
}
print "</td></tr></table></center>";
print <<END_HTML;
<center><br><hr><br>
<table bgcolor=white><tr><td align=center>
<b><br>This <a href="https://en.wikipedia.org/wiki/Common_Gateway_Interface">CGI Program</a> was first setup on August 28, 2019, last updated by <a href="http://people.virginia.edu/~xc3m/" target=Dr.XianfengJeffChen>Dr. Jeff Chen</a>
(<a href="https://www.linkedin.com/in/xianfeng-jeff-chen-ph-d-50b36772" target=Dr.Xianfeng(Jeff)Chen>
<img src="../linkedin.png"> </a>
<a href="https://twitter.com/XianfengC" target=Dr.JeffChen><img src="../twitter.png">  </a>
<a href="https://www.youtube.com/watch?v=KYQ2dPW5nEU" target=ComputationAndSystemsBiology><img src="../youtube.png"></a>)
on September 11, 2019.</b><br><br><br></td><tr></table>
</center><br><hr><br>
</body>
</html>
END_HTML
exit(0);