SMP-Config angepasst.. CGIs usw. wurden im Windoof-Format gespeichert... muss noch alles korrigiert werden...

git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@67 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8
This commit is contained in:
ms
2006-02-21 20:38:06 +00:00
parent 7ac38dc927
commit ac1cfefab2
49 changed files with 42817 additions and 42814 deletions

View File

@@ -1,250 +1,250 @@
package Countries;
%countries = (
'Afghanistan' => 'AF',
'Albania' => 'AL',
'Algeria' => 'DZ',
'American Samoa' => 'AS',
'Andorra' => 'AD',
'Angola' => 'AO',
'Anguilla' => 'AI',
'Antarctica' => 'AQ',
'Antigua and Barbuda' => 'AG',
'Argentina' => 'AR',
'Armenia' => 'AM',
'Aruba' => 'AW',
'Australia' => 'AU',
'Austria' => 'AT',
'Azerbaijan' => 'AZ',
'Bahamas' => 'BS',
'Bahrain' => 'BH',
'Bangladesh' => 'BD',
'Barbados' => 'BB',
'Belarus' => 'BY',
'Belgium' => 'BE',
'Belize' => 'BZ',
'Benin' => 'BJ',
'Bermuda' => 'BM',
'Bhutan' => 'BT',
'Bolivia' => 'BO',
'Bosnia and Herzegovina' => 'BA',
'Botswana' => 'BW',
'Bouvet Island' => 'BV',
'Brazil' => 'BR',
'British Indian Ocean Territory' => 'IO',
'Brunei Darussalam' => 'BN',
'Bulgaria' => 'BG',
'Burkina Faso' => 'BF',
'Burundi' => 'BI',
'Cambodia' => 'KH',
'Cameroon' => 'CM',
'Canada' => 'CA',
'Cape Verde' => 'CV',
'Cayman Islands' => 'KY',
'Central African Republic' => 'CF',
'Chad' => 'TD',
'Chile' => 'CL',
'China' => 'CN',
'Christmas Island' => 'CX',
'Cocos (Keeling) Islands' => 'CC',
'Colombia' => 'CO',
'Comoros' => 'KM',
'Congo' => 'CG',
'Cook Islands' => 'CK',
'Costa Rica' => 'CR',
'Cote D\'Ivoire (Ivory Coast)' => 'CI',
'Croatia (Hrvatska)' => 'HR',
'Cuba' => 'CU',
'Cyprus' => 'CY',
'Czech Republic' => 'CZ',
'Czechoslovakia (former)' => 'CS',
'Denmark' => 'DK',
'Djibouti' => 'DJ',
'Dominica' => 'DM',
'Dominican Republic' => 'DO',
'East Timor' => 'TP',
'Ecuador' => 'EC',
'Egypt' => 'EG',
'El Salvador' => 'SV',
'Equatorial Guinea' => 'GQ',
'Eritrea' => 'ER',
'Estonia' => 'EE',
'Ethiopia' => 'ET',
'Falkland Islands (Malvinas)' => 'FK',
'Faroe Islands' => 'FO',
'Fiji' => 'FJ',
'Finland' => 'FI',
'France' => 'FR',
'France, Metropolitan' => 'FX',
'French Guiana' => 'GF',
'French Polynesia' => 'PF',
'French Southern Territories' => 'TF',
'Gabon' => 'GA',
'Gambia' => 'GM',
'Georgia' => 'GE',
'Germany' => 'DE',
'Ghana' => 'GH',
'Gibraltar' => 'GI',
'Great Britain (UK)' => 'GB',
'Greece' => 'GR',
'Greenland' => 'GL',
'Grenada' => 'GD',
'Guadeloupe' => 'GP',
'Guam' => 'GU',
'Guatemala' => 'GT',
'Guinea' => 'GN',
'Guinea-Bissau' => 'GW',
'Guyana' => 'GY',
'Haiti' => 'HT',
'Heard and McDonald Islands' => 'HM',
'Honduras' => 'HN',
'Hong Kong' => 'HK',
'Hungary' => 'HU',
'Iceland' => 'IS',
'India' => 'IN',
'Indonesia' => 'ID',
'Iran' => 'IR',
'Iraq' => 'IQ',
'Ireland' => 'IE',
'Israel' => 'IL',
'Italy' => 'IT',
'Jamaica' => 'JM',
'Japan' => 'JP',
'Jordan' => 'JO',
'Kazakhstan' => 'KZ',
'Kenya' => 'KE',
'Kiribati' => 'KI',
'Korea (North)' => 'KP',
'Korea (South)' => 'KR',
'Kuwait' => 'KW',
'Kyrgyzstan' => 'KG',
'Laos' => 'LA',
'Latvia' => 'LV',
'Lebanon' => 'LB',
'Lesotho' => 'LS',
'Liberia' => 'LR',
'Libya' => 'LY',
'Liechtenstein' => 'LI',
'Lithuania' => 'LT',
'Luxembourg' => 'LU',
'Macau' => 'MO',
'Macedonia' => 'MK',
'Madagascar' => 'MG',
'Malawi' => 'MW',
'Malaysia' => 'MY',
'Maldives' => 'MV',
'Mali' => 'ML',
'Malta' => 'MT',
'Marshall Islands' => 'MH',
'Martinique' => 'MQ',
'Mauritania' => 'MR',
'Mauritius' => 'MU',
'Mayotte' => 'YT',
'Mexico' => 'MX',
'Micronesia' => 'FM',
'Moldova' => 'MD',
'Monaco' => 'MC',
'Mongolia' => 'MN',
'Montserrat' => 'MS',
'Morocco' => 'MA',
'Mozambique' => 'MZ',
'Myanmar' => 'MM',
'Namibia' => 'NA',
'Nauru' => 'NR',
'Nepal' => 'NP',
'Netherlands Antilles' => 'AN',
'Netherlands' => 'NL',
'Neutral Zone' => 'NT',
'New Caledonia' => 'NC',
'New Zealand (Aotearoa)' => 'NZ',
'Nicaragua' => 'NI',
'Niger' => 'NE',
'Nigeria' => 'NG',
'Niue' => 'NU',
'Norfolk Island' => 'NF',
'Northern Mariana Islands' => 'MP',
'Norway' => 'NO',
'Oman' => 'OM',
'Pakistan' => 'PK',
'Palau' => 'PW',
'Panama' => 'PA',
'Papua New Guinea' => 'PG',
'Paraguay' => 'PY',
'Peru' => 'PE',
'Philippines' => 'PH',
'Pitcairn' => 'PN',
'Poland' => 'PL',
'Portugal' => 'PT',
'Puerto Rico' => 'PR',
'Qatar' => 'QA',
'Reunion' => 'RE',
'Romania' => 'RO',
'Russian Federation' => 'RU',
'Rwanda' => 'RW',
'S. Georgia and S. Sandwich Isls.' => 'GS',
'Saint Kitts and Nevis' => 'KN',
'Saint Lucia' => 'LC',
'Saint Vincent and the Grenadines' => 'VC',
'Samoa' => 'WS',
'San Marino' => 'SM',
'Sao Tome and Principe' => 'ST',
'Saudi Arabia' => 'SA',
'Senegal' => 'SN',
'Seychelles' => 'SC',
'Sierra Leone' => 'SL',
'Singapore' => 'SG',
'Slovak Republic' => 'SK',
'Slovenia' => 'SI',
'Solomon Islands' => 'Sb',
'Somalia' => 'SO',
'South Africa' => 'ZA',
'Spain' => 'ES',
'Sri Lanka' => 'LK',
'St. Helena' => 'SH',
'St. Pierre and Miquelon' => 'PM',
'Sudan' => 'SD',
'Suriname' => 'SR',
'Svalbard and Jan Mayen Islands' => 'SJ',
'Swaziland' => 'SZ',
'Sweden' => 'SE',
'Switzerland' => 'CH',
'Syria' => 'SY',
'Taiwan' => 'TW',
'Tajikistan' => 'TJ',
'Tanzania' => 'TZ',
'Thailand' => 'TH',
'Togo' => 'TG',
'Tokelau' => 'TK',
'Tonga' => 'TO',
'Trinidad and Tobago' => 'TT',
'Tunisia' => 'TN',
'Turkey' => 'TR',
'Turkmenistan' => 'TM',
'Turks and Caicos Islands' => 'TC',
'Tuvalu' => 'TV',
'US Minor Outlying Islands' => 'UM',
'USSR (former)' => 'SU',
'Uganda' => 'UG',
'Ukraine' => 'UA',
'United Arab Emirates' => 'AE',
'United Kingdom' => 'UK',
'United States' => 'US',
'Uruguay' => 'UY',
'Uzbekistan' => 'UZ',
'Vanuatu' => 'VU',
'Vatican City State (Holy See)' => 'VA',
'Venezuela' => 'VE',
'Viet Nam' => 'VN',
'Virgin Islands (British)' => 'VG',
'Virgin Islands (U.S.)' => 'VI',
'Wallis and Futuna Islands' => 'WF',
'Western Sahara' => 'EH',
'Yemen' => 'YE',
'Yugoslavia' => 'YU',
'Zaire' => 'ZR',
'Zambia' => 'ZM',
'Zimbabwe' => 'ZW',
);
1;
package Countries;
%countries = (
'Afghanistan' => 'AF',
'Albania' => 'AL',
'Algeria' => 'DZ',
'American Samoa' => 'AS',
'Andorra' => 'AD',
'Angola' => 'AO',
'Anguilla' => 'AI',
'Antarctica' => 'AQ',
'Antigua and Barbuda' => 'AG',
'Argentina' => 'AR',
'Armenia' => 'AM',
'Aruba' => 'AW',
'Australia' => 'AU',
'Austria' => 'AT',
'Azerbaijan' => 'AZ',
'Bahamas' => 'BS',
'Bahrain' => 'BH',
'Bangladesh' => 'BD',
'Barbados' => 'BB',
'Belarus' => 'BY',
'Belgium' => 'BE',
'Belize' => 'BZ',
'Benin' => 'BJ',
'Bermuda' => 'BM',
'Bhutan' => 'BT',
'Bolivia' => 'BO',
'Bosnia and Herzegovina' => 'BA',
'Botswana' => 'BW',
'Bouvet Island' => 'BV',
'Brazil' => 'BR',
'British Indian Ocean Territory' => 'IO',
'Brunei Darussalam' => 'BN',
'Bulgaria' => 'BG',
'Burkina Faso' => 'BF',
'Burundi' => 'BI',
'Cambodia' => 'KH',
'Cameroon' => 'CM',
'Canada' => 'CA',
'Cape Verde' => 'CV',
'Cayman Islands' => 'KY',
'Central African Republic' => 'CF',
'Chad' => 'TD',
'Chile' => 'CL',
'China' => 'CN',
'Christmas Island' => 'CX',
'Cocos (Keeling) Islands' => 'CC',
'Colombia' => 'CO',
'Comoros' => 'KM',
'Congo' => 'CG',
'Cook Islands' => 'CK',
'Costa Rica' => 'CR',
'Cote D\'Ivoire (Ivory Coast)' => 'CI',
'Croatia (Hrvatska)' => 'HR',
'Cuba' => 'CU',
'Cyprus' => 'CY',
'Czech Republic' => 'CZ',
'Czechoslovakia (former)' => 'CS',
'Denmark' => 'DK',
'Djibouti' => 'DJ',
'Dominica' => 'DM',
'Dominican Republic' => 'DO',
'East Timor' => 'TP',
'Ecuador' => 'EC',
'Egypt' => 'EG',
'El Salvador' => 'SV',
'Equatorial Guinea' => 'GQ',
'Eritrea' => 'ER',
'Estonia' => 'EE',
'Ethiopia' => 'ET',
'Falkland Islands (Malvinas)' => 'FK',
'Faroe Islands' => 'FO',
'Fiji' => 'FJ',
'Finland' => 'FI',
'France' => 'FR',
'France, Metropolitan' => 'FX',
'French Guiana' => 'GF',
'French Polynesia' => 'PF',
'French Southern Territories' => 'TF',
'Gabon' => 'GA',
'Gambia' => 'GM',
'Georgia' => 'GE',
'Germany' => 'DE',
'Ghana' => 'GH',
'Gibraltar' => 'GI',
'Great Britain (UK)' => 'GB',
'Greece' => 'GR',
'Greenland' => 'GL',
'Grenada' => 'GD',
'Guadeloupe' => 'GP',
'Guam' => 'GU',
'Guatemala' => 'GT',
'Guinea' => 'GN',
'Guinea-Bissau' => 'GW',
'Guyana' => 'GY',
'Haiti' => 'HT',
'Heard and McDonald Islands' => 'HM',
'Honduras' => 'HN',
'Hong Kong' => 'HK',
'Hungary' => 'HU',
'Iceland' => 'IS',
'India' => 'IN',
'Indonesia' => 'ID',
'Iran' => 'IR',
'Iraq' => 'IQ',
'Ireland' => 'IE',
'Israel' => 'IL',
'Italy' => 'IT',
'Jamaica' => 'JM',
'Japan' => 'JP',
'Jordan' => 'JO',
'Kazakhstan' => 'KZ',
'Kenya' => 'KE',
'Kiribati' => 'KI',
'Korea (North)' => 'KP',
'Korea (South)' => 'KR',
'Kuwait' => 'KW',
'Kyrgyzstan' => 'KG',
'Laos' => 'LA',
'Latvia' => 'LV',
'Lebanon' => 'LB',
'Lesotho' => 'LS',
'Liberia' => 'LR',
'Libya' => 'LY',
'Liechtenstein' => 'LI',
'Lithuania' => 'LT',
'Luxembourg' => 'LU',
'Macau' => 'MO',
'Macedonia' => 'MK',
'Madagascar' => 'MG',
'Malawi' => 'MW',
'Malaysia' => 'MY',
'Maldives' => 'MV',
'Mali' => 'ML',
'Malta' => 'MT',
'Marshall Islands' => 'MH',
'Martinique' => 'MQ',
'Mauritania' => 'MR',
'Mauritius' => 'MU',
'Mayotte' => 'YT',
'Mexico' => 'MX',
'Micronesia' => 'FM',
'Moldova' => 'MD',
'Monaco' => 'MC',
'Mongolia' => 'MN',
'Montserrat' => 'MS',
'Morocco' => 'MA',
'Mozambique' => 'MZ',
'Myanmar' => 'MM',
'Namibia' => 'NA',
'Nauru' => 'NR',
'Nepal' => 'NP',
'Netherlands Antilles' => 'AN',
'Netherlands' => 'NL',
'Neutral Zone' => 'NT',
'New Caledonia' => 'NC',
'New Zealand (Aotearoa)' => 'NZ',
'Nicaragua' => 'NI',
'Niger' => 'NE',
'Nigeria' => 'NG',
'Niue' => 'NU',
'Norfolk Island' => 'NF',
'Northern Mariana Islands' => 'MP',
'Norway' => 'NO',
'Oman' => 'OM',
'Pakistan' => 'PK',
'Palau' => 'PW',
'Panama' => 'PA',
'Papua New Guinea' => 'PG',
'Paraguay' => 'PY',
'Peru' => 'PE',
'Philippines' => 'PH',
'Pitcairn' => 'PN',
'Poland' => 'PL',
'Portugal' => 'PT',
'Puerto Rico' => 'PR',
'Qatar' => 'QA',
'Reunion' => 'RE',
'Romania' => 'RO',
'Russian Federation' => 'RU',
'Rwanda' => 'RW',
'S. Georgia and S. Sandwich Isls.' => 'GS',
'Saint Kitts and Nevis' => 'KN',
'Saint Lucia' => 'LC',
'Saint Vincent and the Grenadines' => 'VC',
'Samoa' => 'WS',
'San Marino' => 'SM',
'Sao Tome and Principe' => 'ST',
'Saudi Arabia' => 'SA',
'Senegal' => 'SN',
'Seychelles' => 'SC',
'Sierra Leone' => 'SL',
'Singapore' => 'SG',
'Slovak Republic' => 'SK',
'Slovenia' => 'SI',
'Solomon Islands' => 'Sb',
'Somalia' => 'SO',
'South Africa' => 'ZA',
'Spain' => 'ES',
'Sri Lanka' => 'LK',
'St. Helena' => 'SH',
'St. Pierre and Miquelon' => 'PM',
'Sudan' => 'SD',
'Suriname' => 'SR',
'Svalbard and Jan Mayen Islands' => 'SJ',
'Swaziland' => 'SZ',
'Sweden' => 'SE',
'Switzerland' => 'CH',
'Syria' => 'SY',
'Taiwan' => 'TW',
'Tajikistan' => 'TJ',
'Tanzania' => 'TZ',
'Thailand' => 'TH',
'Togo' => 'TG',
'Tokelau' => 'TK',
'Tonga' => 'TO',
'Trinidad and Tobago' => 'TT',
'Tunisia' => 'TN',
'Turkey' => 'TR',
'Turkmenistan' => 'TM',
'Turks and Caicos Islands' => 'TC',
'Tuvalu' => 'TV',
'US Minor Outlying Islands' => 'UM',
'USSR (former)' => 'SU',
'Uganda' => 'UG',
'Ukraine' => 'UA',
'United Arab Emirates' => 'AE',
'United Kingdom' => 'UK',
'United States' => 'US',
'Uruguay' => 'UY',
'Uzbekistan' => 'UZ',
'Vanuatu' => 'VU',
'Vatican City State (Holy See)' => 'VA',
'Venezuela' => 'VE',
'Viet Nam' => 'VN',
'Virgin Islands (British)' => 'VG',
'Virgin Islands (U.S.)' => 'VI',
'Wallis and Futuna Islands' => 'WF',
'Western Sahara' => 'EH',
'Yemen' => 'YE',
'Yugoslavia' => 'YU',
'Zaire' => 'ZR',
'Zambia' => 'ZM',
'Zimbabwe' => 'ZW',
);
1;

