ispman/lib/ISPMan/ApacheMan Acls.pm,1.7,1.8 Aliases.pm,1.7,1.8 Redirects.pm,1.2,1.3

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

Modified Files:
	Acls.pm Aliases.pm Redirects.pm 
Log Message:
code reformatting by perltidy conforming perl style guide


Index: Aliases.pm
===================================================================
RCS file: /cvsroot/ispman/ispman/lib/ISPMan/ApacheMan/Aliases.pm,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- Aliases.pm	24 May 2004 20:20:02 -0000	1.7
+++ Aliases.pm	30 May 2004 23:35:37 -0000	1.8
@@ -3,168 +3,156 @@
 use strict;
 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK $Config);
 
-
 require Exporter;
--dfGzR35o/[email protected] = qw(ISPMan Exporter AutoLoader);
+-dfGzR35o/[email protected]    = qw(ISPMan Exporter AutoLoader);
 @EXPORT = qw(
-	getAliasesBranchDN
-	getAliasDN
-	getAliases
-	
-	addAlias
-	add_alias
-	
-	updateAlias
-	update_alias
-	
-	deleteAlias
-	delete_alias
-);
-$VERSION = '0.01';
-
-
-
-
+  getAliasesBranchDN
+  getAliasDN
+  getAliases
 
+  addAlias
+  add_alias
 
+  updateAlias
+  update_alias
 
+  deleteAlias
+  delete_alias
+);
+$VERSION = '0.01';
 
 sub getAliasesBranchDN {
-   my $self=shift;
-   my ($domain, $vhost)=@_;
-   my $vhostDN=$self->getVhostDN($domain, $vhost);
-   return join ",", ("ou=vhostAliases" , $vhostDN);
+    my $self = shift;
+    my ( $domain, $vhost ) = @_;
+    my $vhostDN = $self->getVhostDN( $domain, $vhost );
+    return join ",", ( "ou=vhostAliases", $vhostDN );
 }
 
 sub getAliasDN {
-	my $self=shift;
-	my ($domain, $vhost, $alias)=@_;
+    my $self = shift;
+    my ( $domain, $vhost, $alias ) = @_;
+
+    my $dn = join ",",
+      (
+        "ispmanVhostServerAlias=$alias",
+        $self->getAliasesBranchDN( $domain, $vhost )
+      );
+    return $dn;
 
-   my $dn=join ",", ("ispmanVhostServerAlias=$alias", $self->getAliasesBranchDN($domain, $vhost));
-	return $dn;
-	
-	
-	
 }
 
 sub getAliases {
-	my $self=shift;
-	my ($domain, $vhost)=@_;
-	my $branch=$self->getAliasesBranchDN($domain, $vhost);
-    return $self->getEntriesAsHashRef($branch,  "objectclass=ispmanVirtualHostAlias", ['ispmanVhostServerAlias']);
-	
-}
+    my $self = shift;
+    my ( $domain, $vhost ) = @_;
+    my $branch = $self->getAliasesBranchDN( $domain, $vhost );
+    return $self->getEntriesAsHashRef(
+        $branch,
+        "objectclass=ispmanVirtualHostAlias",
+        ['ispmanVhostServerAlias']
+    );
 
+}
 
 sub addAlias {
-   my $self=shift;
-   my $r=shift;
-   
-   
-   
-  
-	$self->add_alias(
-		$r->param("ispmanDomain"), 
-		$r->param("ispmanVhostName"), 	
-		$r->param("ispmanVhostServerAlias")
-	);
+    my $self = shift;
+    my $r    = shift;
 
-	$r->param("section", "aliases");
-	$self->editVhost($r);
-}
+    $self->add_alias(
+        $r->param("ispmanDomain"),
+        $r->param("ispmanVhostName"),
+        $r->param("ispmanVhostServerAlias")
+    );
 
