Code

Fixed acls for ws
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 28 Sep 2006 03:32:34 +0000 (03:32 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 28 Sep 2006 03:32:34 +0000 (03:32 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4802 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_workstationGeneric.inc

index b61573302a721d87d37dca48e8418335b18429c1..94d08ba4e865028db4063be339f180086db4ef1e 100644 (file)
@@ -124,6 +124,19 @@ class workgeneric extends plugin
     $this->orig_dn= $this->dn;
   }
 
+
+  function set_acl_base($base)
+  {
+    plugin::set_acl_base($base);
+    $this->netConfigDNS->set_acl_base($base);
+  }
+
+  function set_acl_category($cat)
+  {
+    plugin::set_acl_category($cat);
+    $this->netConfigDNS->set_acl_category($cat);
+  }
+
   function execute()
   {
     /* Call parent execute */
@@ -303,21 +316,24 @@ class workgeneric extends plugin
 
   function remove_from_parent()
   {
-    $this->netConfigDNS->remove_from_parent();
-    $ldap= $this->config->get_ldap_link();
-    $ldap->rmdir($this->dn);
-    show_ldap_error($ldap->get_error(), sprintf(_("Removing of system workstation/generic with dn '%s' failed."),$this->dn));
-
-    /* Optionally execute a command after we're done */
-    $this->handle_post_events("remove", array("macAddress" => $this->netConfigDNS->macAddress));
-
-    /* Delete references to object groups */
-    $ldap->cd ($this->config->current['BASE']);
-    $ldap->search ("(&(objectClass=gosaGroupOfNames)(member=".$this->dn."))", array("cn"));
-    while ($ldap->fetch()){
-      $og= new ogroup($this->config, $ldap->getDN());
-      unset($og->member[$this->dn]);
-      $og->save ();
+    if($this->acl_is_removeable()){
+
+      $this->netConfigDNS->remove_from_parent();
+      $ldap= $this->config->get_ldap_link();
+      $ldap->rmdir($this->dn);
+      show_ldap_error($ldap->get_error(), sprintf(_("Removing of system workstation/generic with dn '%s' failed."),$this->dn));
+
+      /* Optionally execute a command after we're done */
+      $this->handle_post_events("remove", array("macAddress" => $this->netConfigDNS->macAddress));
+
+      /* Delete references to object groups */
+      $ldap->cd ($this->config->current['BASE']);
+      $ldap->search ("(&(objectClass=gosaGroupOfNames)(member=".$this->dn."))", array("cn"));
+      while ($ldap->fetch()){
+        $og= new ogroup($this->config, $ldap->getDN());
+        unset($og->member[$this->dn]);
+        $og->save ();
+      }
     }
   }