ispman/lib/ISPMan/DNSMan NSrecords.pm,1.16,1.17
Joerg Delker <[email protected]>
| Newsgroups | gmane.comp.isp.ispman.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/ispman/ispman/lib/ISPMan/DNSMan
In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv29654/lib/ISPMan/DNSMan
Modified Files:
NSrecords.pm
Log Message:
added new method deleteDNSnSRecord
Index: NSrecords.pm
===================================================================
RCS file: /cvsroot/ispman/ispman/lib/ISPMan/DNSMan/NSrecords.pm,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- NSrecords.pm 4 Aug 2004 17:31:53 -0000 1.16
+++ NSrecords.pm 6 Jun 2006 20:54:48 -0000 1.17
@@ -10,6 +10,7 @@
editDNSnSRecords
addDNSnSRecord
modifyDNSnSRecord
+ deleteDNSnSRecord
getDNSnSRecords
);
$VERSION = '0.01';
@@ -35,7 +36,7 @@
push @{ $self->{'domain'}{'dns'} },
{
'origion' => $h->{$hdn}{'relativeDomainName'},
- 'ttl' => $h->{$hdn}{'DNSTTL'},
+ 'ttl' => $h->{$hdn}{'DNSTTL'},
'host' => $_
};
}
@@ -67,30 +68,28 @@
sub modifyDNSnSRecord {
my $self = shift;
my $r = shift;
+ my $dn = $r->param("dn");
- # add/update record or delete?
- if ( $r->param("host") and $r->param("origion") ) {
-
- # delete old record
- $self->deleteEntry( $r->param("dn") );
+ # delete old record
+ $self->deleteEntry( $dn );
- # add record
- $self->addDNSnSRecord($r);
- }
- else {
+ # add record
+ $self->addDNSnSRecord($r);
+}
-# FIXME
-# Quick&Dirty Patch to delete record. Better do this with direct action in web form
- my $entry = $self->getEntry( $r->param("dn") );
- $self->deleteDNSRecord(
+sub deleteDNSnSRecord {
+ my $self = shift;
+ my $r = shift;
+ my $dn = $r->param("dn");
+
+ my $entry = $self->getEntry( $dn );
+ $self->deleteDNSRecord(
$r->param("ispmanDomain"),
"nSRecord",
$entry->get_value("relativeDomainName"),
$entry->get_value("nSRecord")
- );
- $self->editDNSnSRecords($r);
- }
-
+ );
+ $self->editDNSnSRecords($r);
}
sub addDNSnSRecord {