+    $r->param( "section", "aliases" );
+    $self->editVhost($r);
+}
 
 sub add_alias {
-   my $self=shift;
-   my ($domain, $vhost, $alias)=@_;
+    my $self = shift;
+    my ( $domain, $vhost, $alias ) = @_;
 
-   #Strip the domain from vhost
-   $alias=~s/\.$domain//;
+    #Strip the domain from vhost
+    $alias =~ s/\.$domain//;
 
+    my $dn = $self->getAliasDN( $domain, $vhost, $alias );
+    my $branch = $self->getAliasesBranchDN( $domain, $vhost );
+    $self->prepareBranchForDN($branch);
 
-  		
+    $self->addNewEntryWithData(
+        $dn,
+        {
+            'ispmanVhostServerAlias' => $alias,
+            'ispmanDomain'           => $domain,
+            'ispmanVhostName'        => $vhost,
+            'objectclass'            => 'ispmanVirtualHostAlias'
 
-   my $dn=$self->getAliasDN($domain, $vhost, $alias);
-   my $branch=$self->getAliasesBranchDN($domain,$vhost);
-   $self->prepareBranchForDN($branch);
+        }
+    );
+    $self->addVhostProcess( $domain, $vhost, "ModifyVirtualHost", $vhost );
+    if ( $self->checkDomainType( $domain, "primary" ) ) {
+        $self->newDNSRecord( $domain, "cNAMERecord", $alias, $vhost,
+            { txTRecord => "ispmanVirtualHostAlias:$vhost.$domain" } );
+    }
 
-   $self->addNewEntryWithData($dn,  {
-      'ispmanVhostServerAlias' => $alias,
-      'ispmanDomain' => $domain,
-      'ispmanVhostName' => $vhost,
-      'objectclass' => 'ispmanVirtualHostAlias'
-      
-      }
-      );
-   $self->addVhostProcess($domain, $vhost, "ModifyVirtualHost", $vhost);
-   if ($self->checkDomainType($domain,"primary")) {
-       $self->newDNSRecord($domain, "cNAMERecord", $alias, $vhost, {txTRecord => "ispmanVirtualHostAlias:$vhost.$domain"});
-   }
-      
 }
 
 sub updateAlias {
-   	my $self=shift;
-	my $r=shift;
+    my $self = shift;
+    my $r    = shift;
 
-        $self->update_alias(
-                $r->param("ispmanDomain"), 
-                $r->param("ispmanVhostName"), 	
-                $r->param("ispmanVhostServerAlias"),
-                $r->param("modifyAlias")
-        );
-	
-	$r->param("section", "aliases");
-	$self->editVhost($r);
+    $self->update_alias(
+        $r->param("ispmanDomain"),           $r->param("ispmanVhostName"),
+        $r->param("ispmanVhostServerAlias"), $r->param("modifyAlias")
+    );
+
+    $r->param( "section", "aliases" );
+    $self->editVhost($r);
 }
 
 sub update_alias {
-# update Alias is 
-# delete Old Entry
-# create new entry
 
-   my $self=shift;
-   my ($domain, $vhost, $alias, $oldalias)=@_;
-   if ($oldalias && $oldalias ne $alias) {
-      $self->delete_alias($domain, $vhost, $oldalias);
-      return $self->add_alias($domain, $vhost, $alias);
-   }
+    # update Alias is
+    # delete Old Entry
+    # create new entry
 
-   my $dn=$self->getAliasDN($domain, $vhost, $alias);
+    my $self = shift;
+    my ( $domain, $vhost, $alias, $oldalias ) = @_;
+    if ( $oldalias && $oldalias ne $alias ) {
+        $self->delete_alias( $domain, $vhost, $oldalias );
+        return $self->add_alias( $domain, $vhost, $alias );
+    }
 
-   $self->updateEntryWithData($dn, , {
-      'ispmanVhostServerAlias' => $alias
-		}
-      );
-      $self->addVhostProcess($domain, $vhost, "ModifyVirtualHost", $vhost);
+    my $dn = $self->getAliasDN( $domain, $vhost, $alias );
+
+    $self->updateEntryWithData( $dn,, { 'ispmanVhostServerAlias' => $alias } );
+    $self->addVhostProcess( $domain, $vhost, "ModifyVirtualHost", $vhost );
 }
 
 sub deleteAlias {
-	my $self=shift;
-	my $r=shift;
-	$self->delete_alias(
-		$r->param("ispmanDomain"), 
-		$r->param("ispmanVhostName"), 	
-		$r->param("ispmanVhostServerAlias")
-	);
-	$r->param("section", "aliases");
-	$self->editVhost($r);
+    my $self = shift;
+    my $r    = shift;
+    $self->delete_alias(
+        $r->param("ispmanDomain"),
+        $r->param("ispmanVhostName"),
+        $r->param("ispmanVhostServerAlias")
+    );
+    $r->param( "section", "aliases" );
+    $self->editVhost($r);
 }
 
 sub delete_alias {
-	my $self=shift;
-	my ($domain, $vhost, $alias)=@_;
-	my $dn=$self->getAliasDN($domain, $vhost, $alias);
-   if ($self->deleteEntry($dn)){
-      $self->addVhostProcess($domain, $vhost, "ModifyVirtualHost", $vhost);
-   }
-   $self->deleteDNSRecord($domain, "cNAMERecord", $alias, $vhost, {txTRecord => "ispmanVirtualHostAlias:$vhost.$domain"});
-   #my $vhostCnames=$self->getCNAMERecordsForHost($domain, $vhost, "txTRecord=ispmanVirtualHostAlias:$vhost.$domain");
-   
-   
-	
-}
+    my $self = shift;
+    my ( $domain, $vhost, $alias ) = @_;
+    my $dn = $self->getAliasDN( $domain, $vhost, $alias );
+    if ( $self->deleteEntry($dn) ) {
+        $self->addVhostProcess( $domain, $vhost, "ModifyVirtualHost", $vhost );
+    }
+    $self->deleteDNSRecord( $domain, "cNAMERecord", $alias, $vhost,
+        { txTRecord => "ispmanVirtualHostAlias:$vhost.$domain" } );
 
