From: hickert Date: Thu, 12 Jul 2007 08:27:02 +0000 (+0000) Subject: Added inherit Button to terminal Generic X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=fd0e0b3d539291254b9db7114ddf964375618031;p=gosa.git Added inherit Button to terminal Generic git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@6843 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/systems/class_terminalGeneric.inc b/plugins/admin/systems/class_terminalGeneric.inc index 353ee0d32..5a9f52357 100644 --- a/plugins/admin/systems/class_terminalGeneric.inc +++ b/plugins/admin/systems/class_terminalGeneric.inc @@ -52,6 +52,8 @@ class termgeneric extends plugin var $fai_activated = FALSE; + var $member_of_ogroup = FALSE; + function termgeneric ($config, $dn= NULL, $parent= NULL) { /* Check if FAI is activated */ @@ -61,6 +63,14 @@ class termgeneric 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); /* Read arrays */ foreach (array("ghNetNic", "ghIdeDev", "ghScsiDev") as $val){ @@ -308,6 +318,9 @@ class termgeneric extends plugin $smarty->assign("netconfig", $this->netConfigDNS->execute()); $smarty->assign("fai_activated",$this->fai_activated); $smarty->assign("actionACL", chkacl($this->acl, 'action')); + + $smarty->assign("member_of_ogroup",$this->member_of_ogroup); + return($smarty->fetch (get_template_path('terminal.tpl', TRUE))); } @@ -343,6 +356,11 @@ class termgeneric extends plugin { plugin::save_object(); $this->netConfigDNS->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']; @@ -503,6 +521,24 @@ class termgeneric extends plugin show_ldap_error($ldap->get_error(), _("Saving terminal failed")); } + + function set_everything_to_inherited() + { + /* Set workstation service attributes to inherited */ + if($this->member_of_ogroup && isset($this->parent->by_object['termservice'])){ + foreach(array("gotoXKbLayout","gotoXKbModel","gotoXKbVariant", + "gotoXResolution","gotoXColordepth","gotoXMouseType","gotoXMouseType") as $name){ + $this->parent->by_object['termservice']->$name = "default"; + } + } + + /* Set workstation startup attributes to inherited */ + if($this->member_of_ogroup && isset($this->parent->by_object['termstartup'])){ + $this->parent->by_object['termstartup']->gotoBootKernel = "default-inherited"; + $this->parent->by_object['termstartup']->gotoLdapServer = "default-inherited"; + } + } + } // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: diff --git a/plugins/admin/systems/terminal.tpl b/plugins/admin/systems/terminal.tpl index 677297a63..60b4cb32c 100644 --- a/plugins/admin/systems/terminal.tpl +++ b/plugins/admin/systems/terminal.tpl @@ -26,6 +26,16 @@ {/if} +{if $member_of_ogroup} + + + {t}Inheritance{/t} + + + + + +{/if}