From: hickert Date: Fri, 21 Sep 2007 06:17:49 +0000 (+0000) Subject: Fixed termDNS function definition. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=5da419b5da3537e803cc75b245541751881d56db;p=gosa.git Fixed termDNS function definition. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7364 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/systems/class_componentGeneric.inc b/plugins/admin/systems/class_componentGeneric.inc index 32530a5b5..5605253aa 100644 --- a/plugins/admin/systems/class_componentGeneric.inc +++ b/plugins/admin/systems/class_componentGeneric.inc @@ -35,7 +35,7 @@ class componentGeneric extends plugin } else { $this->base= preg_replace ("/^[^,]+,[^,]+,[^,]+,/", "", $this->dn); } - $this->netConfigDNS = new termDNS($this->config,$this->dn,$this->objectclasses, true); + $this->netConfigDNS = new termDNS($this->config,$this,$this->objectclasses, true); /* Save dn for later references */ $this->orig_dn= $this->dn; } @@ -259,7 +259,7 @@ class componentGeneric extends plugin } $this->netConfigDNS->cn = $this->cn; - $this->netConfigDNS->save($this->dn); + $this->netConfigDNS->save(); show_ldap_error($ldap->get_error(), sprintf(_("Saving of system component/generic with dn '%s' failed."),$this->dn)); } diff --git a/plugins/admin/systems/class_phoneGeneric.inc b/plugins/admin/systems/class_phoneGeneric.inc index bb4efc357..1d8ff6c45 100644 --- a/plugins/admin/systems/class_phoneGeneric.inc +++ b/plugins/admin/systems/class_phoneGeneric.inc @@ -57,7 +57,7 @@ class phoneGeneric extends plugin function phonegeneric (&$config, $dn= NULL, $parent= NULL) { plugin::plugin ($config, $dn, $parent); - $this->netConfigDNS = new termDNS($this->config,$this->dn,$this->objectclasses, true); + $this->netConfigDNS = new termDNS($this->config,$this,$this->objectclasses, true); /* Set base */ if ($this->dn == "new"){ @@ -430,7 +430,7 @@ class phoneGeneric extends plugin $this->handle_post_events("modify",array("macAddress" => $this->netConfigDNS->macAddress,"ipHostNumber" => $this->netConfigDNS->ipHostNumber)); } $this->netConfigDNS->cn = $this->cn; - $this->netConfigDNS->save($this->dn); + $this->netConfigDNS->save(); show_ldap_error($ldap->get_error(), sprintf(_("Saving of system phone/generic with dn '%s' failed."),$this->dn)); } diff --git a/plugins/admin/systems/class_printGeneric.inc b/plugins/admin/systems/class_printGeneric.inc index ccadc0dd4..5b77578fe 100644 --- a/plugins/admin/systems/class_printGeneric.inc +++ b/plugins/admin/systems/class_printGeneric.inc @@ -91,7 +91,7 @@ class printgeneric extends plugin } /* create dns object */ - $this->netConfigDNS = new termDNS($this->config, $this->dn,$this->objectclasses); + $this->netConfigDNS = new termDNS($this->config, $this,$this->objectclasses); /* Set base */ if ($this->dn == "new"){ @@ -847,7 +847,7 @@ class printgeneric extends plugin if(preg_match("/printer/i",$this->BelongsTo)){ $this->netConfigDNS->cn = $this->cn; $this->netConfigDNS->dn = $this->dn; - $this->netConfigDNS->save($this->dn); + $this->netConfigDNS->save(); } /* This is a multi object. Handle tagging here... */ diff --git a/plugins/admin/systems/class_servGeneric.inc b/plugins/admin/systems/class_servGeneric.inc index 1acaaad4c..d74fb92cd 100644 --- a/plugins/admin/systems/class_servGeneric.inc +++ b/plugins/admin/systems/class_servGeneric.inc @@ -62,7 +62,7 @@ class servgeneric extends plugin } else { $this->base= preg_replace ("/^[^,]+,[^,]+,[^,]+,/", "", $this->dn); } - $this->netConfigDNS = new termDNS($this->config,$this->dn,$this->objectclasses); + $this->netConfigDNS = new termDNS($this->config,$this,$this->objectclasses); $this->netConfigDNS->set_acl_category("server"); $this->netConfigDNS->set_acl_base($this->base); @@ -360,7 +360,7 @@ class servgeneric extends plugin } show_ldap_error($ldap->get_error(), sprintf(_("Saving of system server/generic with dn '%s' failed."),$this->dn)); $this->netConfigDNS->cn = $this->cn; - $this->netConfigDNS->save($this->dn); + $this->netConfigDNS->save(); /* Optionally execute a command after we're done */ if(!$this->didAction){ diff --git a/plugins/admin/systems/class_termDNS.inc b/plugins/admin/systems/class_termDNS.inc index 9b91a0b89..79c26bfdb 100644 --- a/plugins/admin/systems/class_termDNS.inc +++ b/plugins/admin/systems/class_termDNS.inc @@ -42,15 +42,16 @@ class termDNS extends plugin /* Terminal dns */ - function termDNS (&$config, $dn,$objectClasses,$IPisMust = false) + function termDNS (&$config, $parent,$objectClasses,$IPisMust = false) { /* We need to know which objectClasses are used, to store the ip/mac * Because of different type of devices - */ + */ + $this->parent = $parent; $this->objectclasses = $objectClasses; $this->IPisMust = $IPisMust; - plugin::plugin ($config, $dn); + plugin::plugin ($config, $parent->dn); if(isset($this->attrs['cn'][0])){ $this->OrigCn = preg_replace("/\\\$\$/","",$this->attrs['cn'][0]); @@ -521,10 +522,12 @@ class termDNS extends plugin /* Save to LDAP */ - function save($dn) + function save() { $ldap= $this->config->get_ldap_link(); - + + $dn = $this->parent->dn; + /*******************/ /* IP-MAC HANDLING */ /*******************/ diff --git a/plugins/admin/systems/class_terminalGeneric.inc b/plugins/admin/systems/class_terminalGeneric.inc index 57a70ff55..6b7d04b4f 100644 --- a/plugins/admin/systems/class_terminalGeneric.inc +++ b/plugins/admin/systems/class_terminalGeneric.inc @@ -77,7 +77,7 @@ class termgeneric extends plugin $this->member_of_ogroup = $ldap->count() >= 1; } - $this->netConfigDNS = new termDNS($this->config,$this->dn,$this->objectclasses); + $this->netConfigDNS = new termDNS($this->config,$this,$this->objectclasses); /* Read arrays */ foreach (array("ghNetNic", "ghIdeDev", "ghScsiDev") as $val){ if (!isset($this->attrs[$val])){ @@ -560,7 +560,7 @@ class termgeneric extends plugin } $this->netConfigDNS->cn = $this->cn; - $this->netConfigDNS->save($this->dn); + $this->netConfigDNS->save(); show_ldap_error($ldap->get_error(), sprintf(_("Saving of object system terminal/generic with dn '%s' failed."),$this->dn)); } diff --git a/plugins/admin/systems/class_winGeneric.inc b/plugins/admin/systems/class_winGeneric.inc index b1778a1a8..173d65520 100644 --- a/plugins/admin/systems/class_winGeneric.inc +++ b/plugins/admin/systems/class_winGeneric.inc @@ -49,7 +49,7 @@ class wingeneric extends plugin function wingeneric (&$config, $dn= NULL, $parent= NULL) { plugin::plugin ($config, $dn, $parent); - $this->netConfigDNS = new termDNS($this->config,$this->dn,$this->objectclasses); + $this->netConfigDNS = new termDNS($this->config,$this,$this->objectclasses); /* Set base */ if ($this->dn == "new"){ $ui= get_userinfo(); @@ -269,7 +269,7 @@ class wingeneric extends plugin } $this->netConfigDNS->cn = preg_replace("/\\\$\$/","",$this->cn); - $this->netConfigDNS->save($this->dn); + $this->netConfigDNS->save(); show_ldap_error($ldap->get_error(), sprintf(_("Saving of system wingeneric/generic with dn '%s' failed."),$this->dn)); /* Optionally execute a command after we're done */ diff --git a/plugins/admin/systems/class_workstationGeneric.inc b/plugins/admin/systems/class_workstationGeneric.inc index 59427c35a..734a84598 100644 --- a/plugins/admin/systems/class_workstationGeneric.inc +++ b/plugins/admin/systems/class_workstationGeneric.inc @@ -82,7 +82,7 @@ class workgeneric extends plugin $this->member_of_ogroup = $ldap->count() >= 1; } - $this->netConfigDNS = new termDNS($this->config,$this->dn,$this->objectclasses); + $this->netConfigDNS = new termDNS($this->config,$this,$this->objectclasses); /* Read arrays */ foreach (array("ghNetNic", "ghIdeDev", "ghScsiDev") as $val){ @@ -547,7 +547,7 @@ class workgeneric extends plugin } $this->netConfigDNS->cn = $this->cn; - $this->netConfigDNS->save($this->dn); + $this->netConfigDNS->save(); show_ldap_error($ldap->get_error(), sprintf(_("Saving of system workstation/generic with dn '%s' failed."),$this->dn)); }