From: hickert Date: Tue, 21 Nov 2006 06:18:45 +0000 (+0000) Subject: Added set_acl_base() to all check() functions, to ensure that the checks will be... X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=6e9e2a35324cd3d1ae90b8a036a046cc4ae776e3;p=gosa.git Added set_acl_base() to all check() functions, to ensure that the checks will be made on the correct base. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5166 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/departments/class_departmentGeneric.inc b/plugins/admin/departments/class_departmentGeneric.inc index c4631f771..36e960663 100644 --- a/plugins/admin/departments/class_departmentGeneric.inc +++ b/plugins/admin/departments/class_departmentGeneric.inc @@ -218,6 +218,12 @@ class department extends plugin /* Call common method to give check the hook */ $message= plugin::check(); + + /* Set new acl base */ + if($this->dn == "new") { + $this->set_acl_base($this->base); + } + /* Permissions for that base? */ // $this->dn= "ou=$this->ou,".$this->base; if (!$this->acl_is_createable() && $this->dn == "new"){ diff --git a/plugins/admin/groups/class_groupGeneric.inc b/plugins/admin/groups/class_groupGeneric.inc index fa5924297..bca62c1c1 100644 --- a/plugins/admin/groups/class_groupGeneric.inc +++ b/plugins/admin/groups/class_groupGeneric.inc @@ -742,6 +742,11 @@ class group extends plugin $new_dn= $this->dn; } + /* Set new acl base */ + if($this->dn == "new") { + $this->set_acl_base($this->base); + } + if ($this->orig_dn == "new" && !$this->acl_is_createable()){ $message[]= _("You have no permissions to create a group on this 'Base'."); } diff --git a/plugins/admin/mimetypes/class_mimetypeGeneric.inc b/plugins/admin/mimetypes/class_mimetypeGeneric.inc index 08146ee9e..851354759 100644 --- a/plugins/admin/mimetypes/class_mimetypeGeneric.inc +++ b/plugins/admin/mimetypes/class_mimetypeGeneric.inc @@ -506,6 +506,12 @@ class mimetype extends plugin } else { $new_dn= $this->dn; } + + /* Set new acl base */ + if($this->dn == "new") { + $this->set_acl_base($new_dn); + } + if (!$this->acl_is_createable() && $this->dn == "new"){ $message[]= _("You have no permissions to create a mime type on this 'Base'."); } diff --git a/plugins/admin/ogroups/class_ogroup.inc b/plugins/admin/ogroups/class_ogroup.inc index 250cce677..f7aab468e 100644 --- a/plugins/admin/ogroups/class_ogroup.inc +++ b/plugins/admin/ogroups/class_ogroup.inc @@ -604,6 +604,11 @@ class ogroup extends plugin $message[]= _("There is already an object with this cn."); } + /* Set new acl base */ + if($this->dn == "new") { + $this->set_acl_base($this->base); + } + if ($this->orig_dn == "new" && !$this->acl_is_createable()){ $message[]= _("You have no permissions to create a group on this 'Base'."); } diff --git a/plugins/admin/systems/class_componentGeneric.inc b/plugins/admin/systems/class_componentGeneric.inc index cf0eaa670..254134335 100644 --- a/plugins/admin/systems/class_componentGeneric.inc +++ b/plugins/admin/systems/class_componentGeneric.inc @@ -174,6 +174,11 @@ class componentGeneric extends plugin } } + /* Set new acl base */ + if($this->dn == "new") { + $this->set_acl_base($this->base); + } + $ui= get_userinfo(); if ($this->dn == "new" && !$this->acl_is_createable()){ $message[]= _("You have no permissions to create a component on this 'Base'."); diff --git a/plugins/admin/systems/class_phoneGeneric.inc b/plugins/admin/systems/class_phoneGeneric.inc index 7b75e0378..0605974eb 100644 --- a/plugins/admin/systems/class_phoneGeneric.inc +++ b/plugins/admin/systems/class_phoneGeneric.inc @@ -318,6 +318,11 @@ class phoneGeneric extends plugin $message[]= _("The 'Phone name' '0' is reserved and cannot be used."); } + /* Set new acl base */ + if($this->dn == "new") { + $this->set_acl_base($this->base); + } + $ui= get_userinfo(); if ($this->dn == "new" && $this->acl_is_createable()){ $message[]= _("You have no permissions to create a phone on this 'Base'."); diff --git a/plugins/admin/systems/class_printGeneric.inc b/plugins/admin/systems/class_printGeneric.inc index 6eab07bde..7076727f3 100644 --- a/plugins/admin/systems/class_printGeneric.inc +++ b/plugins/admin/systems/class_printGeneric.inc @@ -655,6 +655,11 @@ class printgeneric extends plugin $message[]= "The required field 'Printer name' is not set."; } + /* Set new acl base */ + if($this->dn == "new") { + $this->set_acl_base($this->base); + } + if($this->BelongsTo == "Printer"){ if ($this->orig_dn == "new" && !$this->acl_is_createable()){ $message[]= _("You have no permissions to create a group on this 'Base'."); diff --git a/plugins/admin/systems/class_servGeneric.inc b/plugins/admin/systems/class_servGeneric.inc index 87061d250..8586affc4 100644 --- a/plugins/admin/systems/class_servGeneric.inc +++ b/plugins/admin/systems/class_servGeneric.inc @@ -244,6 +244,11 @@ class servgeneric extends plugin if ($this->cn == ""){ $message[]= _("The required field 'Server name' is not set."); } + + /* Set new acl base */ + if($this->dn == "new") { + $this->set_acl_base($this->base); + } $ui= get_userinfo(); if (!$this->acl_is_createable() && $this->dn == "new"){ diff --git a/plugins/admin/systems/class_terminalGeneric.inc b/plugins/admin/systems/class_terminalGeneric.inc index 1eab597c1..8d9c539e9 100644 --- a/plugins/admin/systems/class_terminalGeneric.inc +++ b/plugins/admin/systems/class_terminalGeneric.inc @@ -378,6 +378,11 @@ class termgeneric extends plugin /* Permissions for that base? */ $this->dn= "cn=".$this->cn."ou=terminals,ou=systems,".$this->base; + /* Set new acl base */ + if($this->dn == "new") { + $this->set_acl_base($this->base); + } + $ui= get_userinfo(); if ($this->dn == "new" && !$this->acl_is_createable()){ $message[]= _("You have no permissions to create a terminal on this 'Base'."); diff --git a/plugins/admin/systems/class_winGeneric.inc b/plugins/admin/systems/class_winGeneric.inc index db058f581..844b6795d 100644 --- a/plugins/admin/systems/class_winGeneric.inc +++ b/plugins/admin/systems/class_winGeneric.inc @@ -169,6 +169,11 @@ class wingeneric extends plugin $message= plugin::check(); $message= array_merge($message, $this->netConfigDNS->check()); $this->dn= "cn=".$this->cn.",ou=netdevices,ou=systems,".$this->base; + + /* Set new acl base */ + if($this->dn == "new") { + $this->set_acl_base($this->base); + } if(!$this->acl_is_createable() && $this->dn == "new"){ $message[]= _("You have no permissions to create a component on this 'Base'."); diff --git a/plugins/admin/systems/class_workstationGeneric.inc b/plugins/admin/systems/class_workstationGeneric.inc index 202cfb9f5..e096867f7 100644 --- a/plugins/admin/systems/class_workstationGeneric.inc +++ b/plugins/admin/systems/class_workstationGeneric.inc @@ -378,6 +378,12 @@ class workgeneric extends plugin $message= array_merge($message, $this->netConfigDNS->check()); $this->dn= "cn=".$this->cn.",ou=workstations,ou=systems,".$this->base; + + /* Set new acl base */ + if($this->dn == "new") { + $this->set_acl_base($this->base); + } + if ($this->orig_dn == "new" && !$this->acl_is_createable()){ $message[]= _("You have no permissions to create a workstation on this 'Base'."); } diff --git a/plugins/personal/generic/class_user.inc b/plugins/personal/generic/class_user.inc index c8ab1fd0b..25ab27052 100644 --- a/plugins/personal/generic/class_user.inc +++ b/plugins/personal/generic/class_user.inc @@ -1045,6 +1045,11 @@ class user extends plugin $new_dn= 'cn='.$this->cn.','.get_people_ou().$this->base; } + /* Set the new acl base */ + if($this->dn == "new") { + $this->set_acl_base($this->base); + } + if ($this->dn == "new" && !$this->acl_is_createable()){ $message[]= _("You have no permissions to create a user on this 'Base'."); } elseif ($this->dn != $new_dn && $this->dn != "new"){