ispman/lib/ISPMan/DNSMan CNAMES.pm,1.19,1.20

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-serv29148/lib/ISPMan/DNSMan

Modified Files:
	CNAMES.pm 
Log Message:
added new method deleteDNScNAMERecord
removed obsolete deleteCNAMERecord

Index: CNAMES.pm
===================================================================
RCS file: /cvsroot/ispman/ispman/lib/ISPMan/DNSMan/CNAMES.pm,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- CNAMES.pm	4 Aug 2004 17:31:53 -0000	1.19
+++ CNAMES.pm	6 Jun 2006 20:53:55 -0000	1.20
@@ -10,10 +10,10 @@
   isCNAME
   editDNScNAMERecords
   modifyDNScNAMERecord
+  deleteDNScNAMERecord
   addDNScNAMERecord
   getDNScNAMERecords
   getCNAMERecordsForHost
-  deleteCNAMERecord
 );
 $VERSION = '0.01';
 
@@ -26,11 +26,6 @@
     return $self->entryExists( $branch, $filter );
 }
 
-sub deleteCNAMERecord {    #API function
-    my $self = shift;
-    my ( $domain, $host, $alias ) = @_;
-    $self->deleteDNSRecord( $domain, "cNAMERecord", $alias, $host );
-}
 
 sub getCNAMERecordsForHost {
     my $self = shift;
@@ -110,30 +105,28 @@
 sub modifyDNScNAMERecord {
     my $self = shift;
     my $r    = shift;
+    my $dn   = $r->param("dn");
 
-    # add/update record or delete?
-    if ( $r->param("host") and $r->param("alias") ) {
-
-        # delete old record
-        $self->deleteEntry( $r->param("dn") );
+    # delete old record
+    $self->deleteEntry( $dn );
 
-        # add record
-        $self->addDNScNAMERecord($r);
-    }
-    else {
+    # add record
+    $self->addDNScNAMERecord($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 deleteDNScNAMERecord {
+    my $self = shift;
+    my $r    = shift;
+    my $dn   = $r->param("dn");
+    
+    my $entry = $self->getEntry( $dn );
+    $self->deleteDNSRecord(
             $r->param("ispmanDomain"),
             "cNAMERecord",
             $entry->get_value("relativeDomainName"),
             $entry->get_value("cNAMERecord")
         );
-        $self->editDNScNAMERecords($r);
-    }
-
+    $self->editDNScNAMERecords($r);
 }
 
 1;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.