ispman/lib/ISPMan ApacheMan.pm,1.72,1.73

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-serv2963/lib/ISPMan

Modified Files:
	ApacheMan.pm 
Log Message:
fixes warning about "uninitialized value"
removed "dn" as a valid param to getVhostInfo (breaks all kind of things)

Index: ApacheMan.pm
===================================================================
RCS file: /cvsroot/ispman/ispman/lib/ISPMan/ApacheMan.pm,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -d -r1.72 -r1.73
--- ApacheMan.pm	19 Jun 2004 22:20:21 -0000	1.72
+++ ApacheMan.pm	20 Jun 2004 11:21:25 -0000	1.73
@@ -81,18 +81,9 @@
 sub editVhost {
     my $self = shift;
     my $r    = shift;
-    my $dn;
-    if ( $r->param("dn") ) {
-        $dn = $r->param("dn");
-    }
-    else {
-        $dn = $self->getVhostDN( $r->param("ispmanDomain"),
-            $r->param("ispmanVhostName") );
-    }
 
-    $self->{'vhost'} = $self->getVhostInfo($dn);
-    my $vhostDN = $self->getVhostDN( $r->param("ispmanDomain"),
-        $r->param("ispmanVhostName") );
+    $self->{'vhost'} = $self->getVhostInfo($r->param("ispmanVhostName"),
+                                           $r->param("ispmanDomain"));
 
     my $template;
     my $tmpl;
@@ -282,7 +273,6 @@
     $ispmanVhostName =~ s/[^a-zA-Z0-9\.-]//g;
     $r->param( "ispmanVhostName", $ispmanVhostName );
 
-    my ( $vhostIp, $vhostPort ) = split ":", $r->param("ispmanVhostIpAddress");
     my $domain = $r->param("ispmanDomain");
 
     # save domain info for use in template
@@ -364,7 +354,7 @@
     $self->addDataFromLdif( "templates/vhost.ldif.template", $r );
 
     # read back vhost entry to fill processes
-    my $vhost_info = $self->getVhostInfo($dn);
+    my $vhost_info = $self->getVhostInfo($ispmanVhostName,$domain);
 
     # add new A-record for webhost(s) if domain is primary
     if ( $domain_info->{'ispmanDomainType'} eq "primary" ) {
@@ -528,36 +518,20 @@
 
 usage
 
-either pass it vhost name and domain
-
 Example:
 
 my $vhostInfo=$ispman->getVhostInfo("www", "apache.org");
 
 
-or pass it the complete dn
-
-my $vhostInfo=$ispman->getVhostInfo("ispmanVhostName=www, ou=httpdata, ispmanDomain=apache.org, o=ispman");
-
-
-
 =cut
 
     my $self            = shift;
     my $ispmanVhostName = shift;
     my $domain          = shift;
-    my $dn;
 
-    if ( $ispmanVhostName !~ /^ispmanVhostName=/ ) {
-        $dn =
-"ispmanVhostName=$ispmanVhostName, ou=httpdata, ispmanDomain=$domain, ";
-        $dn .= $self->getConf("ldapBaseDN");
-    }
-    else {
-
-        # we have been passed a dn
-        $dn = $ispmanVhostName;
-    }
+    my $dn = "ispmanVhostName=$ispmanVhostName,".
+        "ou=httpdata,ispmanDomain=$domain,".
+            $self->getConf("ldapBaseDN");
 
     #uncomment this block  if you want it to cache the result
     #unless ($self->{'vhostInfo'}{$domain}{$ispmanVhostName}){



-------------------------------------------------------
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND
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.