+#my $vhostCnames=$self->getCNAMERecordsForHost($domain, $vhost, "txTRecord=ispmanVirtualHostAlias:$vhost.$domain");
+
+}
 
 1;
 

Index: Redirects.pm
===================================================================
RCS file: /cvsroot/ispman/ispman/lib/ISPMan/ApacheMan/Redirects.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- Redirects.pm	31 May 2002 04:07:20 -0000	1.2
+++ Redirects.pm	30 May 2004 23:35:37 -0000	1.3
@@ -3,160 +3,162 @@
 use strict;
 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK $Config);
 
-
 require Exporter;
--dfGzR35o/[email protected] = qw(ISPMan Exporter AutoLoader);
+-dfGzR35o/[email protected]    = qw(ISPMan Exporter AutoLoader);
 @EXPORT = qw(
-getRedirectionsBranchDN
-getRedirectionDN
-getRedirections
+  getRedirectionsBranchDN
+  getRedirectionDN
+  getRedirections
 
-addRedirect
-add_redirect
+  addRedirect
+  add_redirect
 
-updateRedirect
-update_redirect
+  updateRedirect
+  update_redirect
 
-deleteRedirect
-delete_redirect
+  deleteRedirect
+  delete_redirect
 );
 $VERSION = '0.01';
 