File diff suppressed because it is too large Load Diff

View File

@@ -1,24 +1,24 @@
sub genmenu
{
... snip ...
if ( ! -e "${General::swroot}/proxy/enable" && ! -e "${General::swroot}/proxy/enable_blue" ) {
splice (@{$menu{'2.status'}{'subMenu'}}, 4, 1);
splice (@{$menu{'7.mainlogs'}{'subMenu'}}, 2, 1);
}
# Read additionnal menus entry
# this have to be hardened and accepted. To be extended.
opendir (DIR, "${General::swroot}/addon-menu");
while (my $menuitem = readdir (DIR)) {
if ( $menuitem =~ /^menu\.([1-6]\..*)\..*/) { #model is "menu.(N.submenu).filename"
my $submenu = $1;
open (FILE,"${General::swroot}/addon-menu/$menuitem") or die;
while (my $text = <FILE>) { # file may content many entry
splice (@{$menu{$submenu}{'subMenu'}} ,-1,0, [ eval($text) ] );
}
close (FILE);
}
}
closedir (DIR);
}
sub genmenu
{
... snip ...
if ( ! -e "${General::swroot}/proxy/enable" && ! -e "${General::swroot}/proxy/enable_blue" ) {
splice (@{$menu{'2.status'}{'subMenu'}}, 4, 1);
splice (@{$menu{'7.mainlogs'}{'subMenu'}}, 2, 1);
}
# Read additionnal menus entry
# this have to be hardened and accepted. To be extended.
opendir (DIR, "${General::swroot}/addon-menu");
while (my $menuitem = readdir (DIR)) {
if ( $menuitem =~ /^menu\.([1-6]\..*)\..*/) { #model is "menu.(N.submenu).filename"
my $submenu = $1;
open (FILE,"${General::swroot}/addon-menu/$menuitem") or die;
while (my $text = <FILE>) { # file may content many entry
splice (@{$menu{$submenu}{'subMenu'}} ,-1,0, [ eval($text) ] );
}
close (FILE);
}
}
closedir (DIR);
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,160 +1,160 @@
# SmoothWall CGIs
#
# This code is distributed under the terms of the GPL
#
# (c) The SmoothWall Team
# Copyright (c) 2002/08/23 Mark Wormgoor <mark@wormgoor.com> Split from header.pl
#
# $Id: lang.pl,v 1.1.2.11 2005/09/10 16:22:50 eoberlander Exp $
#
package Lang;
require 'CONFIG_ROOT/general-functions.pl';
use strict;
### A cache file to avoid long recalculation
$Lang::CacheLang = '/var/run/cache-lang.pl';
# When you want to add your own language strings/entries to the ipcop language file,
# you should create a file with <PREFIX>.<LANG>.pl into CONFIG_ROOT/addon-lang dir
# <PREFIX> is free choosable but should be significant. An Example might be "myAddnName"
# <LANG> is a mnemonic of the used language like en, de, it, nl etc.
# You can find a detailed list of possible mnemonic's in the file CONFIG_ROOT/langs/list
# A file could be named "VirtualHttpd.en.pl" for example.
#
# The file content has to start with (of course without the leading #):
# --------- CODE ---------
#%tr = (%tr,
# 'key1' => 'value', # add all your entries key/values here
# 'key2' => 'value' # and end with (of course without the leading #):
#);
# --------- CODE END---------
#
# After you have copied all your files to CONFIG_ROOT/add-lang you have to run the
# script compilation:
# perl -e "require '/CONFIG_ROOT/lang.pl'; &Lang::BuildCacheLang"
### Initialize language
%Lang::tr = ();
my %settings = ();
&General::readhash("${General::swroot}/main/settings", \%settings);
reload($settings{'LANGUAGE'});
# language variable used by makegraphs script
our $language;
$language = $settings{'LANGUAGE'};
#
# Load requested language file from cachefile. If cachefile doesn't exist, build on the fly.
# (it is a developper options)
#
sub reload {
my ($LG) = @_;
%Lang::tr = (); # start with a clean array
# Use CacheLang if present & not empty.
if (-s "$Lang::CacheLang.$LG" ) {
##fix: need to put a lock_shared on it in case rebuild is active ?
do "$Lang::CacheLang.$LG";
#&General::log ("cachelang file used [$LG]");
return;
}
#&General::log("Building on the fly cachelang file for [$LG]");
do "${General::swroot}/langs/en.pl";
do "${General::swroot}/langs/$LG.pl" if ($LG ne 'en');
my $AddonDir = ${General::swroot}.'/addon-lang';
opendir (DIR, $AddonDir);
my @files = readdir (DIR);
closedir (DIR);
# default is to load english first
foreach my $file ( grep (/.*\.en.pl$/,@files)) {
do "$AddonDir/$file";
}
# read again, overwriting 'en' with choosed lang
if ($LG ne 'en') {
foreach my $file (grep (/.*\.$LG\.pl$/,@files) ) {
do "$AddonDir/$file";
}
}
}
#
# Assume this procedure is called with enough privileges.
# Merge ipcop langage file + all other extension found in addon-lang
# to build a 'cachefile' for selected language
#
sub BuildUniqueCacheLang {
my ($LG) = @_;
# Make CacheLang empty so that it won't be used by Lang::reload
open (FILE, ">$Lang::CacheLang.$LG") or return 1;
flock (FILE, 2) or return 1;
close (FILE);
# Load languages files
&Lang::reload ($LG);
# Write the unique %tr=('key'=>'value') array
open (FILE, ">$Lang::CacheLang.$LG") or return 1;
flock (FILE, 2) or return 1;
print FILE '%tr=(';
foreach my $k ( keys %Lang::tr ){
$Lang::tr{$k} =~ s/\'/\\\'/g; # quote ' => \'
print FILE "'$k' => '$Lang::tr{$k}',"; # key => value,
}
print FILE ');';
close (FILE);
# Make nobody:nobody file's owner
# Will work when called by root/rc.sysinit
chown (0,0,"$Lang::CacheLang.$LG");
chmod (0004,"$Lang::CacheLang.$LG");
return 0;
}
#
# Switch Ipcop Language for each lang then call build cachelang
#
sub BuildCacheLang {
my $AddonDir = ${General::swroot}.'/addon-lang';
# Correct permission in case addon-installer did not do it
opendir (DIR, $AddonDir);
my @files = readdir (DIR);
foreach my $file (@files) {
next if (($file eq '..') || ($file eq '.'));
chown (0,0,"$AddonDir/$file");
chmod (0004,"$AddonDir/$file");
}
closedir (DIR);
my $selected = '';;
my $missed = '';
my $error = 0;
open (LANGS, "${General::swroot}/langs/list");
while (<LANGS>) {
($selected) = split (':');
if (BuildUniqueCacheLang ($selected) == 1) {
$missed = $selected; # will try latter. Can only be the current cachelang file locked
};
}
close (LANGS);
if ($missed) { # collision with current cache lang being used ?
$error = &BuildUniqueCacheLang ($missed);
}
&General::log ("WARNING: cannot build cachelang file for [$missed].") if ($error);
return $error;
}
1;
# SmoothWall CGIs
#
# This code is distributed under the terms of the GPL
#
# (c) The SmoothWall Team
# Copyright (c) 2002/08/23 Mark Wormgoor <mark@wormgoor.com> Split from header.pl
#
# $Id: lang.pl,v 1.1.2.11 2005/09/10 16:22:50 eoberlander Exp $
#
package Lang;
require 'CONFIG_ROOT/general-functions.pl';
use strict;
### A cache file to avoid long recalculation
$Lang::CacheLang = '/var/run/cache-lang.pl';
# When you want to add your own language strings/entries to the ipcop language file,
# you should create a file with <PREFIX>.<LANG>.pl into CONFIG_ROOT/addon-lang dir
# <PREFIX> is free choosable but should be significant. An Example might be "myAddnName"
# <LANG> is a mnemonic of the used language like en, de, it, nl etc.
# You can find a detailed list of possible mnemonic's in the file CONFIG_ROOT/langs/list
# A file could be named "VirtualHttpd.en.pl" for example.
#
# The file content has to start with (of course without the leading #):
# --------- CODE ---------
#%tr = (%tr,
# 'key1' => 'value', # add all your entries key/values here
# 'key2' => 'value' # and end with (of course without the leading #):
#);
# --------- CODE END---------
#
# After you have copied all your files to CONFIG_ROOT/add-lang you have to run the
# script compilation:
# perl -e "require '/CONFIG_ROOT/lang.pl'; &Lang::BuildCacheLang"
### Initialize language
%Lang::tr = ();
my %settings = ();
&General::readhash("${General::swroot}/main/settings", \%settings);
reload($settings{'LANGUAGE'});
# language variable used by makegraphs script
our $language;
$language = $settings{'LANGUAGE'};
#
# Load requested language file from cachefile. If cachefile doesn't exist, build on the fly.
# (it is a developper options)
#
sub reload {
my ($LG) = @_;
%Lang::tr = (); # start with a clean array
# Use CacheLang if present & not empty.
if (-s "$Lang::CacheLang.$LG" ) {
##fix: need to put a lock_shared on it in case rebuild is active ?
do "$Lang::CacheLang.$LG";
#&General::log ("cachelang file used [$LG]");
return;
}
#&General::log("Building on the fly cachelang file for [$LG]");
do "${General::swroot}/langs/en.pl";
do "${General::swroot}/langs/$LG.pl" if ($LG ne 'en');
my $AddonDir = ${General::swroot}.'/addon-lang';
opendir (DIR, $AddonDir);
my @files = readdir (DIR);
closedir (DIR);
# default is to load english first
foreach my $file ( grep (/.*\.en.pl$/,@files)) {
do "$AddonDir/$file";
}
# read again, overwriting 'en' with choosed lang
if ($LG ne 'en') {
foreach my $file (grep (/.*\.$LG\.pl$/,@files) ) {
do "$AddonDir/$file";
}
}
}
#
# Assume this procedure is called with enough privileges.
# Merge ipcop langage file + all other extension found in addon-lang
# to build a 'cachefile' for selected language
#
sub BuildUniqueCacheLang {
my ($LG) = @_;
# Make CacheLang empty so that it won't be used by Lang::reload
open (FILE, ">$Lang::CacheLang.$LG") or return 1;
flock (FILE, 2) or return 1;
close (FILE);
# Load languages files
&Lang::reload ($LG);
# Write the unique %tr=('key'=>'value') array
open (FILE, ">$Lang::CacheLang.$LG") or return 1;
flock (FILE, 2) or return 1;
print FILE '%tr=(';
foreach my $k ( keys %Lang::tr ){
$Lang::tr{$k} =~ s/\'/\\\'/g; # quote ' => \'
print FILE "'$k' => '$Lang::tr{$k}',"; # key => value,
}
print FILE ');';
close (FILE);
# Make nobody:nobody file's owner
# Will work when called by root/rc.sysinit
chown (0,0,"$Lang::CacheLang.$LG");
chmod (0004,"$Lang::CacheLang.$LG");
return 0;
}
#
# Switch Ipcop Language for each lang then call build cachelang
#
sub BuildCacheLang {
my $AddonDir = ${General::swroot}.'/addon-lang';
# Correct permission in case addon-installer did not do it
opendir (DIR, $AddonDir);
my @files = readdir (DIR);
foreach my $file (@files) {
next if (($file eq '..') || ($file eq '.'));
chown (0,0,"$AddonDir/$file");
chmod (0004,"$AddonDir/$file");
}
closedir (DIR);
my $selected = '';;
my $missed = '';
my $error = 0;
open (LANGS, "${General::swroot}/langs/list");
while (<LANGS>) {
($selected) = split (':');
if (BuildUniqueCacheLang ($selected) == 1) {
$missed = $selected; # will try latter. Can only be the current cachelang file locked
};
}
close (LANGS);
if ($missed) { # collision with current cache lang being used ?
$error = &BuildUniqueCacheLang ($missed);
}
&General::log ("WARNING: cannot build cachelang file for [$missed].") if ($error);
return $error;
}
1;

View File

@@ -1,162 +1,162 @@
# Protocols Data File
#
# This file is part of the IPCop Firewall.
#
# IPCop is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# IPCop is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with IPCop; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# (c) The IPCop Team
#
# $Id: protocols.pl,v 1.2.2.1 2005/01/26 12:23:20 riddles Exp $
#
# Generated from /etc/protocols using:
# cat /etc/protocols | grep -ve "^#" | grep -v "^$" | \
# awk '{ print "\"" $1 "\" => \"" $2 "\","}'
#
# Code supplied by Mark Wormgroor
#
package Protocols;
%protocols = (
"ip" => "0",
"icmp" => "1",
"igmp" => "2",
"ggp" => "3",
"ipencap" => "4",
"st" => "5",
"tcp" => "6",
"cbt" => "7",
"egp" => "8",
"igp" => "9",
"bbn-rcc" => "10",
"nvp" => "11",
"pup" => "12",
"argus" => "13",
"emcon" => "14",
"xnet" => "15",
"chaos" => "16",
"udp" => "17",
"mux" => "18",
"dcn" => "19",
"hmp" => "20",
"prm" => "21",
"xns-idp" => "22",
"trunk-1" => "23",
"trunk-2" => "24",
"leaf-1" => "25",
"leaf-2" => "26",
"rdp" => "27",
"irtp" => "28",
"iso-tp4" => "29",
"netblt" => "30",
"mfe-nsp" => "31",
"merit-inp" => "32",
"sep" => "33",
"3pc" => "34",
"idpr" => "35",
"xtp" => "36",
"ddp" => "37",
"idpr-cmtp" => "38",
"tp++" => "39",
"il" => "40",
"ipv6" => "41",
"sdrp" => "42",
"ipv6-route" => "43",
"ipv6-frag" => "44",
"idrp" => "45",
"rsvp" => "46",
"gre" => "47",
"mhrp" => "48",
"bna" => "49",
"ipv6-crypt" => "50",
"ipv6-auth" => "51",
"i-nlsp" => "52",
"swipe" => "53",
"narp" => "54",
"mobile" => "55",
"tlsp" => "56",
"skip" => "57",
"ipv6-icmp" => "58",
"ipv6-nonxt" => "59",
"ipv6-opts" => "60",
"cftp" => "62",
"sat-expak" => "64",
"kryptolan" => "65",
"rvd" => "66",
"ippc" => "67",
"sat-mon" => "69",
"visa" => "70",
"ipcv" => "71",
"cpnx" => "72",
"cphb" => "73",
"wsn" => "74",
"pvp" => "75",
"br-sat-mon" => "76",
"sun-nd" => "77",
"wb-mon" => "78",
"wb-expak" => "79",
"iso-ip" => "80",
"vmtp" => "81",
"secure-vmtp" => "82",
"vines" => "83",
"ttp" => "84",
"nsfnet-igp" => "85",
"dgp" => "86",
"tcf" => "87",
"eigrp" => "88",
"ospf" => "89",
"sprite-rpc" => "90",
"larp" => "91",
"mtp" => "92",
"ax.25" => "93",
"ipip" => "94",
"micp" => "95",
"scc-sp" => "96",
"etherip" => "97",
"encap" => "98",
"gmtp" => "100",
"ifmp" => "101",
"pnni" => "102",
"pim" => "103",
"aris" => "104",
"scps" => "105",
"qnx" => "106",
"a/n" => "107",
"ipcomp" => "108",
"snp" => "109",
"compaq-peer" => "110",
"ipx-in-ip" => "111",
"vrrp" => "112",
"pgm" => "113",
"l2tp" => "115",
"ddx" => "116",
"iatp" => "117",
"stp" => "118",
"srp" => "119",
"uti" => "120",
"smp" => "121",
"sm" => "122",
"ptp" => "123",
"isis" => "124",
"fire" => "125",
"crtp" => "126",
"crdup" => "127",
"sscopmce" => "128",
"iplt" => "129",
"sps" => "130",
"pipe" => "131",
"sctp" => "132",
"fc" => "133",
);
# Protocols Data File
#
# This file is part of the IPCop Firewall.
#
# IPCop is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# IPCop is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with IPCop; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# (c) The IPCop Team
#
# $Id: protocols.pl,v 1.2.2.1 2005/01/26 12:23:20 riddles Exp $
#
# Generated from /etc/protocols using:
# cat /etc/protocols | grep -ve "^#" | grep -v "^$" | \
# awk '{ print "\"" $1 "\" => \"" $2 "\","}'
#
# Code supplied by Mark Wormgroor
#
package Protocols;
%protocols = (
"ip" => "0",
"icmp" => "1",
"igmp" => "2",
"ggp" => "3",
"ipencap" => "4",
"st" => "5",
"tcp" => "6",
"cbt" => "7",
"egp" => "8",
"igp" => "9",
"bbn-rcc" => "10",
"nvp" => "11",
"pup" => "12",
"argus" => "13",
"emcon" => "14",
"xnet" => "15",
"chaos" => "16",
"udp" => "17",
"mux" => "18",
"dcn" => "19",
"hmp" => "20",
"prm" => "21",
"xns-idp" => "22",
"trunk-1" => "23",
"trunk-2" => "24",
"leaf-1" => "25",
"leaf-2" => "26",
"rdp" => "27",
"irtp" => "28",
"iso-tp4" => "29",
"netblt" => "30",
"mfe-nsp" => "31",
"merit-inp" => "32",
"sep" => "33",
"3pc" => "34",
"idpr" => "35",
"xtp" => "36",
"ddp" => "37",
"idpr-cmtp" => "38",
"tp++" => "39",
"il" => "40",
"ipv6" => "41",
"sdrp" => "42",
"ipv6-route" => "43",
"ipv6-frag" => "44",
"idrp" => "45",
"rsvp" => "46",
"gre" => "47",
"mhrp" => "48",
"bna" => "49",
"ipv6-crypt" => "50",
"ipv6-auth" => "51",
"i-nlsp" => "52",
"swipe" => "53",
"narp" => "54",
"mobile" => "55",
"tlsp" => "56",
"skip" => "57",
"ipv6-icmp" => "58",
"ipv6-nonxt" => "59",
"ipv6-opts" => "60",
"cftp" => "62",
"sat-expak" => "64",
"kryptolan" => "65",
"rvd" => "66",
"ippc" => "67",
"sat-mon" => "69",
"visa" => "70",
"ipcv" => "71",
"cpnx" => "72",
"cphb" => "73",
"wsn" => "74",
"pvp" => "75",
"br-sat-mon" => "76",
"sun-nd" => "77",
"wb-mon" => "78",
"wb-expak" => "79",
"iso-ip" => "80",
"vmtp" => "81",
"secure-vmtp" => "82",
"vines" => "83",
"ttp" => "84",
"nsfnet-igp" => "85",
"dgp" => "86",
"tcf" => "87",
"eigrp" => "88",
"ospf" => "89",
"sprite-rpc" => "90",
"larp" => "91",
"mtp" => "92",
"ax.25" => "93",
"ipip" => "94",
"micp" => "95",
"scc-sp" => "96",
"etherip" => "97",
"encap" => "98",
"gmtp" => "100",
"ifmp" => "101",
"pnni" => "102",
"pim" => "103",
"aris" => "104",
"scps" => "105",
"qnx" => "106",
"a/n" => "107",
"ipcomp" => "108",
"snp" => "109",
"compaq-peer" => "110",
"ipx-in-ip" => "111",
"vrrp" => "112",
"pgm" => "113",
"l2tp" => "115",
"ddx" => "116",
"iatp" => "117",
"stp" => "118",
"srp" => "119",
"uti" => "120",
"smp" => "121",
"sm" => "122",
"ptp" => "123",
"isis" => "124",
"fire" => "125",
"crtp" => "126",
"crdup" => "127",
"sscopmce" => "128",
"iplt" => "129",
"sps" => "130",
"pipe" => "131",
"sctp" => "132",
"fc" => "133",
);