ispman/lib/ISPMan DomainMan.pm,1.65,1.66

Joerg Delker <[email protected]>
Newsgroups gmane.comp.isp.ispman.cvs
Message-ID <[email protected]>
Update of /cvsroot/ispman/ispman/lib/ISPMan
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7768

Modified Files:
	DomainMan.pm 
Log Message:
removing hardcoded "is{$type}Domain" functions in favour of more generic checkDomainType function.


Index: DomainMan.pm
===================================================================
RCS file: /cvsroot/ispman/ispman/lib/ISPMan/DomainMan.pm,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -d -r1.65 -r1.66
--- DomainMan.pm	2 May 2004 17:11:01 -0000	1.65
+++ DomainMan.pm	24 May 2004 20:14:30 -0000	1.66
@@ -94,10 +94,6 @@
 prepareDNSBranch
 getDomainDN
 domainExists
-isPrimaryDomain
-isSlaveDomain
-isReplicaDomain
-isNoDnsDomain
 addDomainFileServerProcess
 addDomainSMTPProcess
 addDomainDNSProcess
@@ -324,23 +320,25 @@
 sub checkDomainType {
    my $self=shift;
    my $domain=shift;
+   my $type=shift;
    my $domaintype=$self->getDomainType($domain);
-   if ($domaintype !~ /primary/i) {
-      print "Sorry, this is not a primary domain.";
+   if ($domaintype !~ /$type/i) {
+      print "Sorry, this is not a $type domain.";
       return 0;
    }
    return 1;
 
 =item B<checkDomainType>
 
-checks if the Domain is primary/slave/nodns or replica.
-returns true if the domain is primary
+Accepts $domain, $type
+
+returns true if domain $domain is of type $type
 returns false otherwise.
 
 I<EXAMPLE>
 
 
-$ispman->checkDomainType("domain.name");
+$ispman->checkDomainType("domain.name","primary");
 
 
 =cut
@@ -1167,87 +1165,6 @@
 }
 
 
-sub isNoDnsDomain {
-   my $self=shift;
-   my ( $domain ) =@_;
-   my $domaintype=$self->getDomainType($domain);
-   return  $domaintype eq "nodns";
-
-
-=item B<isNoDnsDomain>
-
-returns true if the domain is a nodns domain
-returns false otherwise.
-
-
-=cut
-
-
-}
-
-
-sub isPrimaryDomain {
-   my $self=shift;
-   my ( $domain ) =@_;
-   my $domaintype=$self->getDomainType($domain);
-   return  $domaintype eq "primary";
-
-
-=item B<isPrimaryDomain>
-
-returns true if the domain is primary
-returns false otherwise.
-
-I<EXAMPLE>
-
-
-$ispman->isPrimaryDomain("domain.name");
-
-
-=cut
-
-
-}
-
-
-sub isReplicaDomain {
-   my $self=shift;
-   my ( $domain ) =@_;
-   my $domaintype=$self->getDomainType($domain);
-   return  $domaintype eq "replica";
-
-
-=item B<isReplicaDomain>
-
-returns true if the domain is a replica domain
-returns false otherwise.
-
-
-=cut
-
-
-}
-
-
-sub isSlaveDomain {
-   my $self=shift;
-   my ( $domain ) =@_;
-   my $domaintype=$self->getDomainType($domain);
-   return  $domaintype eq "slave";
-
-
-=item B<isSlaveDomain>
-
-returns true if the domain is a slave domain
-returns false otherwise.
-
-
-=cut
-
-
-}
-
-
 sub lockDomain {
    my $self=shift;
    my ($domain, $owner)=@_;



-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
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.