Changeset 285


Ignore:
Timestamp:
Sep 21, 2005, 5:58:37 PM (17 years ago)
Author:
Kris Deugau
Message:

/trunk help.html

Tweak up new search system to work properly - searchme view
was missing the 'notes' field.
Tweak quick search to search CustIDs for alphanumerics.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/cgi-bin/ipdb.psql

    r284 r285  
    101101GRANT ALL on "allocations" to "ipdb";
    102102
    103 CREATE VIEW "searchme" as SELECT allocations.cidr, allocations.custid, allocations."type", allocations.city, allocations.description FROM allocations UNION SELECT poolips.ip, poolips.custid, poolips.type, poolips.city, poolips.description FROM poolips;
     103CREATE VIEW "searchme" as SELECT allocations.cidr, allocations.custid, allocations."type", allocations.city, allocations.description, allocations.notes FROM allocations UNION SELECT poolips.ip, poolips.custid, poolips.type, poolips.city, poolips.description, poolips.notes FROM poolips;
    104104
    105105REVOKE ALL on "searchme" from PUBLIC;
  • trunk/cgi-bin/search.cgi

    r234 r285  
    6060    $webvar{input} =~ s/^\s+//;
    6161    $webvar{input} =~ s/\s+$//;
    62     if ($webvar{input} =~ /^[\d\.]+(\/\d{1,3})?$/) {
     62    if ($webvar{input} =~ /^\d+$/) {
     63      # All-digits, new custID
     64      $searchfor = "cust";
     65    } elsif ($webvar{input} =~ /^[\d\.]+(\/\d{1,3})?$/) {
    6366      # IP addresses should only have numbers, digits, and maybe a slash+netmask
    6467      $searchfor = "ipblock";
    65     } elsif ($webvar{input} =~ /^\d+$/) {
    66       # All-digits, new custID
    67       $searchfor = "cust";
    6868    } else {
    6969      # Anything else.
     
    140140  ## CIDR query options.
    141141  $webvar{cidr} =~ s/\s+//;     # Hates the nasty spaceseseses we does.
    142   if ($webvar{cidr} =~ /\//) {
     142  if ($webvar{cidr} == '') { # We has a blank CIDR.  Ignore it.
     143  } elsif ($webvar{cidr} =~ /\//) {
    143144    # 209.91.179/26 should show all /26 subnets in 209.91.179
    144145    my ($net,$maskbits) = split /\//, $webvar{cidr};
     
    291292    print qq(<div class="heading">Searching for descriptions containing '$query'</div><br>\n);
    292293    # Query based on description (includes "name" from old DB).
    293     $sql = "select * from searchme where description ilike '%$query%'";
     294    $sql = "select * from searchme where description ilike '%$query%'".
     295        " or custid ilike '%$query%'";
    294296    my $count = countRows($sql);
    295297    $sql .= " order by cidr limit $RESULTS_PER_PAGE offset $offset";
  • trunk/help.html

    r234 r285  
    1414
    1515<tr class="color1">
    16 <td>Class-C-sized IP blocks</td><td>209.91.128</td>
    17 <td>Lists all alloctions starting with that set of octets</td>
     16<td>IP blocks</td><td>209.91.128 or 209.</td>
     17<td>Lists all alloctions starting with that set of octets.  Note that matches on the
     18first octet MUST include the period to be considered an IP search.</td>
    1819</tr>
    1920<tr class="color2">
    2021<td>CIDR blocks</td><td>209.92.128/30</br>or
    21 209.92.128.0/30</td><td>lists all /30's beginning with 209.91.128</td>
     22209.92.128.0/30</td><td>Lists all /30's beginning with 209.91.128 or checks for an
     23exact match for 209.92.128.0/30 respectively</td>
    2224</tr>
    2325<tr class="color1">
     
    3032Matches on prefix (area code, area code + exchange, etc).
    3133</td>
     34</tr>
     35<tr class="color1">
     36<td>Description:</td><td>cable or efni</td><td>Find all allocations with the search term in
     37the description.  Note that searches for CustIDs with letters will fall under this category
     38until CustIDs are all-numeric.</td>
    3239</tr>
    3340
Note: See TracChangeset for help on using the changeset viewer.