25 open (UUID, "<UUID"); |
26 open (UUID, "<UUID"); |
26 @uuid = <UUID>; |
27 @uuid = <UUID>; |
27 close UUID; |
28 close UUID; |
28 my $uuid = join(" .:;:. ",@uuid); |
29 my $uuid = join(" .:;:. ",@uuid); |
29 my ($error, $farbe, $aerror); |
30 my ($error, $farbe, $aerror); |
30 if ($cgi->param("anummer") eq ''){ |
31 if ($id eq ''){ |
31 $error="missing Key"; |
32 $error="missing Key"; |
32 $farbe='rot'; |
33 $farbe='rot'; |
33 } |
34 } |
34 else{$farbe="black"} |
35 else{$farbe="black"} |
35 if($cgi->param("anummer") !~ m/^[A-F0-9]{8}\-[A-F0-9]{4}\-[A-F0-9]{4}\-[A-F0-9]{4}\-[A-F0-9]{12}/){ |
36 if($id !~ m/^[A-F0-9]{8}\-[A-F0-9]{4}\-[A-F0-9]{4}\-[A-F0-9]{4}\-[A-F0-9]{12}/){ |
36 $error="invalid Key"; |
37 $error="invalid Key"; |
37 $farbe="red"; |
38 $farbe="red"; |
38 $aerror="Format: 1A2B3C4B-5E6F-7G8H-9I0J-1K2L3M4N5O6P"; |
39 $aerror="Format: 1A2B3C4B-5E6F-7G8H-9I0J-1K2L3M4N5O6P"; |
39 |
40 |
40 } |
41 } |
41 |
42 |
42 if ($cgi->param("anummer") =~ m/^[A-F0-9]{8}\-[A-F0-9]{4}\-[A-F0-9]{4}\-[A-F0-9]{4}\-[A-F0-9]{12}/){ |
43 if ($id =~ m/^[A-F0-9]{8}\-[A-F0-9]{4}\-[A-F0-9]{4}\-[A-F0-9]{4}\-[A-F0-9]{12}/){ |
43 for(my $x=0;$x<=$#uuid;$x++){ |
44 for(my $x=0;$x<=$#uuid;$x++){ |
44 chomp($uuid[$x]); |
45 chomp($uuid[$x]); |
45 if ($cgi->param("anummer") eq $uuid[$x]) { |
46 if ($id eq $uuid[$x]) { |
46 $farbe="black"; |
47 $farbe="black"; |
47 $error=''; |
48 $error=''; |
48 if (-e "/var/www/download/$id"){ |
49 if (-e "/var/www/tmp/$id"){ |
49 last; |
50 last; |
50 } |
51 } |
51 else{$error="Your order will be processed";} |
52 else{$error="Your order will be processed";} |
|
53 my $url='http://192.168.0.144/cgi-bin/scp'; |
|
54 my $ua=LWP::UserAgent->new; |
|
55 my $req=HTTP::Request->new("POST",$url); |
|
56 $req->content("id=$id"); |
|
57 $ua->request($req); |
52 last; |
58 last; |
53 } |
59 } |
54 else {$error="No such ID";} |
60 else {$error="No such ID";} |
55 } |
61 } |
56 } |
62 } |
57 |
63 |
58 if ($error){ |
64 if ($error){ |
59 print CGI::header(-type => "text/html", -charset => "utf-8"); |
65 print CGI::header(-type => "text/html", -charset => "utf-8"); |
60 $tt->process("status.html", { |
66 $tt->process("status.html", { |
61 farbe => $farbe, |
67 farbe => $farbe, |
62 anummer => $cgi->param("anummer"), |
68 anummer => $id, |
63 error => $error, |
69 error => $error, |
64 aerror => $aerror, |
70 aerror => $aerror, |
65 test => $uuid, |
71 test => $uuid, |
66 }) or die $tt->error(); |
72 }) or die $tt->error(); |
67 exit 0; |
73 exit 0; |