]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blame - html/cgi-bin/country.cgi
VPN Checksubnets: Now the remote subnets (OpenVPN/IPSec) are checked. If they are...
[people/teissler/ipfire-2.x.git] / html / cgi-bin / country.cgi
CommitLineData
dace10b5 1#!/usr/bin/perl
70df8302
MT
2###############################################################################
3# #
4# IPFire.org - A linux based firewall #
5# Copyright (C) 2007 Michael Tremer & Christian Schmidt #
6# #
7# This program is free software: you can redistribute it and/or modify #
8# it under the terms of the GNU General Public License as published by #
9# the Free Software Foundation, either version 3 of the License, or #
10# (at your option) any later version. #
11# #
12# This program is distributed in the hope that it will be useful, #
13# but WITHOUT ANY WARRANTY; without even the implied warranty of #
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
15# GNU General Public License for more details. #
16# #
17# You should have received a copy of the GNU General Public License #
18# along with this program. If not, see <http://www.gnu.org/licenses/>. #
19# #
20###############################################################################
dace10b5
MT
21
22use strict;
23
24use Locale::Country;
25
95fb58a3 26my $flagdir = '/srv/web/ipfire/html/images/flags';
dace10b5
MT
27my $lines = '1';
28my $lines2 = '';
29my @flaglist=();
30my @flaglistfiles=();
31my $flag = '';
32
df8c7810 33require '/var/ipfire/general-functions.pl';
dace10b5
MT
34require "${General::swroot}/lang.pl";
35require "${General::swroot}/header.pl";
36
37&Header::showhttpheaders();
38
39&Header::openpage('Country Codes', 1, '');
40&Header::openbigbox('100%', 'LEFT');
41
42&Header::openbox('100%', 'LEFT', 'Flags & Country Codes:');
4250f386
AM
43print "<TABLE WIDTH='100%' border='0' class='tbl'>";
44print "<tr><th width='5%'><b>Flag</b></th>";
45print "<th width='5%'><b>Code</b></th>";
534943c6 46print "<th width='40%'><b>$Lang::tr{'country'}</b></th>";
4250f386
AM
47print "<th><b>&nbsp;</b></th>";
48print "<th width='5%'><b>Flag</b></th>";
49print "<th width='5%'><b>Code</b></th>";
534943c6 50print "<th width='40%'><b>$Lang::tr{'country'}</b></th></tr>";
dace10b5
MT
51
52@flaglist = <$flagdir/*>;
53
54undef @flaglistfiles;
55
56foreach (@flaglist)
57{
58 if (!-d) { push(@flaglistfiles,substr($_,rindex($_,"/")+1)); }
59}
4250f386 60my $col="";
dace10b5
MT
61foreach $flag (@flaglistfiles)
62{
63 $lines++;
4250f386
AM
64
65 my $flagcode = uc(substr($flag, 0, 2));
66 my $fcode = lc($flagcode);
dace10b5 67 my $country = Locale::Country::code2country($fcode);
4250f386
AM
68 if($fcode eq 'eu') { $country = 'Europe'; }
69 if($fcode eq 'tp') { $country = 'East Timor'; }
70 if($fcode eq 'yu') { $country = 'Yugoslavia'; }
71 if ($lines % 2) {
72 print "<td $col><a name='$fcode'/><img src='/images/flags/$fcode.png' border='0' align='absmiddle' alt='$flagcode'</td>";
73 print "<td $col>$flagcode</td>";
74 print "<td $col>$country</td></tr>\n";
75}
76else {
dace10b5
MT
77 $lines2++;
78 if($lines2 % 2) {
4250f386
AM
79 print "<tr>";
80 $col="bgcolor='${Header::table2colour}'";
dace10b5 81 } else {
4250f386
AM
82 print "<tr>";
83 $col="bgcolor='${Header::table1colour}'";
84 }
85 print "<td $col><a name='$fcode'/><img src='/images/flags/$fcode.png' border='0' align='absmiddle' alt='$flagcode'</td>";
86 print "<td $col>$flagcode</td>";
87 print "<td $col>$country</td>";
88 print "<td $col>&nbsp;</td>";
dace10b5 89 }
dace10b5
MT
90}
91
92
93print "</TABLE>";
94&Header::closebox();
95
96&Header::closebigbox();
97
98print <<END
99<div align='center'>
100<table width='80%'>
101<tr>
102<td align='center'><a href='$ENV{'HTTP_REFERER'}'>$Lang::tr{'back'}</a></td>
103</tr>
104</table>
105</div>
106END
107;
108
109&Header::closepage();
110
111