Changeset 933 for trunk/cgi-bin/main.cgi


Ignore:
Timestamp:
12/08/22 13:44:35 (18 months ago)
Author:
Kris Deugau
Message:

/trunk

Merge inexplicably unmerged get-pool-IPs-as-CSV feature from production
Fix long-missing VLAN display snafu on allocation update "done OK" page
Update @INC-munger in main.cgi
Update copyright block and style

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/cgi-bin/main.cgi

    r922 r933  
    11#!/usr/bin/perl
    22# ipdb/cgi-bin/main.cgi
    3 ###
    4 # SVN revision info
    5 # $Date$
    6 # SVN revision $Rev$
    7 # Last update by $Author$
    8 ###
    9 # Copyright (C) 2004-2016 - Kris Deugau
     3##
     4# $Id$
     5# Copyright (C) 2004-2018,2022 - Kris Deugau <kdeugau@deepnet.cx>
     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##
    1020
    1121use strict;             
     
    2434##uselib##
    2535
    26 # push "the directory the script is in" into @INC
    27 use FindBin;
    28 use lib "$FindBin::RealBin/";
     36# Taint-safe (ish) voodoo to push "the directory the script is in" into @INC.
     37use File::Spec ();
     38use File::Basename ();
     39my $path;
     40BEGIN {
     41    $path = File::Basename::dirname(File::Spec->rel2abs($0));
     42    if ($path =~ /(.*)/) {
     43        $path = $1;
     44    }
     45}
     46use lib $path;
    2947
    3048use CustIDCK;
     
    458476  $page->param(vlan => $poolinfo->{vlan});
    459477  $page->param(poolpctfree => sprintf("%0.1f", $poolinfo->{nfree}/2**(32-$poolinfo->{masklen}) * 100 ) );
     478  $page->param(csvlink => $IPDB::enablecsv);
    460479
    461480  # Tree navigation
     
    485504  my $plist = listPool($ip_dbh, $webvar{pool}, 1);
    486505  $page->param(poolips => $plist);
     506  # CSV voodoo
     507  $page->param(poolid => $webvar{pool});
    487508
    488509  # retrieve any notices
     
    14091430  $page->param(city => $webvar{city});
    14101431  $page->param(disptype => $disp_alloctypes{$webvar{alloctype}});
     1432  $page->param(vlan => $webvar{vlan});
    14111433  $page->param(custid => $webvar{custid});
    14121434  $page->param(swip => $webvar{swip} eq 'on' ? 'Yes' : 'No');
Note: See TracChangeset for help on using the changeset viewer.