-
-
-
-
-
-
-
 sub getRedirectionsBranchDN {
-   my $self=shift;
-   my ($domain, $vhost)=@_;
-   my $vhostDN=$self->getVhostDN($domain, $vhost);
-   return join ",", ("ou=urlRedirections" , $vhostDN);
+    my $self = shift;
+    my ( $domain, $vhost ) = @_;
+    my $vhostDN = $self->getVhostDN( $domain, $vhost );
+    return join ",", ( "ou=urlRedirections", $vhostDN );
 }
 
 sub getRedirectionDN {
-	my $self=shift;
-	my ($domain, $vhost, $url)=@_;
+    my $self = shift;
+    my ( $domain, $vhost, $url ) = @_;
+
+    my $dn = join ",",
+      (
+        "ispmanVhostRedirectURL=$url",
+        $self->getRedirectionsBranchDN( $domain, $vhost )
+      );
+    return $dn;
 
-   my $dn=join ",", ("ispmanVhostRedirectURL=$url", $self->getRedirectionsBranchDN($domain, $vhost));
-	return $dn;
-	
-	
-	
 }
 
 sub getRedirections {
-	my $self=shift;
-	my ($domain, $vhost)=@_;
-	my $branch=$self->getRedirectionsBranchDN($domain, $vhost);
-    return $self->getEntriesAsHashRef($branch,  "objectclass=ispmanVirtualHostRedirection", ['ispmanVhostRedirectURL', 'ispmanVhostRedirectLocation']);
-	
-}
+    my $self = shift;
+    my ( $domain, $vhost ) = @_;
+    my $branch = $self->getRedirectionsBranchDN( $domain, $vhost );
+    return $self->getEntriesAsHashRef(
+        $branch,
+        "objectclass=ispmanVirtualHostRedirection",
+        [ 'ispmanVhostRedirectURL', 'ispmanVhostRedirectLocation' ]
+    );
 
+}
 
 sub addRedirect {
-   my $self=shift;
-   my $r=shift;
-   
-   
-   
-   my $branch=$self->getRedirectionsBranchDN($r->param("ispmanDomain"), $r->param("ispmanVhostName"));
-   $self->prepareBranchForDN($branch);
-  
-	$self->add_redirect(
-		$r->param("ispmanDomain"), 
-		$r->param("ispmanVhostName"), 	
-		$r->param("ispmanVhostRedirectURL"),
-		$r->param("ispmanVhostRedirectLocation")
-	);
+    my $self = shift;
+    my $r    = shift;
 
-	$r->param("section", "redirects");
-	$self->editVhost($r);
-}
+    my $branch = $self->getRedirectionsBranchDN( $r->param("ispmanDomain"),
+        $r->param("ispmanVhostName") );
+    $self->prepareBranchForDN($branch);
+
+    $self->add_redirect(
+        $r->param("ispmanDomain"),
+        $r->param("ispmanVhostName"),
+        $r->param("ispmanVhostRedirectURL"),
+        $r->param("ispmanVhostRedirectLocation")
+    );
 
+    $r->param( "section", "redirects" );
+    $self->editVhost($r);
+}
 
 sub add_redirect {
-   my $self=shift;
-   my ($domain, $vhost, $source, $target)=@_;
-  		
+    my $self = shift;
+    my ( $domain, $vhost, $source, $target ) = @_;
 
-   my $dn=$self->getRedirectionDN($domain, $vhost, $source);
+    my $dn = $self->getRedirectionDN( $domain, $vhost, $source );
 
-   $self->addNewEntryWithData($dn,  {
-      'ispmanVhostRedirectURL' => $source,
-      'ispmanVhostRedirectLocation' => $target,
-      'ispmanDomain' => $domain,
-      'ispmanVhostName' => $vhost,
-      'objectclass' => 'ispmanVirtualHostRedirection'
-      
-      }
-      );
-      $self->addVhostProcess($domain, $vhost, "ModifyVirtualHost", $vhost);
+    $self->addNewEntryWithData(
+        $dn,
+        {
+            'ispmanVhostRedirectURL'      => $source,
+            'ispmanVhostRedirectLocation' => $target,
+            'ispmanDomain'                => $domain,
+            'ispmanVhostName'             => $vhost,
+            'objectclass'                 => 'ispmanVirtualHostRedirection'
+
+        }
+    );
+    $self->addVhostProcess( $domain, $vhost, "ModifyVirtualHost", $vhost );
 }
 
 sub updateRedirect {
 
-   	my $self=shift;
-	my $r=shift;
-        $self->update_redirect(
-                $r->param("ispmanDomain"), 
-                $r->param("ispmanVhostName"), 	
-                $r->param("ispmanVhostRedirectURL"),
-                $r->param("ispmanVhostRedirectLocation"),
-                $r->param("modifyURL")
-        );
-	
-	$r->param("section", "redirects");
-	$self->editVhost($r);
-}
+    my $self = shift;
+    my $r    = shift;
+    $self->update_redirect(
+        $r->param("ispmanDomain"),
+        $r->param("ispmanVhostName"),
+        $r->param("ispmanVhostRedirectURL"),
+        $r->param("ispmanVhostRedirectLocation"),
+        $r->param("modifyURL")
+    );
 
