summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: baec486)
raw | patch | inline | side by side (parent: baec486)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 17 Sep 2009 15:24:22 +0000 (15:24 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 17 Sep 2009 15:24:22 +0000 (15:24 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14282 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/opsi/admin/opsi/class_opsigeneric.inc | patch | blob | history | |
gosa-plugins/opsi/admin/opsi/generic.tpl | patch | blob | history |
diff --git a/gosa-plugins/opsi/admin/opsi/class_opsigeneric.inc b/gosa-plugins/opsi/admin/opsi/class_opsigeneric.inc
index 911507fac553dfb1fc728076c7eb2858a3ca1681..6aec6c21a421b1de0c3fedd4b3a55ee6c411dfe9 100644 (file)
public $attributes = array("mac","note","description");
+ public $netConfigDNS = NULL;
/*! \brief Initialize this class
@param Object The GOsa base config.
$this->hostId = preg_replace('/\$$/',"",$this->hostId);
}
}
-
+
/* Try to plugin */
$this->init();
+
+ // Now fake a valid ldap entry ... this is necessary to avoid
+ // modifications in the dns/dhcp classes
+
+ // First fake cn
+ $this->attrs['hostId'][0] = $this->hostId;
+ $this->attrs['cn'][0] = $this->hostId;
+
+ // Second detect DNS settings.
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cd($this->config->current['BASE']);
+ $strippedHostId = preg_replace("/\..*$/","",$this->hostId);
+ $ldap->search("(&(objectClass=dNSZone)(|(relativeDomainName=".$this->hostId.")(relativeDomainName=".$strippedHostId."))(aRecord=*))",array("aRecord"));
+ if($ldap->count()){
+ $attrs = $ldap->fetch();
+ $this->attrs['ipHostNumber']['count'] = 0;
+ $this->attrs['ipHostNumber'][0] = $attrs['aRecord'][0];
+ }
+
+ // Initialize DHCP and DNS
+ $this->netConfigDNS = new termDNS($this->config,$this,$this->objectclasses, FALSE, "hostId");
+ $this->netConfigDNS->set_acl_category("opsi");
+ $this->netConfigDNS->set_acl_base($this->config->current['BASE']);
+ $this->netConfigDNS->IPisMust = FALSE;
+ $this->netConfigDNS->MACisMust = FALSE;
}
public function check()
{
$messages = plugin::check();
+ $messages= array_merge($messages, $this->netConfigDNS->check());
if(empty($this->hostId)){
$messages[] = msgPool::required(_("Name"));
$cfg_able &= $this->acl_is_readable("netbootProduct");
}
+ // Get net config template
+ $str = $this->netConfigDNS->execute();
+ if(is_object($this->netConfigDNS->dialog)){
+ return($str);
+ }
+ $smarty->assign("netconfig", $str);
+
$smarty->assign("netboot_configurable",$cfg_able);
$smarty->assign("hostId", $this->hostId);
$smarty->assign("divSLP", $divSLP->DrawList());
return;
}
}
+
+ $this->netConfigDNS->cn = $this->hostId;
+ $this->netConfigDNS->save();
}
*/
public function remove_from_parent()
{
+ $this->netConfigDNS->remove_from_parent();
+
$this->opsi->del_client($this->hostId);
if($this->opsi->is_error()){
msg_dialog::display(_("Error"),msgPool::siError($this->opsi->get_error()),ERROR_DIALOG);
if(isset($_POST['opsiGeneric_posted'])){
plugin::save_object();
+ $this->netConfigDNS->save_object();
/* Get hostId
*/
index 139b4e2e03484b1d844baaf32b77f5993250b156..1a40e95ad4c6883bb68a6c91ddcc452e65012570 100644 (file)
</td>
</tr>
</table>
+<p class="plugbottom" style="margin-bottom:0px; padding:0px;"> </p>
+
+{$netconfig}
+
<input type='hidden' name='opsiGeneric_posted' value='1'>
{/if}