diff --git a/plugins/admin/systems/class_componentGeneric.inc b/plugins/admin/systems/class_componentGeneric.inc
index eedef9cb5b83453faaf99ea9dea936882e3f7377..164b4aa7cd10683407f23e14d2560549414090db 100644 (file)
/* Generic terminal attributes */
var $interfaces= array();
+ var $ignore_account= TRUE;
/* Needed values and lists */
var $base= "";
var $cn= "";
- var $macAddress= "";
- var $ipHostNumber= "";
var $description= "";
var $orig_dn= "";
/* attribute list for save action */
- var $attributes= array("cn", "description", "macAddress", "ipHostNumber");
+ var $attributes= array("cn", "description");
var $objectclasses= array("top", "device", "ipHost", "ieee802Device");
+ var $netConfigDNS;
function componentgeneric ($config, $dn= NULL)
{
} else {
$this->base= preg_replace ("/^[^,]+,[^,]+,[^,]+,/", "", $this->dn);
}
-
+ $this->netConfigDNS = new termDNS($this->config,$this->dn,$this->objectclasses);
/* Save dn for later references */
$this->orig_dn= $this->dn;
}
function execute()
{
+ /* Call parent execute */
+ plugin::execute();
+
/* Do we represent a valid phone? */
if (!$this->is_account && $this->parent == NULL){
$display= "<img alt=\"\" src=\"images/stop.png\" align=middle> <b>".
$smarty->assign("base_select", $this->base);
/* Show main page */
- $smarty->assign("netconfig", dirname(__FILE__)."/network.tpl");
+ $smarty->assign("netconfig", $this->netConfigDNS->execute());
return($smarty->fetch (get_template_path('component.tpl', TRUE)));
}
unset($og->member[$this->dn]);
$og->save ();
}
-
+ $this->netConfigDNS->remove_from_parent();
}
{
plugin::save_object();
+ $this->netConfigDNS->save_object();
+
/* Save base, since this is no LDAP attribute */
if (isset($_POST['base']) && chkacl($this->acl, "create") == ""){
$this->base= $_POST['base'];
function check()
{
$message= array();
+
+ $message = array_merge($message,$this->netConfigDNS->check());
+
$this->dn= "cn=".$this->cn.",ou=netdevices,ou=systems,".$this->base;
- /* must: cn, macAddress */
if ($this->cn == "" && chkacl ($this->acl, "cn") == ""){
- $message[]= "The required field 'Component name' is not set.";
- }
- if ($this->macAddress == "" && chkacl ($this->acl, "macAddresscn") == ""){
- $message[]= "The required field 'MAC-address' is not set.";
+ $message[]= _("The required field 'Component name' is not set.");
}
$ui= get_userinfo();
$ldap->modify($this->attrs);
$this->handle_post_events("modify");
}
+
+ $this->netConfigDNS->save($this->dn);
+
show_ldap_error($ldap->get_error());
/* Optionally execute a command after we're done */