Code

Added set_acl_base() to all check() functions, to ensure that the checks will be...
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 21 Nov 2006 06:18:45 +0000 (06:18 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 21 Nov 2006 06:18:45 +0000 (06:18 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5166 594d385d-05f5-0310-b6e9-bd551577e9d8

12 files changed:
plugins/admin/departments/class_departmentGeneric.inc
plugins/admin/groups/class_groupGeneric.inc
plugins/admin/mimetypes/class_mimetypeGeneric.inc
plugins/admin/ogroups/class_ogroup.inc
plugins/admin/systems/class_componentGeneric.inc
plugins/admin/systems/class_phoneGeneric.inc
plugins/admin/systems/class_printGeneric.inc
plugins/admin/systems/class_servGeneric.inc
plugins/admin/systems/class_terminalGeneric.inc
plugins/admin/systems/class_winGeneric.inc
plugins/admin/systems/class_workstationGeneric.inc
plugins/personal/generic/class_user.inc

index c4631f77122ede52adad6555fec71f42f7cbdfbc..36e960663e8258605d55d19bf7465cf03dd0644d 100644 (file)
@@ -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"){
index fa59242979149b057449fd45f58db6c3ebb2c39f..bca62c1c1571377f8d0644f91e5dc85c453e3fbc 100644 (file)
@@ -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'.");
     }
index 08146ee9ecd6dbbaef47bc91bc17e05804edfa12..851354759d9f374266386ef23fbcdbec94c81e08 100644 (file)
@@ -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'.");
     }
index 250cce677815efb36e0dd5d6a216a52e20f11a87..f7aab468e45399a62e739102b0f2cd775f3a808e 100644 (file)
@@ -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'.");
     }
index cf0eaa6706c2b625d6939d17ae20a32a69324543..2541343350739fdce79fb42d863a122b0372b7cc 100644 (file)
@@ -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'.");
index 7b75e0378faae676d812d8ff5c1cd695ffa381a0..0605974ebc3f59345cd240f03e07b8069a979d39 100644 (file)
@@ -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'.");
index 6eab07bde2be7764d117a66b45feeefd886f1404..7076727f3859c7371d4d98aa2b95118e68495e1c 100644 (file)
@@ -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'.");
index 87061d250f50acc10a3c7877ab778e8a9902e440..8586affc40b71210f5597907b106f78222effbf3 100644 (file)
@@ -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"){
index 1eab597c17b487ba4b2443f30d7deaf094eb9b5c..8d9c539e9aa4b96faa55dc78c46facdfa8fc20ce 100644 (file)
@@ -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'.");
index db058f5810d43d95df54a6be18a7458893e90c1e..844b6795dd3a674f0d4b70220495e38644ba35e9 100644 (file)
@@ -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'.");
index 202cfb9f59839c1a7051fa724f516d6a152bcafc..e096867f73a08e60f3e0f6a56c8825827143a65a 100644 (file)
@@ -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'.");
     }
index c8ab1fd0bface2cba8554e84893e1a0bf3bac041..25ab27052167ff9eb9ac3ca9f6ffa90f0bd221a2 100644 (file)
@@ -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"){