+    $r->param( "section", "redirects" );
+    $self->editVhost($r);
+}
 
 sub update_redirect {
-# update redirection is 
-# delete Old Entry
-# create new entry
-   my $self=shift;
-   my ($domain, $vhost, $ispmanVhostRedirectURL, $ispmanVhostRedirectLocation, $oldURL)=@_;
 
-   if ($oldURL && $oldURL ne $ispmanVhostRedirectURL) {
-      $self->delete_redirect($domain, $vhost, $oldURL);
-      return $self->add_redirect($domain, $vhost, $ispmanVhostRedirectURL, $ispmanVhostRedirectLocation);
-   }
-   
-   my $dn=$self->getRedirectionDN($domain, $vhost, $ispmanVhostRedirectURL);
+    # update redirection is
+    # delete Old Entry
+    # create new entry
+    my $self = shift;
+    my ( $domain, $vhost, $ispmanVhostRedirectURL, $ispmanVhostRedirectLocation,
+        $oldURL )
+      = @_;
 
-   $self->updateEntryWithData($dn, , {
-      'ispmanVhostRedirectURL' => $ispmanVhostRedirectURL,
-      'ispmanVhostRedirectLocation' => $ispmanVhostRedirectLocation
-      }
-      );
-      $self->addVhostProcess($domain, $vhost, "ModifyVirtualHost", $vhost);
+    if ( $oldURL && $oldURL ne $ispmanVhostRedirectURL ) {
+        $self->delete_redirect( $domain, $vhost, $oldURL );
+        return $self->add_redirect( $domain, $vhost, $ispmanVhostRedirectURL,
+            $ispmanVhostRedirectLocation );
+    }
+
+    my $dn =
+      $self->getRedirectionDN( $domain, $vhost, $ispmanVhostRedirectURL );
+
+    $self->updateEntryWithData(
+        $dn,
+        ,
+        {
+            'ispmanVhostRedirectURL'      => $ispmanVhostRedirectURL,
+            'ispmanVhostRedirectLocation' => $ispmanVhostRedirectLocation
+        }
+    );
+    $self->addVhostProcess( $domain, $vhost, "ModifyVirtualHost", $vhost );
 }
 
 sub deleteRedirect {
-	my $self=shift;
-	my $r=shift;
-	$self->delete_redirect(
-		$r->param("ispmanDomain"), 
-		$r->param("ispmanVhostName"), 	
-		$r->param("ispmanVhostRedirectURL")
-	);
-	$r->param("section", "redirects");
-	$self->editVhost($r);
+    my $self = shift;
+    my $r    = shift;
+    $self->delete_redirect(
+        $r->param("ispmanDomain"),
+        $r->param("ispmanVhostName"),
+        $r->param("ispmanVhostRedirectURL")
+    );
+    $r->param( "section", "redirects" );
+    $self->editVhost($r);
 }
 
 sub delete_redirect {
-	my $self=shift;
-	my ($domain, $vhost, $url)=@_;
-	my $dn=$self->getRedirectionDN($domain, $vhost, $url);
-   if ($self->deleteEntry($dn)){
-      $self->addVhostProcess($domain, $vhost, "ModifyVirtualHost", $vhost);
-   }
-	
-}
+    my $self = shift;
+    my ( $domain, $vhost, $url ) = @_;
+    my $dn = $self->getRedirectionDN( $domain, $vhost, $url );
+    if ( $self->deleteEntry($dn) ) {
+        $self->addVhostProcess( $domain, $vhost, "ModifyVirtualHost", $vhost );
+    }
 
