From: hickert Date: Thu, 12 Jul 2007 07:22:39 +0000 (+0000) Subject: Removed inherit everything button from startup und service plugins. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=1d957e1b78d77000b55503949daea464e1888817;p=gosa.git Removed inherit everything button from startup und service plugins. Added Inherit button to workstationGeneric git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@6841 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/systems/class_workstationGeneric.inc b/plugins/admin/systems/class_workstationGeneric.inc index c9414bf70..42029b613 100644 --- a/plugins/admin/systems/class_workstationGeneric.inc +++ b/plugins/admin/systems/class_workstationGeneric.inc @@ -58,6 +58,8 @@ class workgeneric extends plugin var $fai_activated = FALSE; + var $member_of_ogroup = FALSE; + function workgeneric ($config, $dn= NULL, $parent= NULL) { /* Check if FAI is activated */ @@ -67,6 +69,14 @@ class workgeneric extends plugin } plugin::plugin ($config, $dn, $parent); + + if(!isset($this->parent->by_object['ogroup'])){ + $ldap = $this->config->get_ldap_link(); + $ldap->cd ($this->config->current['BASE']); + $ldap->search("(&(objectClass=gotoWorkstationTemplate)(member=".$this->dn."))",array("cn")); + $this->member_of_ogroup = $ldap->count() >= 1; + } + $this->netConfigDNS = new termDNS($this->config,$this->dn,$this->objectclasses); $this->netConfigDNS->acl = $this->acl; @@ -284,9 +294,13 @@ class workgeneric extends plugin $this->netConfigDNS->cn= $this->cn; $smarty->assign("netconfig", $this->netConfigDNS->execute()); $smarty->assign("fai_activated",$this->fai_activated); + + $smarty->assign("member_of_ogroup",$this->member_of_ogroup); + return($smarty->fetch (get_template_path('workstation.tpl', TRUE))); } + function remove_from_parent() { $this->netConfigDNS->acl = $this->acl; @@ -314,6 +328,10 @@ class workgeneric extends plugin { plugin::save_object(); + if(isset($_POST["inheritAll"])){ + $this->set_everything_to_inherited(); + } + /* Save base, since this is no LDAP attribute */ if (isset($_POST['base']) && chkacl($this->acl, "create") == ""){ $this->base= $_POST['base']; @@ -478,7 +496,23 @@ class workgeneric extends plugin show_ldap_error($ldap->get_error(), _("Saving workstation failed")); } -} + function set_everything_to_inherited() + { + /* Set workstation service attributes to inherited */ + if($this->member_of_ogroup && isset($this->parent->by_object['workservice'])){ + foreach(array("gotoXKbLayout","gotoXKbModel","gotoXKbVariant", + "gotoXResolution","gotoXColordepth","gotoXMouseType","gotoXMouseType") as $name){ + $this->parent->by_object['workservice']->$name = "default"; + } + } -// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: + /* Set workstation startup attributes to inherited */ + if($this->member_of_ogroup && isset($this->parent->by_object['workstartup'])){ + $this->parent->by_object['workstartup']->gotoBootKernel = "default-inherited"; + $this->parent->by_object['workstartup']->gotoLdapServer = "default-inherited"; + $this->parent->by_object['workstartup']->FAIdebianMirror= "inherited"; + } + } +} + // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: ?> diff --git a/plugins/admin/systems/class_workstationService.inc b/plugins/admin/systems/class_workstationService.inc index a12ac0992..54af9393d 100644 --- a/plugins/admin/systems/class_workstationService.inc +++ b/plugins/admin/systems/class_workstationService.inc @@ -53,19 +53,10 @@ class workservice extends plugin var $XKbLayouts =array(); var $XKbVariants =array(); - var $member_of_ogroup = FALSE; - function workservice ($config, $dn= NULL, $parent= NULL) { plugin::plugin ($config, $dn, $parent); - if(!isset($this->parent->by_object['ogroup'])){ - $ldap = $this->config->get_ldap_link(); - $ldap->cd ($this->config->current['BASE']); - $ldap->search("(&(objectClass=gotoWorkstationTemplate)(member=".$this->dn."))",array("cn")); - $this->member_of_ogroup = $ldap->count() >= 1; - } - $this->XResolutions= array( "640x480" => "640x480", "800x600" => "800x600", @@ -331,8 +322,6 @@ class workservice extends plugin $smarty->assign("hiddenState",""); } - $smarty->assign("member_of_ogroup",$this->member_of_ogroup); - /* Show main page */ return($smarty->fetch (get_template_path('workstationService.tpl',TRUE,dirname(__FILE__)))); } @@ -347,10 +336,6 @@ class workservice extends plugin { plugin::save_object(); - if(isset($_POST["inheritAll"])){ - $this->set_everything_to_inherited(); - } - if(isset($_POST['gotoXDriver']) && chkacl($this->acl,"AutoSync") == ""){ if(isset($_POST['AutoSync'])){ $this->AutoSync = true; @@ -444,19 +429,6 @@ class workservice extends plugin $this->handle_post_events("modify"); } - - function set_everything_to_inherited() - { - $this->gotoXKbLayout = "default"; - $this->gotoXKbModel = "default"; - $this->gotoXKbVariant = "default"; - - $this->gotoXDriver ="default"; - $this->gotoXResolution ="default"; - $this->gotoXColordepth ="default"; - $this->gotoXMouseType ="default"; - $this->gotoXMouseport ="default"; - } } // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: diff --git a/plugins/admin/systems/class_workstationStartup.inc b/plugins/admin/systems/class_workstationStartup.inc index 837920e3e..be645996f 100644 --- a/plugins/admin/systems/class_workstationStartup.inc +++ b/plugins/admin/systems/class_workstationStartup.inc @@ -32,7 +32,6 @@ class workstartup extends plugin var $customParameters = ""; var $orig_dn = ""; var $ignore_account = TRUE; - var $member_of_ogroup = FALSE; /* FAI class selection */ var $FAIclass = array(); @@ -66,13 +65,6 @@ class workstartup extends plugin plugin::plugin ($config, $dn, $parent); - if(!isset($this->parent->by_object['ogroup'])){ - $ldap = $this->config->get_ldap_link(); - $ldap->cd ($this->config->current['BASE']); - $ldap->search("(&(objectClass=gotoWorkstationTemplate)(member=".$this->dn."))",array("cn")); - $this->member_of_ogroup = $ldap->count() >= 1; - } - /* Creating a list of valid Mirrors * none will not be saved to ldap. */ @@ -800,8 +792,6 @@ class workstartup extends plugin $smarty->assign($value."ACL", chkacl($this->acl, "$value")); } - $smarty->assign("member_of_ogroup",$this->member_of_ogroup); - /* Show main page */ return($smarty->fetch (get_template_path('workstationStartup.tpl', TRUE,dirname(__FILE__)))); } @@ -940,9 +930,6 @@ class workstartup extends plugin $this->customParameters= $_POST["customParameters"]; } - if(isset($_POST["inheritAll"])){ - $this->set_everything_to_inherited(); - } } @@ -1158,13 +1145,6 @@ class workstartup extends plugin return($ret); } - - function set_everything_to_inherited() - { - $this->gotoBootKernel = "default-inherited"; - $this->gotoLdapServer = "default-inherited"; - $this->FAIdebianMirror= "inherited"; - } } // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: diff --git a/plugins/admin/systems/workstation.tpl b/plugins/admin/systems/workstation.tpl index 9d6b9f85d..0a8f0fd06 100644 --- a/plugins/admin/systems/workstation.tpl +++ b/plugins/admin/systems/workstation.tpl @@ -31,6 +31,17 @@ {/if} +{if $member_of_ogroup} + + + {t}Inheritance{/t} + + + + + +{/if} + diff --git a/plugins/admin/systems/workstationService.tpl b/plugins/admin/systems/workstationService.tpl index fe10a2efe..3cc0357c3 100644 --- a/plugins/admin/systems/workstationService.tpl +++ b/plugins/admin/systems/workstationService.tpl @@ -1,6 +1,3 @@ -{if $member_of_ogroup} - -{/if}
diff --git a/plugins/admin/systems/workstationStartup.tpl b/plugins/admin/systems/workstationStartup.tpl index 446d7475f..238784119 100644 --- a/plugins/admin/systems/workstationStartup.tpl +++ b/plugins/admin/systems/workstationStartup.tpl @@ -1,7 +1,3 @@ -{if $member_of_ogroup} - -{/if} -