From 6967de0f1a00c925dc5178cf1250d5040cac1a18 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 19 Oct 2005 09:23:53 +0000 Subject: [PATCH] Added WorkServive and WorkStartup to ogroup. 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 | 8 ++--- .../systems/class_workstationService.inc | 15 ++++++++-- .../systems/class_workstationStartup.inc | 29 +++++++++++++++++++ 3 files changed, 45 insertions(+), 7 deletions(-) diff --git a/plugins/admin/ogroups/tabs_ogroups.inc b/plugins/admin/ogroups/tabs_ogroups.inc index 7bab9be66..896a15923 100644 --- a/plugins/admin/ogroups/tabs_ogroups.inc +++ b/plugins/admin/ogroups/tabs_ogroups.inc @@ -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 diff --git a/plugins/admin/systems/class_workstationService.inc b/plugins/admin/systems/class_workstationService.inc index b4d1f3b0a..a074429e7 100644 --- a/plugins/admin/systems/class_workstationService.inc +++ b/plugins/admin/systems/class_workstationService.inc @@ -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 */ diff --git a/plugins/admin/systems/class_workstationStartup.inc b/plugins/admin/systems/class_workstationStartup.inc index 658bc0886..ac0077fd9 100644 --- a/plugins/admin/systems/class_workstationStartup.inc +++ b/plugins/admin/systems/class_workstationStartup.inc @@ -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()); + } -- 2.30.2