+}
 
 1;
 

Index: Acls.pm
===================================================================
RCS file: /cvsroot/ispman/ispman/lib/ISPMan/ApacheMan/Acls.pm,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- Acls.pm	21 Feb 2004 21:31:32 -0000	1.7
+++ Acls.pm	30 May 2004 23:35:37 -0000	1.8
@@ -3,162 +3,186 @@
 use strict;
 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK $Config);
 
-
 require Exporter;
--dfGzR35o/[email protected] = qw(ISPMan Exporter AutoLoader);
+-dfGzR35o/[email protected]    = qw(ISPMan Exporter AutoLoader);
 @EXPORT = qw(
-getAclsBranchDN
-getAclDN
-AclExists
-getAcls
-addAcl
-add_acl
-addVhostAcl
-updateAcl
-update_acl
-updateVhostAcl
-deleteAcl
-deleteVhostAcl
-delete_acl
+  getAclsBranchDN
+  getAclDN
+  AclExists
+  getAcls
+  addAcl
+  add_acl
+  addVhostAcl
+  updateAcl
+  update_acl
+  updateVhostAcl
+  deleteAcl
+  deleteVhostAcl
+  delete_acl
 
 );
 $VERSION = '0.01';
 
-
-
-
 sub getAclsBranchDN {
-   my $self=shift;
-   my ($domain, $vhost)=@_;
-   my $vhostDN=$self->getVhostDN($domain, $vhost);
-   return join ",", ("ou=httpAcls" , $vhostDN);
+    my $self = shift;
+    my ( $domain, $vhost ) = @_;
+    my $vhostDN = $self->getVhostDN( $domain, $vhost );
+    return join ",", ( "ou=httpAcls", $vhostDN );
 }
 
 sub getAclDN {
-	my $self=shift;
-	my ($domain, $vhost, $url)=@_;
+    my $self = shift;
+    my ( $domain, $vhost, $url ) = @_;
 
-    my $dn=join ",", ("ispmanVhostAclLocation=$url", $self->getAclsBranchDN($domain, $vhost));
-	return $dn;
+    my $dn = join ",",
+      (
+        "ispmanVhostAclLocation=$url", $self->getAclsBranchDN( $domain, $vhost )
+      );
+    return $dn;
 }
 
 sub AclExists {
-	my $self=shift;
-	my ($domain, $vhost, $url)=@_;
-	my $dn=$self->getAclDN($domain, $vhost, $url);
-	return $self->entryExists($dn);
+    my $self = shift;
+    my ( $domain, $vhost, $url ) = @_;
+    my $dn = $self->getAclDN( $domain, $vhost, $url );
+    return $self->entryExists($dn);
 }
 
-
 sub getAcls {
-	my $self=shift;
-	my ($domain, $vhost)=@_;
-	my $branch=$self->getAclsBranchDN($domain, $vhost);
-    return $self->getEntriesAsHashRef($branch,  "objectclass=ispmanVirtualHostAcl", 
-    ['ispmanVhostAclLocation', 'ispmanVhostAclAllowUser']);
-	
-}
+    my $self = shift;
+    my ( $domain, $vhost ) = @_;
+    my $branch = $self->getAclsBranchDN( $domain, $vhost );
+    return $self->getEntriesAsHashRef(
+        $branch,
+        "objectclass=ispmanVirtualHostAcl",
+        [ 'ispmanVhostAclLocation', 'ispmanVhostAclAllowUser' ]
+    );
 
