Code

Added WorkServive and WorkStartup to ogroup.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 19 Oct 2005 09:23:53 +0000 (09:23 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 19 Oct 2005 09:23:53 +0000 (09:23 +0000)
If a WS is attached this tabs will appear.
Deletion, works too.

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1618 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/ogroups/tabs_ogroups.inc
plugins/admin/systems/class_workstationService.inc
plugins/admin/systems/class_workstationStartup.inc

index 7bab9be66701c0a9e22012fc6c363714ac0a71b9..896a1592399ee5f974fa396f6c8f44e8413e0788 100644 (file)
@@ -40,12 +40,12 @@ class ogrouptabs extends tabs
     
     /* Remove ws tabs, if theres no ws left in the object list */
     if((!preg_match("/W/",$objects))&&(isset($this->by_object['workstartup']))){
-//      $this->by_object['workstartup']->remove_from_parent();
-      unset($this->by_object['workstartup']);
-      unset($this->by_name['workstartup']);
-//      $this->by_object['workservice']->remove_from_parent();
+      $this->by_object['workservice']->remove_from_parent();
       unset($this->by_object['workservice']);
       unset($this->by_name['workservice']);
+      $this->by_object['workstartup']->remove_from_parent();
+      unset($this->by_object['workstartup']);
+      unset($this->by_name['workstartup']);
     }
   
     /* Create goPhoneAccount if theres an user with goPhoneAccount
index b4d1f3b0a8b67486b20529643fd5a4391a9299de..a074429e75d3451fdb31693b8e1bb2a4387bf85b 100644 (file)
@@ -51,7 +51,7 @@ class workservice extends plugin
 
 
   /* attribute list for save action */
-  var $attributes= array("cn","gotoXMonitor",
+  var $attributes= array("gotoXMonitor",
       "gotoXDriver", "gotoXResolution", "gotoXColordepth",
       "gotoXHsync", "gotoXVsync",
       "gotoScannerEnable", "gotoScannerClients",
@@ -190,11 +190,20 @@ class workservice extends plugin
 
   function remove_from_parent()
   {
-    $ldap= $this->config->get_ldap_link();
+    /* This is not necessary, i think 
+     * Remove should be called from workGeneric ... 
+     */
+    /*$ldap= $this->config->get_ldap_link();
     $ldap->rmdir($this->dn);
     show_ldap_error($ldap->get_error());
     $this->handle_post_events("remove");
-  }
+    */
+    
+    $ldap= $this->config->get_ldap_link();
+    plugin::remove_from_parent();
+    $ldap->cd($this->dn);
+    $ldap->modify($this->attrs);
+    show_ldap_error($ldap->get_error());}
 
 
   /* Save data to object */
index 658bc088622d07dbd4c927ff1b5d57452eb43056..ac0077fd9ea1796481211dc733f751698b51e8c4 100644 (file)
@@ -338,10 +338,39 @@ class workstartup extends plugin
 
   function remove_from_parent()
   {
+    /*
     $ldap= $this->config->get_ldap_link();
     $ldap->rmdir($this->dn);
     show_ldap_error($ldap->get_error());
     $this->handle_post_events("remove");
+    */
+
+
+    /* Depending on the baseobject (Ogroup / WS) we
+     *  use another set of objectClasses
+     * In case of WS itself, we use  "array("GOhard", "FAIobject");"
+     * if we are currently editing from ogroup menu we use (array("gotWorkstationTemplate","GOhard", "FAIobject"))
+     */
+    if(isset($this->parent->by_object['ogroup'])){
+      $this->objectclasses = array("gotoWorkstationTemplate","GOhard", "FAIobject");
+    }elseif(isset($this->parent->by_object['workgeneric'])){
+      $this->objectclasses = array("GOhard", "FAIobject");
+    }else{
+      print "unknown";
+      exit();
+    }
+
+    $ldap= $this->config->get_ldap_link();
+    plugin::remove_from_parent();
+    
+    foreach(array("gotoModules", "gotoAutoFs", "gotoFilesystem") as $attr){
+      $this->attrs [$attr] = array();
+    }
+
+    $ldap->cd($this->dn);
+    $ldap->modify($this->attrs);
+    show_ldap_error($ldap->get_error());
+
   }