From 26937dd2946eb6798d1ce72071411493d3af9cf2 Mon Sep 17 00:00:00 2001
From: hickert
Date: Mon, 22 Mar 2010 09:07:53 +0000
Subject: [PATCH] Updated dns service template and ACL checks ..
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@16980 594d385d-05f5-0310-b6e9-bd551577e9d8
---
.../systems/services/dns/class_servDNS.inc | 9 +++-
.../services/dns/class_servDNSeditZone.inc | 7 +++
.../services/dns/servDNSeditZoneEntries.tpl | 52 ++++++++-----------
.../admin/systems/services/dns/servdns.tpl | 32 ++++++------
4 files changed, 54 insertions(+), 46 deletions(-)
diff --git a/gosa-plugins/dns/admin/systems/services/dns/class_servDNS.inc b/gosa-plugins/dns/admin/systems/services/dns/class_servDNS.inc
index 6dc1ab6c6..8591519a2 100644
--- a/gosa-plugins/dns/admin/systems/services/dns/class_servDNS.inc
+++ b/gosa-plugins/dns/admin/systems/services/dns/class_servDNS.inc
@@ -197,6 +197,7 @@ class servdns extends goService
$this->dialog = new servdnseditZone($this->config,$this->dn);
if($this->is_new){
$this->dialog->acl_base = $this->acl_base;
+ $this->dialog->acl_category = $this->acl_category;
}
}
@@ -211,6 +212,8 @@ class servdns extends goService
$once =true;
$tmp = postDecode(preg_replace("/^editZone_/","",$name));
$this->dialog= new servdnseditZone($this->config,$this->dn,$this->Zones[$tmp]);
+ $this->dialog->acl_base = $this->acl_base;
+ $this->dialog->acl_category = $this->acl_category;
}
/* check posts for delete zone
@@ -229,7 +232,9 @@ class servdns extends goService
if(isset($_GET['act']) && $_GET['act'] == "edit" && isset($_GET['id'])){
$id = postDecode($_GET['id']);
if(isset($this->Zones[$id])){
- $this->dialog= new servdnseditZone($this->config,$this->dn,$this->Zones[$id]);
+ $this->dialog= new servdnseditZone($this->config,$this->dn,$this->Zones[$id]);
+ $this->dialog->acl_base = $this->acl_base;
+ $this->dialog->acl_category = $this->acl_category;
}
}
@@ -237,6 +242,8 @@ class servdns extends goService
$id = postDecode($_GET['id']);
if(isset($this->Zones[$id])){
$this->dialog= new servdnseditZone($this->config,$this->dn,$this->Zones[$id]);
+ $this->dialog->acl_base = $this->acl_base;
+ $this->dialog->acl_category = $this->acl_category;
}
}
diff --git a/gosa-plugins/dns/admin/systems/services/dns/class_servDNSeditZone.inc b/gosa-plugins/dns/admin/systems/services/dns/class_servDNSeditZone.inc
index 75024f308..29fad0544 100644
--- a/gosa-plugins/dns/admin/systems/services/dns/class_servDNSeditZone.inc
+++ b/gosa-plugins/dns/admin/systems/services/dns/class_servDNSeditZone.inc
@@ -620,6 +620,13 @@ class servdnseditZone extends plugin
}
+ function acl_is_writeable($attribute,$skip_write = FALSE)
+ {
+ if($this->read_only) return(FALSE);
+ $ui= get_userinfo();
+ return preg_match('/w/', $ui->get_permissions($this->acl_base, $this->acl_category."servdns", $attribute, $skip_write));
+ }
+
}
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
?>
diff --git a/gosa-plugins/dns/admin/systems/services/dns/servDNSeditZoneEntries.tpl b/gosa-plugins/dns/admin/systems/services/dns/servDNSeditZoneEntries.tpl
index 9245db24c..800d9b382 100644
--- a/gosa-plugins/dns/admin/systems/services/dns/servDNSeditZoneEntries.tpl
+++ b/gosa-plugins/dns/admin/systems/services/dns/servDNSeditZoneEntries.tpl
@@ -1,35 +1,29 @@
-{t}This dialog allows you to configure all components of this DNS zone on a single list.{/t}
-
-{if $disableDialog}
-
- {t}This dialog can't be used until the currently edited zone was saved or the zone entry exists in the ldap database.{/t}
-
-{else}
-
- {$table}
-
- {render acl=$acl}
- {t}New entry{/t}
+{t}This dialog allows you to configure all components of this DNS zone on a single list.{/t}
+
+
- {/render}
+{if $disableDialog}
+
+ {t}This dialog can't be used until the currently edited zone was saved or the zone entry exists in the ldap database.{/t}
+ {else}
+
+ {$table}
+
+ {render acl=$acl}
+ {t}New entry{/t}
+ {/render}
+
{/if}
-
-
- {render acl=$acl}
- {msgPool type=saveButton}
-
- {/render}
- {msgPool type=cancelButton}
-
-
+
+ {render acl=$acl}
+
+ {msgPool type=saveButton}
+ {/render}
+
+ {msgPool type=cancelButton}
+
-
-
-
+
\ No newline at end of file
diff --git a/gosa-plugins/dns/admin/systems/services/dns/servdns.tpl b/gosa-plugins/dns/admin/systems/services/dns/servdns.tpl
index 7d3aa9977..80e2dbf49 100644
--- a/gosa-plugins/dns/admin/systems/services/dns/servdns.tpl
+++ b/gosa-plugins/dns/admin/systems/services/dns/servdns.tpl
@@ -13,8 +13,7 @@
{msgPool type=cancelButton}
-
- {t}Following objects will be taken over{/t} :
+
{t}Following objects will be taken over{/t} :
@@ -37,31 +36,32 @@
{t}Take over{/t}
+
{/if}
-
- {t}Zones{/t}
+ {t}Zones{/t}
+
{$ZoneList}
+
{if $is_createable}
- {msgPool type=addButton}
+
+ {msgPool type=addButton}
{else}
-
+
+
{/if}
-
-
+
{/if}
-
- {msgPool type=saveButton}
- {msgPool type=cancelButton}
-
+
+ {msgPool type=saveButton}
+
+ {msgPool type=cancelButton}
+
\ No newline at end of file
--
2.30.2