+}
 
 sub addACL {
-	goto("add_acl");
+    goto("add_acl");
 }
 
 sub addVhostAcl {
-	my $self=shift;
-    my $r=shift;
-	if ($self->AclExists($r->param('newIspmanVhostAclLocation'))) {
-      $r->param("errors", "An ACL for this location already exists.");
-   } else {
-      $r->param("ispmanVhostAclLocation", $r->param("newIspmanVhostAclLocation"));
-      $r->param("ispmanVhostAclAllowUser", $r->param("newIspmanVhostAclAllowUser"));
-      $self->add_acl($r);
-   }
-   $r->param("mode", "editVhost");
-   $r->param("section", "acls");
-   $self->editVhost($r);
-	
+    my $self = shift;
+    my $r    = shift;
+    if ( $self->AclExists( $r->param('newIspmanVhostAclLocation') ) ) {
+        $r->param( "errors", "An ACL for this location already exists." );
+    }
+    else {
+        $r->param( "ispmanVhostAclLocation",
+            $r->param("newIspmanVhostAclLocation") );
+        $r->param( "ispmanVhostAclAllowUser",
+            $r->param("newIspmanVhostAclAllowUser") );
+        $self->add_acl($r);
+    }
+    $r->param( "mode",    "editVhost" );
+    $r->param( "section", "acls" );
+    $self->editVhost($r);
+
 }
 
 sub add_acl {
-   my $self=shift;
-   my $r=shift;
-   my $branch=$self->getAclsBranchDN($r->param("ispmanDomain"), $r->param("ispmanVhostName"));
-   $self->prepareBranchForDN($branch);
+    my $self   = shift;
+    my $r      = shift;
+    my $branch = $self->getAclsBranchDN( $r->param("ispmanDomain"),
+        $r->param("ispmanVhostName") );
+    $self->prepareBranchForDN($branch);
 
-   $self->addDataFromLdif("templates/acl.vhost.ldif.template", $r);   
-   $self->addVhostProcess($r->param("ispmanDomain"), $r->param("ispmanVhostName"), "ModifyVirtualHost", $r->param("ispmanVhostName"));
+    $self->addDataFromLdif( "templates/acl.vhost.ldif.template", $r );
+    $self->addVhostProcess(
+        $r->param("ispmanDomain"), $r->param("ispmanVhostName"),
+        "ModifyVirtualHost",       $r->param("ispmanVhostName")
+    );
 }
 
