Changeset 933


Ignore:
Timestamp:
12/08/22 13:44:35 (2 years 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

Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Makefile

    r910 r933  
    3232
    3333HTML = \
    34         alloctypes.html help.html index.shtml ipdb.css rDNS.html
     34        alloctypes.html help.html index.shtml ipdb.css rDNS.html htaccess.example
    3535
    3636JS = templates/widgets.js
     
    6363SCRIPTS = \
    6464        cgi-bin/access-pwd-update.pl cgi-bin/allocate.pl cgi-bin/combineblocks.pl \
    65         cgi-bin/consistency-check.pl cgi-bin/db-update.pl cgi-bin/freespace.pl \
     65        cgi-bin/consistency-check.pl cgi-bin/db-update.pl cgi-bin/freespace.pl cgi-bin/pool2csv.pl \
    6666        \
    6767        cgi-bin/admin.cgi cgi-bin/ipdb-rpc.cgi cgi-bin/main.cgi cgi-bin/newcity.cgi cgi-bin/newnode.cgi \
  • trunk/cgi-bin/IPDB.pm

    r926 r933  
    144144# Append the default domain on unqualified DNS names?
    145145our $append_domain = 1;
     146
     147# Enable link publishing selected IP pool data as a CSV
     148# Not enabled by default due to webserver config required
     149our $enablecsv = 0;
    146150
    147151##
  • trunk/cgi-bin/MyIPDB.pm

    r913 r933  
    101101#$IPDB::append_domain = 1;
    102102
     103## Enable link publishing selected IP pool data as a CSV?
     104# Not enabled by default due to webserver config required
     105#$IPDB::enablecsv = 0;
     106
    103107## connectDB_My()
    104108# Wrapper for IPDB::connectDB
  • 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');
  • trunk/templates/listpool.tmpl

    r917 r933  
    33<TMPL_IF webpath></TMPL_IF>
    44<br>
    5 <div class="tbltitle">Listing pool IPs for <TMPL_VAR NAME=block><br>
    6 (<TMPL_VAR NAME=disptype> in <TMPL_VAR NAME=city>)<TMPL_IF vlan><br>
    7 VLAN <TMPL_VAR NAME=vlan></TMPL_IF>
    8 <TMPL_VAR NAME=poolpctfree>% free</div>
     5<div class="tbltitle">Listing pool IPs for <TMPL_VAR NAME=block>
     6<br>(<TMPL_VAR NAME=disptype> in <TMPL_VAR NAME=city>)
     7<TMPL_IF vlan><br>VLAN <TMPL_VAR NAME=vlan></TMPL_IF>
     8<br><TMPL_VAR NAME=poolpctfree>% free
     9<TMPL_IF csvlink><br><a href="<TMPL_VAR NAME=webpath>/<TMPL_VAR NAME=poolid>-<TMPL_VAR NAME=city>.csv">Download</a> IP, CustID, Description as CSV</TMPL_IF>
     10</div>
    911
    1012<br>
Note: See TracChangeset for help on using the changeset viewer.