diff --git a/gosa-plugins/systems/admin/systems/class_termDNS.inc b/gosa-plugins/systems/admin/systems/class_termDNS.inc
index d904a976f6de9531558b4b53283037a894eccbfe..62d6f6890ad2869ddc9922669a66e36c3a4ba5fd 100644 (file)
$this->IPisMust = $IPisMust;
$this->namingAttr = $namingAttr;
- plugin::plugin ($config, $parent->dn);
+ plugin::plugin ($config, $parent->dn, $this->parent);
+
+ $this->attrs = &$this->parent->attrs;
if(isset($this->attrs[$namingAttr][0])){
$this->OrigCn = preg_replace("/\\\$\$/","",$this->attrs[$namingAttr][0]);
{
/* Call parent execute */
$smarty= get_smarty();
- $smarty->assign("autonetACL",$this->acl_is_writeable("macAddress").$this->acl_is_writeable("ipHostNumber"));
+ $smarty->assign("autonetACL",$this->acl_is_writeable("macAddress") && $this->acl_is_writeable("ipHostNumber")?"rw":"");
$tmp = $this->plInfo();
foreach($tmp['plProvidedAcls'] as $name => $translation){
$this->dialog = FALSE;
}
- if(isset($_POST['save_dhcp']) && $this->acl_is_writeable("dhcpSetup")){
+ if(isset($_POST['save_dhcp']) && $this->acl_is_writeable("dhcpSetup") && is_object($this->dialog)){
$this->dialog->save_object();
$msgs = $this->dialog->check(array());
if(count($msgs)){
$smarty->assign("changeStateForRecords",$changeStateForRecords);
$smarty->assign("staticAddress","<font class=\"must\">*</font>");
- $smarty->assign("autonetACL",$this->acl_is_writeable("macAddress").$this->acl_is_writeable("ipHostNumber"));
+ $smarty->assign("autonetACL",$this->acl_is_writeable("macAddress") && $this->acl_is_writeable("ipHostNumber")?"rw":"");
$display.= $smarty->fetch(get_template_path('network.tpl', TRUE));
}
DNS posts
******/
- /* Check if DNS should be enabled / disabled */
- if($this->DNS_is_account && $this->acl_is_writeable("dnsSetup") && !isset($_POST['DNS_is_account'])){
- $this->DNS_is_account = false;
- }elseif(!$this->DNS_is_account && $this->acl_is_writeable("dnsSetup") && isset($_POST['DNS_is_account'])){
- $this->DNS_is_account = true;
+ /* Check if DNS should be enabled / disabled
+ * -skip this, if the dns account is enforced.
+ */
+ if(!$this->hide_dns_check_box){
+ if($this->DNS_is_account && $this->acl_is_writeable("dnsSetup") && !isset($_POST['DNS_is_account'])){
+ $this->DNS_is_account = false;
+ }elseif(!$this->DNS_is_account && $this->acl_is_writeable("dnsSetup") && isset($_POST['DNS_is_account'])){
+ $this->DNS_is_account = true;
+ }
}
/* Get dns attributes */
}
/* Do not add the objectClass ipHost if no ip address is given */
- if(!$this->attrs['ipHostNumber']){
+ if(!isset($this->attrs['ipHostNumber'])){
$this->attrs['objectClass'] = array_remove_entries(array("ipHost"),$this->attrs['objectClass']);
}
"(objectClass=gotoPrinter)".
"(objectClass=ipHost)";
$list = array();
- $ldap->search("(&(|{$ocs})(ipHostNumber={$net}*))",array("ipHostNumber"));
+ $ldap->search("(&(|{$ocs})(ipHostNumber=*))",array("ipHostNumber"));
while($attrs = $ldap->fetch()){
- $list[] = $attrs['ipHostNumber'][0];
+ if (preg_match("/^$net\./", $attrs['ipHostNumber'][0])) {
+ $list[] = $attrs['ipHostNumber'][0];
+ }
}
// Set starting ip.