Changeset 92


Ignore:
Timestamp:
11/30/04 15:42:30 (20 years ago)
Author:
Kris Deugau
Message:

/trunk

Port updates and bugfixes from /branches/stable r87:91 back
into devel tree

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/assign.html

    r87 r92  
    66<td>Customer location:&nbsp</td><td>
    77<select name="city"><option selected>-</option>
    8 <option>Barrie</option>
    9 <option>Blind River</option>
    10 <option>Brockville</option>
    11 <option>Bracebridge</option>
    12 <option>Burk's Falls</option>
    13 <option>Burlington</option>
    14 <option>Chapleau</option>
    15 <option>Chelmsford</option>
    16 <option>Espanola</option>
    17 <option>Elliot Lake</option>
    18 <option>Hamilton</option>
    19 <option>Huntsville</option>
    20 <option>Ingresoll</option>
    21 <option>Gravenhurst</option>
    22 <option>Guelph</option>
    23 <option>Kapuskasing</option>
    24 <option>Kingston</option>
    25 <option>Kirkland Lake</option>
    26 <option>Little Current</option>
    27 <option>London</option>
    28 <option>Marathon</option>
    29 <option>Manitoulin</option>
    30 <option>Newmarket</option>
    31 <option>North Bay</option>
    32 <option>Oakville</option>
    33 <option>Oshawa</option>
    34 <option>Ottawa</option>
    35 <option>Parry Sound</option>
    36 <option>Peel</option>
    37 <option>Peterborough</option>
    38 <option>Pembroke</option>
    39 <option>Sault Ste. Marie</option>
    40 <option>Sturgeon Falls</option>
    41 <option>Sudbury</option>
    42 <option>Timmins</option>
    43 <option>Thessalon</option>
    44 <option>Thunder Bay</option>
    45 <option>Toronto</option>
    46 <option>Wawa</option>
    47 <option>Windsor</option>
     8$$ALLCITIES$$
    489</select>
    4910</td>
     
    7738<td>Route from/through:&nbsp</td><td>
    7839<select name="pop"><option selected>-</option>
    79 <option>Blind River</option>
    80 <option>Chelmsford</option>
    81 <option>Elliot Lake</option>
    82 <option>Espanola</option>
    83 <option>Huntsville</option>
    84 <option>Little Current</option>
    85 <option>Lively</option>
    86 <option>North Bay</option>
    87 <option>Ottawa</option>
    88 <option>Pembroke</option>
    89 <option>Sault Ste. Marie</option>
    90 <option>Sturgeon</option>
    91 <option>Sudbury</option>
    92 <option>Timmins</option>
    93 <option>Thunder Bay</option>
    94 <option>Toronto</option>
    95 <option>Valley</option>
     40$$POPLIST$$
    9641</select>
    9742</td>
  • trunk/cgi-bin/ipdb.psql

    r74 r92  
    55
    66--
    7 -- TOC Entry ID 18 (OID 16556)
     7-- TOC Entry ID 22 (OID 16556)
    88--
    99-- Name: "plpgsql_call_handler" () Type: FUNCTION Owner: postgres
     
    1313
    1414--
    15 -- TOC Entry ID 19 (OID 16557)
     15-- TOC Entry ID 23 (OID 16557)
    1616--
    1717-- Name: plpgsql Type: PROCEDURAL LANGUAGE Owner:
     
    217217GRANT ALL on "allocations" to "ipdb";
    218218
     219--
     220-- TOC Entry ID 18 (OID 92809)
     221--
     222-- Name: alloctypes Type: TABLE Owner: ipdb
     223--
     224
     225CREATE TABLE "alloctypes" (
     226        "type" character(2) DEFAULT '' NOT NULL,
     227        "listname" character varying(40) DEFAULT '',
     228        "dispname" character varying(40) DEFAULT '',
     229        "listorder" integer DEFAULT 0,
     230        Constraint "alloctypes_pkey" Primary Key ("type")
     231);
     232
     233--
     234-- TOC Entry ID 19 (OID 92809)
     235--
     236-- Name: alloctypes Type: ACL Owner:
     237--
     238
     239REVOKE ALL on "alloctypes" from PUBLIC;
     240GRANT ALL on "alloctypes" to "kdeugau";
     241GRANT ALL on "alloctypes" to "ipdb";
     242
     243--
     244-- TOC Entry ID 20 (OID 93964)
     245--
     246-- Name: cities Type: TABLE Owner: ipdb
     247--
     248
     249CREATE TABLE "cities" (
     250        "city" character varying(30) DEFAULT '' NOT NULL,
     251        "routing" character(1) DEFAULT 'n' NOT NULL,
     252        Constraint "cities_pkey" Primary Key ("city")
     253);
     254
     255--
     256-- TOC Entry ID 21 (OID 93964)
     257--
     258-- Name: cities Type: ACL Owner:
     259--
     260
     261REVOKE ALL on "cities" from PUBLIC;
     262GRANT ALL on "cities" to "kdeugau";
     263GRANT ALL on "cities" to "ipdb";
     264
  • trunk/cgi-bin/main.cgi

    r87 r92  
    6868# Other global variables
    6969my @masterblocks;
     70my @citylist;
     71my @poplist;
    7072my %allocated;  # Count for allocated blocks in a master block
    7173my %free;       # Count for free blocks (routed and unrouted) in a master block
     
    7779# Use the connectDB function, otherwise we end up confusing ourselves
    7880my $ip_dbh = connectDB;
     81my $sth;
    7982
    8083# Slurp up the master block list - we need this several places
    8184# While we're at it, initialize the related hashes.
    82 my $sth = $ip_dbh->prepare("select * from masterblocks order by cidr");
     85$sth = $ip_dbh->prepare("select * from masterblocks order by cidr");
    8386$sth->execute;
    8487for (my $i=0; my @data = $sth->fetchrow_array(); $i++) {
     
    9194}
    9295
     96# Initialize the city and poplist arrays
     97$sth = $ip_dbh->prepare("select * from cities order by city");
     98$sth->execute;
     99my $i = 0;
     100my $j = 0;
     101while (my @data = $sth->fetchrow_array) {
     102  $citylist[$i++] = $data[0];
     103  if ($data[1] eq 'y') {
     104    $poplist[$j++] = $data[0];
     105  }
     106}
    93107
    94108
     
    778792        or croak "Could not open assign.html: $!";
    779793    $html = join('',<HTML>);
     794    close HTML;
    780795    my $masterlist = "<select name=allocfrom><option selected>-</option>\n";
    781796    foreach my $master (@masterblocks) {
     
    784799    $masterlist .= "</select>\n";
    785800    $html =~ s|\$\$MASTERLIST\$\$|$masterlist|g;
    786     close HTML;
    787   }
     801    my $pops = '';
     802    foreach my $pop (@poplist) {
     803      $pops .= "<option>$pop</option>\n";
     804    }
     805    $html =~ s|\$\$POPLIST\$\$|$pops|g;
     806  }
     807  my $cities = '';
     808  foreach my $city (@citylist) {
     809    $cities .= "<option>$city</option>\n";
     810  }
     811  $html =~ s|\$\$ALLCITIES\$\$|$cities|g;
    788812
    789813  print $html;
     
    940964  $html =~ s|\$\$CIRCID\$\$|$webvar{circid}|g;
    941965  $webvar{desc} = desanitize($webvar{desc});
     966  $html =~ s|\$\$DESC\$\$|$webvar{desc}|g;
    942967  $webvar{notes} = desanitize($webvar{notes});
    943   $html =~ s|\$\$DESC\$\$|$webvar{desc}|g;
    944968  $html =~ s|\$\$NOTES\$\$|$webvar{notes}|g;
    945969  $html =~ s|\$\$ACTION\$\$|insert|g;
     
    13031327
    13041328  $html =~ s/\$\$BLOCK\$\$/$webvar{block}/g;
     1329  $webvar{city} = desanitize($webvar{city});
    13051330  $html =~ s/\$\$CITY\$\$/$webvar{city}/g;
    13061331  $html =~ s/\$\$ALLOCTYPE\$\$/$webvar{alloctype}/g;
    13071332  $html =~ s/\$\$TYPEFULL\$\$/$full_alloc_types{$webvar{alloctype}}/g;
    13081333  $html =~ s/\$\$CUSTID\$\$/$webvar{custid}/g;
     1334  $webvar{circid} = desanitize($webvar{circid});
    13091335  $html =~ s/\$\$CIRCID\$\$/$webvar{circid}/g;
     1336  $webvar{desc} = desanitize($webvar{desc});
    13101337  $html =~ s/\$\$DESC\$\$/$webvar{desc}/g;
     1338  $webvar{notes} = desanitize($webvar{notes});
    13111339  $html =~ s/\$\$NOTES\$\$/$webvar{notes}/g;
    13121340
  • trunk/changes.html

    r87 r92  
    1313
    1414<tr class="color1">
     15<td valign=top>11/30/2004</td>
     16<td>Overhauled the city listings;  they should be somewhat more complete now.  Still needs a
     17mechanism to easily add new cities.
     18</td></tr>
     19<tr class="color2">
    1520<td valign=top>11/26/2004</td>
    1621<td>Allocating a static IP is now a little different.  Use the "Customer Location" field to
  • trunk/fb-assign.html

    r87 r92  
    77<td>City:&nbsp</td><td>
    88<select name="city"><option selected>-</option>
    9 <option>Barrie</option>
    10 <option>Blind River</option>
    11 <option>Brockville</option>
    12 <option>Bracebridge</option>
    13 <option>Burk's Falls</option>
    14 <option>Burlington</option>
    15 <option>Chapleau</option>
    16 <option>Chelmsford</option>
    17 <option>Espanola</option>
    18 <option>Elliot Lake</option>
    19 <option>Hamilton</option>
    20 <option>Huntsville</option>
    21 <option>Ingresoll</option>
    22 <option>Gravenhurst</option>
    23 <option>Guelph</option>
    24 <option>Kapuskasing</option>
    25 <option>Kingston</option>
    26 <option>Kirkland Lake</option>
    27 <option>Little Current</option>
    28 <option>London</option>
    29 <option>Marathon</option>
    30 <option>Manitoulin</option>
    31 <option>Newmarket</option>
    32 <option>North Bay</option>
    33 <option>Oakville</option>
    34 <option>Oshawa</option>
    35 <option>Ottawa</option>
    36 <option>Parry Sound</option>
    37 <option>Peel</option>
    38 <option>Peterborough</option>
    39 <option>Pembroke</option>
    40 <option>Sault Ste. Marie</option>
    41 <option>Sturgeon Falls</option>
    42 <option>Sudbury</option>
    43 <option>Timmins</option>
    44 <option>Thessalon</option>
    45 <option>Thunder Bay</option>
    46 <option>Toronto</option>
    47 <option>Wawa</option>
    48 <option>Windsor</option>
     9$$ALLCITIES$$
    4910</select>
    5011</td>
Note: See TracChangeset for help on using the changeset viewer.