%# BEGIN LICENSE BLOCK %# %# Copyright (c) 1996-2002 Jesse Vincent %# %# (Except where explictly superceded by other copyright notices) %# %# This work is made available to you under the terms of Version 2 of %# the GNU General Public License. A copy of that license should have %# been provided with this software, but in any event can be snarfed %# from www.gnu.org %# %# This work 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. %# %# %# Unless otherwise specified, all modifications, corrections or %# extensions to this work which alter its source code become the %# property of Best Practical Solutions, LLC when submitted for %# inclusion in the work. %# %# %# END LICENSE BLOCK <& /RTIR/Elements/Header, Title => $title &> <& /RTIR/Tools/Elements/Tabs, current_toptab => 'RTIR/Tools/Lookup.html', current_tab => 'RTIR/Tools/Lookup.html?NewSearch=1', current_subtab => $current_subtab, Title => $title &> % if ($ticket) { <& /Elements/TitleBoxStart, title => loc("Current [_1]: #[_2]", $TicketType, $ticket), color=> "#993333" &> <& /RTIR/Elements/TicketHeader, Type => $TicketType, %ARGS &> <& /RTIR/Elements/TicketRow, Type => $TicketType, Ticket => $TicketObj, %ARGS &>
<& /Elements/TitleBoxEnd &>
% } %if (! $ARGS{'HideResults'}) {
<& /Elements/TitleBoxStart, title => loc('Incidents: [_1]', $q) &> <& /RTIR/Elements/IncidentSummary, Type => $TicketType, ticket => $ticket, q => $q &> <& /Elements/TitleBoxEnd&>
<& /Elements/TitleBoxStart, title => loc('Incident Reports: [_1]', $q), color=> "#336633"&> <& /RTIR/Elements/ChildSummary, Queue => 'Incident Reports', Type => $TicketType, ticket => $ticket, lookuptype => $type, q => $q &> <& /Elements/TitleBoxEnd&>
<& /Elements/TitleBoxStart, title => loc('Investigations: [_1]', $q), color=> "#336633" &> <& /RTIR/Elements/ChildSummary, Queue => 'Investigations', Type => $TicketType, ticket => $ticket, lookuptype => $type, q => $q &> <& /Elements/TitleBoxEnd &>
<& /Elements/TitleBoxStart, title => loc('Blocks: [_1]', $q), color=> "#336633" &> <& /RTIR/Elements/ChildSummary, Queue => 'Blocks', Type => $TicketType, ticket => $ticket, lookuptype => $type, q => $q &> <& /Elements/TitleBoxEnd &>
% }

Look Up Information

>
WHOIS: at
Traceroute to:

% if ($q) {

WHOIS Results

% } % if ($error){ <%$error%> % } % if ($iterator) { % while (my $obj = $iterator->next) { % my @lines_starting_with_space = grep ( /^(\s+)(\w+)/, $obj->content()); % if ($handparse || $#lines_starting_with_space >= 4) { #we couldn't parse that. suck % my $content = join("", $obj->content()); % $m->comp( '/RTIR/Elements/MakeClicky', ticket => $TicketObj, url_params => "ticket=".$ticket."&server=$server", content => \$content);
<%$content|n%>

% } else { Structured RIPE whois data returned. Click here to manually parse this data.
Warnings <%$obj->warnings%>
errors <%$obj->errors%>
% foreach my $attribute ($obj->attributes()) { % foreach my $value ($obj->$attribute()) { <%$attribute%>: % $m->comp( '/RTIR/Elements/MakeClicky', ticket => $TicketObj, url_params => "ticket=".$ticket, content => \$value); <%$value|n%>
% } % } % } % } % } <%init> foreach my $s (sort keys %$servers) { # just pick the first one $server = $servers->{$s} unless ($server); last; } use Net::Whois::RIPE; my $query = Net::Whois::RIPE->new($server); my ($iterator, $error); if ($query) { $iterator = $query->query_iterator($q); } else { $error = "Unable to connect to whois server '$server'"; } $ARGS{'ClearRestrictions'}="1"; $ARGS{'AttachmentField'}="Content"; $ARGS{'AttachmentFieldOp'}="LIKE"; $ARGS{'ValueOfAttachmentField'}=$q; if (! $session{'tickets'}) { # Init a new search $session{'tickets'} = RT::Tickets->new( $session{'CurrentUser'} ); } my $title = "Lookup $q using server $server"; my $ticketcount; $session{'i'}++; if ($session{'tickets'}) { if ($ARGS{'DeleteRestriction'}) { $session{'tickets'}->DeleteRestriction($ARGS{'DeleteRestriction'}); } if ( ($ARGS{'ClearRestrictions'}) || ($ARGS{'NewSearch'}) ) { $session{'tickets'}->ClearRestrictions; } } ProcessSearchQuery(ARGS=>\%ARGS); $session{'tickets'}->RedoSearch(); if ( $session{'tickets'}->DescribeRestrictions()) { $ticketcount = $session{tickets}->Count(); } my $current_subtab; if ($q) { $current_subtab = 'RTIR/Tools/Lookup.html?q='.$q."&server=".$server; } my $TicketType; my $TicketObj; if ($ticket) { $TicketType = $m->scomp("/RTIR/Elements/Type", Ticket => $ticket); $TicketType =~ s/\s*$//; $TicketObj = LoadTicket($ticket); } <%args> $servers => $RT::whois $server => undef $handparse => 1 $q => undef $type => undef $ticket => undef