X-Git-Url: http://git.ipfire.org/?p=people%2Fpmueller%2Fipfire-2.x.git;a=blobdiff_plain;f=html%2Fcgi-bin%2Faliases.cgi;h=9043962c2df17d1df660845b1a6baddb709b8937;hp=4b475c144bdbfa966096e35670f79a725d0ef7d3;hb=fb35962cca894498fc48a9249255600d776777c0;hpb=cb5e9c6c64d5281eba5c790f14c2e5f3066becbf diff --git a/html/cgi-bin/aliases.cgi b/html/cgi-bin/aliases.cgi index 4b475c144b..9043962c2d 100644 --- a/html/cgi-bin/aliases.cgi +++ b/html/cgi-bin/aliases.cgi @@ -1,13 +1,26 @@ #!/usr/bin/perl +############################################################################### +# # +# IPFire.org - A linux based firewall # +# Copyright (C) 2007 Michael Tremer & Christian Schmidt # +# # +# This program 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 3 of the License, or # +# (at your option) any later version. # +# # +# This program 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 this program. If not, see . # +# # +############################################################################### # -# IPFire CGI's - aliases.cgi +# this cgi is base on IPCop CGI - aliases.cgi # -# This code is distributed under the terms of the GPL -# -# (c) Steve Bootes 2002/04/13 - Manage IP Aliases -# -# $Id: aliases.cgi,v 1.5.2.14 2006/01/13 20:14:48 eoberlander Exp $ - # to fully troubleshot your code, uncomment diagnostics, Carp and cluck lines #use diagnostics; # need to add the file /usr/lib/perl5/5.8.x/pods/perldiag.pod before to work @@ -17,7 +30,7 @@ use strict; #use Carp (); #local $SIG{__WARN__} = \&Carp::cluck; -require '/var/ipfire/general-functions.pl'; # replace /var/ipfire with /var/ipfire in case of manual install +require '/var/ipfire/general-functions.pl'; # replace /var/ipcop with /var/ipcop in case of manual install require "${General::swroot}/lang.pl"; require "${General::swroot}/header.pl"; @@ -106,7 +119,8 @@ if ($settings{'ACTION'} eq $Lang::tr{'toggle enable disable'}) { #move out new line chomp(@current[$settings{'KEY1'}]); my @temp = split(/\,/,@current[$settings{'KEY1'}]); - $temp[1] = $temp[1] eq 'on' ? '' : 'on'; # Toggle the field + $temp[1] = $temp[1] eq 'on' ? 'off' : 'on'; # Toggle the field + $temp[2] = '' if ( $temp[2] eq '' ); @current[$settings{'KEY1'}] = join (',',@temp)."\n"; $settings{'KEY1'} = ''; # End edit mode @@ -247,7 +261,7 @@ END # # Second check box is for editing the list # -$checked{'ENABLED'}{'on'} = ($settings{'ENABLED'} eq '') ? '' : "checked='checked'"; +$checked{'ENABLED'}{'on'} = ($settings{'ENABLED'} eq 'on') ? "checked='checked'" : '' ; my $buttontext = $Lang::tr{'add'}; if ($settings{'KEY1'} ne '') { @@ -274,8 +288,10 @@ print < - - + + +
* $Lang::tr{'this field may be blank'}* $Lang::tr{'this field may be blank'} +
@@ -283,6 +299,20 @@ END ; &Header::closebox(); +# Add visual indicators to column headings to show sort order - EO +my $sortarrow1 = ''; +my $sortarrow2 = ''; + +if ($netsettings{'SORT_ALIASES'} eq 'NAMERev') { + $sortarrow1 = $Header::sortdn; +} elsif ($netsettings{'SORT_ALIASES'} eq 'NAME') { + $sortarrow1 = $Header::sortup; +} elsif ($netsettings{'SORT_ALIASES'} eq 'IPRev') { + $sortarrow2 = $Header::sortdn; +} else { + $sortarrow2 = $Header::sortup; +} + # # Third box shows the list, in columns # @@ -292,9 +322,9 @@ END print < - $Lang::tr{'name'} - $Lang::tr{'alias ip'} - $Lang::tr{'action'} + $Lang::tr{'name'} $sortarrow1 + $Lang::tr{'alias ip'} $sortarrow2 + $Lang::tr{'action'} END ;