ispman/lib/ISPMan DomainMan.pm,1.73,1.74
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-serv6813/lib/ISPMan
Modified Files:
DomainMan.pm
Log Message:
merging addDomain & addNewDomain
Index: DomainMan.pm
===================================================================
RCS file: /cvsroot/ispman/ispman/lib/ISPMan/DomainMan.pm,v
retrieving revision 1.73
retrieving revision 1.74
diff -u -d -r1.73 -r1.74
--- DomainMan.pm 20 Jun 2004 19:04:42 -0000 1.73
+++ DomainMan.pm 26 Jun 2004 08:40:23 -0000 1.74
@@ -59,7 +59,6 @@
editDomain
newDomain
addDomain
- addNewDomain
deleteDomain
delete_domain
suspend_domain
@@ -104,50 +103,6 @@
$VERSION = '0.01';
-sub addDomain {
- my $self = shift;
- my $r = shift;
- my $domaintype = lc( $r->param("ispmanDomainType") );
- my $domain = lc( $r->param("ispmanDomain") );
- $domain =~ s/\s//g; # remove all spaces
- # reset $r->param("ispmanDomain")
- $r->param( "ispmanDomain", $domain );
-
- # reset $r->param("domain") for backword compatibility.
- $r->param( "domain", $domain );
-
- # set reseller/client ids
- if ( $self->{'session'} ) {
- if ( $self->{'session'}->param("logintype") eq "reseller" ) {
- $r->param( "ispmanResellerId",
- $self->{'session'}->param("ispmanResellerId") );
- }
- elsif ( $self->{'session'}->param("logintype") eq "client" ) {
- $r->param( "ispmanResellerId",
- $self->{'session'}->param("ispmanResellerId") );
- $r->param( "ispmanClientId",
- $self->{'session'}->param("ispmanClientId") );
- }
- }
-
- # load common domain template
- $self->addDataFromLdif( "templates/domain.common.ldif.template", $r );
-
- # which templates are needed for what domain types
- my $ou = {
- 'primary' => ["dnszone"],
- 'slave' => [],
- 'nodns' => [],
- 'replica' => [],
- };
-
- # load all needed templates
- for $ou ( @{ $ou->{$domaintype} } ) {
- $self->addDataFromLdif( "templates/domain.$ou.ldif.template", $r );
- }
-
- return;
-}
sub addDomainDNSProcess {
my $self = shift;
@@ -194,13 +149,26 @@
}
}
-sub addNewDomain {
+
+##############################################################
+=item B<addDomain> ($r)
+
+$r is CGI.pm object passed from the CGI.
+
+Add a new domain to ISPMan repository, which can be of the
+types "primary", "slave", "nodns" and "replica".
+
+Adds different processes to the process tree.
+
+=cut
+
+sub addDomain {
my $self = shift;
my $r = shift;
+ # some comppliance modifications
my $domain = lc( $r->param("ispmanDomain") );
- $domain =~ s/\s//g; # remove all spaces
- # reset $r->param("ispmanDomain")
+ $domain =~ s/\s//g;
$r->param( "ispmanDomain", $domain );
# do some checks for resellers/clients
@@ -235,14 +203,43 @@
return if $self->domainExists( $r->param("ispmanDomain") );
- $self->addDomain($r);
+ # set reseller/client ids
+ if ( $self->{'session'} ) {
+ if ( $self->{'session'}->param("logintype") eq "reseller" ) {
+ $r->param( "ispmanResellerId",
+ $self->{'session'}->param("ispmanResellerId") );
+ }
+ elsif ( $self->{'session'}->param("logintype") eq "client" ) {
+ $r->param( "ispmanResellerId",
+ $self->{'session'}->param("ispmanResellerId") );
+ $r->param( "ispmanClientId",
+ $self->{'session'}->param("ispmanClientId") );
+ }
+ }
+
+ # load common domain template
+ $self->addDataFromLdif( "templates/domain.common.ldif.template", $r );
+
+ # which templates are needed for what domain types
+ my $ou = {
+ 'primary' => ["dnszone"],
+ 'slave' => [],
+ 'nodns' => [],
+ 'replica' => [],
+ };
+
+ # load all needed templates
+ for $ou ( @{ $ou->{$r->param("ispmanDomainType")} } ) {
+ $self->addDataFromLdif( "templates/domain.$ou.ldif.template", $r );
+ }
# create default a-record for mail
if ( $r->param("createArecordForMail")
&& $r->param("ispmanDomainDefaultMailDropHost") )
{
$self->log_event(
- "createArecordForMail=" . $r->param("createArecordForMail") . "\n" );
+ "createArecordForMail=" .
+ $r->param("createArecordForMail") . "\n" );
$self->newDNSRecord( $r->param("ispmanDomain"),
"aRecord", "mail",
@@ -316,39 +313,7 @@
print $self->refreshSignal( $r->param("ispmanDomain") );
print "Domain ", $r->param("ispmanDomain"), " was added\n";
-
-=item B<addNewDomain>
-
-Accepts $r,
-
-$r is CGI.pm object passed from the cgi
-
-
-Adds different processes to the process tree.
-
-Add process "AddRelayDomainEntry" to "smtpgroup"
-
-
-B<IF domaintype is replica>
-
- Add process AddCanonicalMapEntry to group "smtpgroup" with parameter "ispmanReplicaMaster"
-
-B<ELSE>
-
- Add process createDomainDirectories to group "fileservergroup"
-
-
-B<IF domainservice "mail" is defined>
-
- Add process "AddDestinationDomainEntry" to "smtpgroup"
-
-
-B<unless domaintype is nodns>
-
- Add process "modifyDomain" to "dnsgroup"
-
-=cut
-
+
}
sub checkDomainType {
-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 -
digital self defense, top technical experts, no vendor pitches,
unmatched networking opportunities. Visit www.blackhat.com