webaccess.cgi: Fixed language settings.
Message ID | 1453108450-17427-1-git-send-email-erik.kapfer@ipfire.org |
---|---|
State | Accepted |
Commit | bcb30674e2f7f3fe4989bffe5fbc43d44be86633 |
Headers |
Return-Path: <development-bounces@lists.ipfire.org> Received: from mail01.ipfire.org (mail01.tremer.info [172.28.1.200]) by septima.ipfire.org (Postfix) with ESMTP id 979866142F for <patchwork@ipfire.org>; Mon, 18 Jan 2016 10:24:23 +0100 (CET) Received: from hedwig.ipfire.org (localhost [IPv6:::1]) by mail01.ipfire.org (Postfix) with ESMTP id 65F2EA35; Mon, 18 Jan 2016 10:24:23 +0100 (CET) Received: from ipfire-server.local (dslb-188-104-207-135.188.104.pools.vodafone-ip.de [188.104.207.135]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id CDEB7109; Mon, 18 Jan 2016 10:24:20 +0100 (CET) From: Erik Kapfer <erik.kapfer@ipfire.org> To: development@lists.ipfire.org Subject: [PATCH] webaccess.cgi: Fixed language settings. Date: Mon, 18 Jan 2016 10:14:10 +0100 Message-Id: <1453108450-17427-1-git-send-email-erik.kapfer@ipfire.org> X-Mailer: git-send-email 2.4.4 X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: IPFire development talk <development.lists.ipfire.org> List-Unsubscribe: <http://lists.ipfire.org/mailman/options/development>, <mailto:development-request@lists.ipfire.org?subject=unsubscribe> List-Archive: <http://lists.ipfire.org/pipermail/development/> List-Post: <mailto:development@lists.ipfire.org> List-Help: <mailto:development-request@lists.ipfire.org?subject=help> List-Subscribe: <http://lists.ipfire.org/mailman/listinfo/development>, <mailto:development-request@lists.ipfire.org?subject=subscribe> Errors-To: development-bounces@lists.ipfire.org Sender: "Development" <development-bounces@lists.ipfire.org> |
Message
Erik Kapfer
Jan. 18, 2016, 8:14 p.m. UTC
Fix for #10879. Added also use strict.
Signed-off-by: Erik Kapfer <erik.kapfer@ipfire.org>
---
html/cgi-bin/webaccess.cgi | 25 ++++++++++++++++++-------
1 file changed, 18 insertions(+), 7 deletions(-)
Comments
Thanks. Merged. On Mon, 2016-01-18 at 10:14 +0100, Erik Kapfer wrote: > Fix for #10879. Added also use strict. > > Signed-off-by: Erik Kapfer <erik.kapfer@ipfire.org> > --- > html/cgi-bin/webaccess.cgi | 25 ++++++++++++++++++------- > 1 file changed, 18 insertions(+), 7 deletions(-) > > diff --git a/html/cgi-bin/webaccess.cgi b/html/cgi-bin/webaccess.cgi > index afa3770..0d50f01 100644 > --- a/html/cgi-bin/webaccess.cgi > +++ b/html/cgi-bin/webaccess.cgi > @@ -19,8 +19,18 @@ > # > # > #################################################################### > ########### > > +use strict; > + > +#usable only the following on debugging purpose > +#use warnings; > +#use CGI::Carp 'fatalsToBrowser'; > use CGI; > > +require '/var/ipfire/general-functions.pl'; > +require "${General::swroot}/lang.pl"; > +require "${General::swroot}/header.pl"; > + > + > my $swroot = "/var/ipfire"; > my $apdir = "$swroot/proxy/advanced"; > my $group_def_file = "$apdir/cre/classrooms"; > @@ -31,6 +41,7 @@ my $acl_src_noaccess_mac = > "$apdir/acls/src_noaccess_mac.acl"; > my $banner = "A D V A N C E D P R O X Y - W E B > A C C E S S M A N A G E R"; > my %cgiparams; > my %proxysettings; > +my %temp; > > my %acl=(); > my @group_defs=(); > @@ -49,8 +60,8 @@ require "${swroot}/lang.pl"; > > foreach (@groups) > { > - if ($cgiparams{$_} eq $tr{'advproxy mode deny'}) { > $acl{$_}='on'; } > - if ($cgiparams{$_} eq $tr{'advproxy mode allow'}) { > $acl{$_}='off'; } > + if ($cgiparams{$_} eq $Lang::tr{'advproxy mode deny'}) { > $acl{$_}='on'; } > + if ($cgiparams{$_} eq $Lang::tr{'advproxy mode allow'}) { > $acl{$_}='off'; } > } > > &read_all_groups; > @@ -144,7 +155,7 @@ if (($is_supervisor) && > ((defined($proxysettings{'SUPERVISOR_PASSWORD'})) && (!( > { > print <<END > <td align='center'> > - <font face='verdana,arial,helvetica' > color='#000000' size='2'>$tr{'advproxy supervisor password'}:</font> > + <font face='verdana,arial,helvetica' > color='#000000' size='2'>$Lang::tr{'advproxy supervisor > password'}:</font> > </td> > <td align='center'><input type='password' > name='PASSWORD' size='15'></td> > END > @@ -176,11 +187,11 @@ END > if ((defined($acl{$_})) && ($acl{$_} eq > 'on')) > { > print "</td><td width='120' > align='center'>"; > - print "<input type='submit' > name='$_' value=' $tr{'advproxy mode allow'} '>"; > + print "<input type='submit' > name='$_' value=' $Lang::tr{'advproxy mode allow'} '>"; > print "</td><td width='16' > bgcolor='#D00000'> </td>\n"; > } else { > print "</td><td width='120' > align='center'>"; > - print "<input type='submit' > name='$_' value=' $tr{'advproxy mode deny'} '>"; > + print "<input type='submit' > name='$_' value=' $Lang::tr{'advproxy mode deny'} '>"; > print "</td><td width='16' > bgcolor='#00A000'> </td>\n"; > } > } > @@ -199,14 +210,14 @@ END > } else { > print " <tr>\n"; > print " <td align='center'>\n"; > - print " <font face='verdana,arial,helvetica' > color='#000000' size='2'>$tr{'advproxy no cre groups'}</font>\n"; > + print " <font face='verdana,arial,helvetica' > color='#000000' size='2'>$Lang::tr{'advproxy no cre > groups'}</font>\n"; > print " </td>\n"; > print " </tr>\n"; > } > } else { > print " <tr>\n"; > print " <td align='center'>\n"; > - print " <font face='verdana,arial,helvetica' > color='#000000' size='2'>$tr{'advproxy cre disabled'}</font>\n"; > + print " <font face='verdana,arial,helvetica' > color='#000000' size='2'>$Lang::tr{'advproxy cre > disabled'}</font>\n"; > print " </td>\n"; > print " </tr>\n"; > }