+sub updateAcl
+{ #used by CCP. Should be obseleted and instead delete_acl should be used with domain, vhost and url as params
+    my $self = shift;
+    my $r    = shift;
 
-
-sub updateAcl { #used by CCP. Should be obseleted and instead delete_acl should be used with domain, vhost and url as params
-   my $self=shift;
-   my $r=shift;
-
-   $self->updateEntryWithData($r->param('dn'), {
-      'ispmanVhostAclLocation' => $r->param('ispmanVhostAclLocation'),
-      'ispmanVhostAclAllowUser' => $self->as_arrayref($r->param('ispmanVhostAclAllowUser'))
-	});
-   $self->addVhostProcess($r->param("ispmanDomain"), $r->param("ispmanVhostName"), "ModifyVirtualHost", $r->param("ispmanVhostName"));
+    $self->updateEntryWithData(
+        $r->param('dn'),
+        {
+            'ispmanVhostAclLocation'  => $r->param('ispmanVhostAclLocation'),
+            'ispmanVhostAclAllowUser' =>
+              $self->as_arrayref( $r->param('ispmanVhostAclAllowUser') )
+        }
+    );
+    $self->addVhostProcess(
+        $r->param("ispmanDomain"), $r->param("ispmanVhostName"),
+        "ModifyVirtualHost",       $r->param("ispmanVhostName")
+    );
 }
 
-
-sub updateVhostAcl { # used by the admin panel
-   my $self=shift;
-   my $r=shift;
-   $self->update_acl($r->param('ispmanDomain'), $r->param('ispmanVhostName'), $r->param('ispmanVhostAclLocation'), $r->param('ispmanVhostAclAllowUser'));
-   $r->delete("ispmanVhostAclLocation");
-   $r->param("mode", "editVhost");
-   $r->param("section", "acls");
-   $self->editVhost($r);
+sub updateVhostAcl {    # used by the admin panel
+    my $self = shift;
+    my $r    = shift;
+    $self->update_acl(
+        $r->param('ispmanDomain'),
+        $r->param('ispmanVhostName'),
+        $r->param('ispmanVhostAclLocation'),
+        $r->param('ispmanVhostAclAllowUser')
+    );
+    $r->delete("ispmanVhostAclLocation");
+    $r->param( "mode",    "editVhost" );
+    $r->param( "section", "acls" );
+    $self->editVhost($r);
 }
 
-sub update_acl{
-   my $self=shift;
-   my ($domain, $vhost, $url, @users)=@_;
-   my $aclDN=$self->getAclDN($domain, $vhost, $url);
-   $self->updateEntryWithData($aclDN, {
-      'ispmanVhostAclLocation' => $url,
-      'ispmanVhostAclAllowUser' => $self->as_arrayref(@users)
-	});
-   $self->addVhostProcess($domain, $vhost, "ModifyVirtualHost", $vhost);
+sub update_acl {
+    my $self = shift;
+    my ( $domain, $vhost, $url, @users ) = @_;
+    my $aclDN = $self->getAclDN( $domain, $vhost, $url );
+    $self->updateEntryWithData(
+        $aclDN,
+        {
+            'ispmanVhostAclLocation'  => $url,
+            'ispmanVhostAclAllowUser' => $self->as_arrayref(@users)
+        }
+    );
+    $self->addVhostProcess( $domain, $vhost, "ModifyVirtualHost", $vhost );
 }
 
-
 sub deleteVhostAcl {
-   my $self=shift;
-   my $r=shift;
-   $self->delete_acl($r->param('ispmanDomain'), $r->param('ispmanVhostName'), $r->param('ispmanVhostAclLocation'));
-   $r->delete("ispmanVhostAclLocation");
-   $r->param("mode", "editVhost");
-   $r->param("section", "acls");
-   $self->editVhost($r);
+    my $self = shift;
+    my $r    = shift;
+    $self->delete_acl(
+        $r->param('ispmanDomain'),
+        $r->param('ispmanVhostName'),
+        $r->param('ispmanVhostAclLocation')
+    );
+    $r->delete("ispmanVhostAclLocation");
+    $r->param( "mode",    "editVhost" );
+    $r->param( "section", "acls" );
+    $self->editVhost($r);
 }
 
+sub deleteAcl
+{ #used by CCP. Should be obseleted and instead delete_acl should be used with domain, vhost and url as params
+    my $self = shift;
+    my $r    = shift;
+    print "Deleting ", $r->param('dn');
 
-sub deleteAcl {  #used by CCP. Should be obseleted and instead delete_acl should be used with domain, vhost and url as params
-   my $self=shift;
-   my $r=shift;
-   print "Deleting ", $r->param('dn');
-   
-   if ($self->deleteEntry($r->param('dn'))){
-      $self->addVhostProcess($r->param("ispmanDomain"), $r->param("ispmanVhostName"), "ModifyVirtualHost", $r->param("ispmanVhostName"));
-   }
-
+    if ( $self->deleteEntry( $r->param('dn') ) ) {
+        $self->addVhostProcess(
+            $r->param("ispmanDomain"), $r->param("ispmanVhostName"),
+            "ModifyVirtualHost",       $r->param("ispmanVhostName")
+        );
+    }
 
 }
+
 sub delete_acl {
-    my $self=shift;
-    my ($domain, $vhost, $url)=@_;
-    my $aclDN=$self->getAclDN($domain, $vhost, $url);
-   if ($self->deleteEntry($aclDN)){
-      $self->addVhostProcess($domain,$vhost, "ModifyVirtualHost", $vhost);
-   }
+    my $self = shift;
+    my ( $domain, $vhost, $url ) = @_;
+    my $aclDN = $self->getAclDN( $domain, $vhost, $url );
+    if ( $self->deleteEntry($aclDN) ) {
+        $self->addVhostProcess( $domain, $vhost, "ModifyVirtualHost", $vhost );
+    }
 }
 
-
-
 1;
 
 __END__



-------------------------------------------------------
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.