summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2a048d5)
raw | patch | inline | side by side (parent: 2a048d5)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 23 Jul 2008 05:51:35 +0000 (05:51 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 23 Jul 2008 05:51:35 +0000 (05:51 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11753 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpAdvanced.inc b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpAdvanced.inc
index 9f9df65fc2f56d3c2ed2506b0f901428631ab818..755214411ca6755a50ef79febf51316bd4c0c99d 100644 (file)
function execute()
{
+ $acl_writeable = preg_match("/w/",$this->parent->getacl(""));
+
/* Check for interaction */
- if (isset($_POST['add_statement']) && $_POST['addstatement'] != ""){
+ if ($acl_writeable && isset($_POST['add_statement']) && $_POST['addstatement'] != ""){
$key= preg_replace('/^([a-z0-9-]+)\s(.*)$/', '\\1', get_post('addstatement'));
$val= preg_replace("/^$key\s*/", '', get_post('addstatement'));
$this->statements[$key]= $val;
}
- if (isset($_POST['delete_statement']) && isset($_POST['dhcpstatements'])){
+ if ($acl_writeable && isset($_POST['delete_statement']) && isset($_POST['dhcpstatements'])){
$key= preg_replace('/([a-z0-9-]+)\s(.*)$/', '\\1', get_post('dhcpstatements'));
if (in_array($key, $this->autoStatements)){
msg_dialog::display(_("Error"), _("Cannot delete automatic statements!"), ERROR_DIALOG);
unset($this->statements[$key]);
}
}
- if (isset($_POST['add_option']) && $_POST['addoption'] != ""){
+ if ($acl_writeable && isset($_POST['add_option']) && $_POST['addoption'] != ""){
$key= preg_replace('/^([a-z0-9-]+)\s(.*)$/', '\\1', get_post('addoption'));
$val= preg_replace("/^$key\s*/", '', get_post('addoption'));
$this->options[$key]= $val;
}
- if (isset($_POST['delete_option']) && isset($_POST['dhcpoptions'])){
+ if ($acl_writeable && isset($_POST['delete_option']) && isset($_POST['dhcpoptions'])){
$key= preg_replace('/([a-z0-9-]+)\s(.*)$/', '\\1', get_post('dhcpoptions'));
if (in_array($key, $this->autoOptions)){
msg_dialog::display(_("Error"), _("Cannot delete automatic statements!"), ERROR_DIALOG);
diff --git a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpGroup.inc b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpGroup.inc
index 10978700ba232070f4cc577423660bea46006bc1..6a0d78b00fe9a3f66c5ab507d790a116d14a18a3 100644 (file)
function save_object()
{
/* Save cn */
- if (isset($_POST['cn'])){
+ if (preg_match("/w/",$this->parent->getacl("")) && isset($_POST['cn'])){
$this->cn= validate(get_post('cn'));
}
diff --git a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpHost.inc b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpHost.inc
index 26fabb20f8aed28dfe9b025f7729531622587d44..776a3e6c1d0852da6f404d2cb05c5a148ed77a3d 100644 (file)
function save_object()
{
/* Save remaining attributes */
- if (isset($_POST['dhcp_host_posted'])){
+ if (isset($_POST['dhcp_host_posted']) && preg_match("/w/",$this->parent->getacl(""))){
/* Assemble hwAddress */
if (isset($_POST['dhcpHWAddress'])){
diff --git a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpNetwork.inc b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpNetwork.inc
index 6054eb6965782632a35aededa43d56506f936e63..0f99ce23b3b6ec4f4b99525ef4bc26391b78b756 100644 (file)
function execute()
{
+
+ $acl_writeable = preg_match("/w/",$this->parent->getacl(""));
+
/* Check for iteraction */
- if (isset($_POST['add_dns']) && $_POST['addserver'] != ""){
+ if ($acl_writeable && isset($_POST['add_dns']) && $_POST['addserver'] != ""){
if (!preg_match('/^[0-9a-z.-]+$/', get_post('addserver'))){
- msg_dialog::display(_("Error"), msgPool::invalid(_("Name"),htmlentities(get_post('addserver')),"/[0-9a-z.-]/"), ERROR_DIALOG);
+ msg_dialog::display(_("Error"), msgPool::invalid(_("Name"),
+ htmlentities(get_post('addserver')),"/[0-9a-z.-]/"), ERROR_DIALOG);
} else {
$servers= array();
if (isset($this->options['domain-name-servers'])){
$this->options['domain-name-servers']= preg_replace('/,$/', '', $tmp);
}
}
- if (isset($_POST['delete_dns']) && isset($_POST['dnsserver'])){
+ if ($acl_writeable && isset($_POST['delete_dns']) && isset($_POST['dnsserver'])){
$tmp= preg_replace("/(\s*,\s*)?".get_post('dnsserver')."/i", '',
$this->options['domain-name-servers']);
$tmp= preg_replace("/(\s*)?,(\s*)?$/", '', $tmp);
function save_object()
{
/* Only save, if we are "active" */
- if (isset($_POST['routers'])){
+ if (isset($_POST['routers']) && preg_match("/w/",$this->parent->getacl(""))){
/*
* Assemble options
diff --git a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpService.inc b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpService.inc
index c5064164925df4ff818b314d5638752adbd089e1..5260b743f0d1273edda195fe77de2347fa5212a1 100644 (file)
function save_object()
{
/* No need to save in the first time */
- if (!isset($_POST['ddns_update_style'])){
- return;
- }
-
- /* Save remaining attributes */
- foreach (array('max_lease_time', 'default_lease_time', 'ddns_update_style') as $val){
- $tval= preg_replace('/_/', '-', $val);
- if ($_POST[$val] != ""){
- $this->statements[$tval]= validate(get_post($val));
+ if (isset($_POST['ddns_update_style']) && preg_match("/w/",$this->parent->getacl(""))){
+
+ /* Save remaining attributes */
+ foreach (array('max_lease_time', 'default_lease_time', 'ddns_update_style') as $val){
+ $tval= preg_replace('/_/', '-', $val);
+ if ($_POST[$val] != ""){
+ $this->statements[$tval]= validate(get_post($val));
+ } else {
+ unset ($this->statements[$tval]);
+ }
+ }
+ if (isset($_POST['authoritative'])){
+ $this->statements['authoritative']= "";
} else {
- unset ($this->statements[$tval]);
+ unset($this->statements['authoritative']);
}
}
- if (isset($_POST['authoritative'])){
- $this->statements['authoritative']= "";
- } else {
- unset($this->statements['authoritative']);
- }
dhcpPlugin::save_object();
}
diff --git a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpSharedNetwork.inc b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpSharedNetwork.inc
index 93b0330d174e33c850b0648a51bef7b4f8e660b6..15ead8eeb2d6196a84f9463c44509522dcd395db 100644 (file)
/* Save data to object */
function save_object()
{
- if (isset($_POST['cn'])){
+ /* Check permissions, don't touch anything if we do not have write permissions
+ */
+ if (!preg_match("/w/",$this->parent->getacl(""))){
+ dhcpPlugin::save_object();
+ }elseif(isset($_POST['cn'])){
+
$this->cn= validate(get_post('cn'));
dhcpPlugin::save_object();
diff --git a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpSubnet.inc b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpSubnet.inc
index c0bf218d1e8fd11f1dc219baaf9e1dc37de1a44f..2227e14f44d20ba76b12116c16e86b75259fb024 100644 (file)
/* Save data to object */
function save_object()
{
- if(isset($_POST['dhcp_subnet_posted'])){
+
+ /* Skip here if do not have write permissions here
+ Still executed at bottom - dhcpPlugin::save_object();
+ */
+ if(isset($_POST['dhcp_subnet_posted']) && preg_match("/w/",$this->parent->getacl(""))){
if (isset($_POST['cn'])){
$this->cn= validate(get_post('cn'));
}
/* Move range to internal variable */
$this->dhcpRange= $this->range_start." ".$this->range_stop;
- dhcpPlugin::save_object();
}
+ dhcpPlugin::save_object();
}
}
/* IP's? */
- foreach(array('dhcpNetMask' => _("Netmask"), 'cn' => _("Network address"), 'range_start' => _("Range"), 'range_stop' => _("Range")) as $attr => $str){
+ foreach(array(
+ 'dhcpNetMask' => _("Netmask"),
+ 'cn' => _("Network address"),
+ 'range_start' => _("Range"),
+ 'range_stop' => _("Range")) as $attr => $str){
if ($this->$attr != "" && !tests::is_ip($this->$attr)){
$message[]= msgPool::invalid($str,"","","192.168.0.23");
}