Changeset 33 for trunk/dns.cgi


Ignore:
Timestamp:
11/10/09 17:51:55 (15 years ago)
Author:
Kris Deugau
Message:

/trunk

checkpoint, fleshing out axfr import

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dns.cgi

    r31 r33  
    601601  $page->param(rwsoa => $webvar{rwsoa}) if $webvar{rwsoa};
    602602  $page->param(rwns => $webvar{rwns}) if $webvar{rwns};
     603  $page->param(dominactive => 1) unless $webvar{domactive};
    603604  $page->param(importdoms => $webvar{importdoms}) if $webvar{importdoms};
    604605##work
     606
     607##fixme: check group too?
     608  if ($webvar{doit} eq 'y' && !$webvar{ifrom}) {
     609    $page->param(errmsg => "Need to set host to import from");
     610  } elsif ($webvar{doit} eq 'y' && !$webvar{importdoms}) {
     611    $page->param(errmsg => "Need domains to import");
     612  } else {
     613    my @domlist = split /\s+/, $webvar{importdoms};
     614    my @results;
     615my $rnum = 0;
     616    foreach my $domain (@domlist) {
     617      # do stuff!  DNSDB::importAXFR($webvar{ifrom}, $webvar{rwsoa}, $webvar{rwns}, $domain, <flags>)
     618      my %row;
     619      $row{domain} = $domain;
     620#      $row{row} = $rnum++;
     621      if ($domain eq 'deepnet.cx' || $domain eq 'wh-int') {
     622        $row{domok} = 0;  $row{domerr} = "foo!  hahahaha!";
     623      } elsif ($domain eq 'waslokido.com') {
     624        $row{domwarn} = 0;  $row{domwarn} = "foo!  hahahaha!";
     625      } else {
     626        $row{domok} = 1;
     627      }
     628      push @results, \%row;
     629    }
     630    $page->param(axfrresults => \@results);
     631  }
     632
    605633  push @debugbits, "<pre>$webvar{importdoms}</pre>";
    606634}
Note: See TracChangeset for help on using the changeset viewer.