X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=plugins%2Fadmin%2Fsystems%2Fclass_workstationGeneric.inc;h=e3900e931c2e1b098d02dd8be6be11886fd7e4c1;hb=499786c811063a46a322b65d28c19234800e4262;hp=70d3dfce9d7e84239e9941a513f856b38de3edd5;hpb=7726d129d02c0b57f54f5ce04faf48820d55240e;p=gosa.git diff --git a/plugins/admin/systems/class_workstationGeneric.inc b/plugins/admin/systems/class_workstationGeneric.inc index 70d3dfce9..e3900e931 100644 --- a/plugins/admin/systems/class_workstationGeneric.inc +++ b/plugins/admin/systems/class_workstationGeneric.inc @@ -64,6 +64,8 @@ class workgeneric extends plugin var $fai_activated = FALSE; + var $member_of_ogroup = FALSE; + function workgeneric ($config, $dn= NULL, $parent= NULL) { $tmp = search_config($config->data,"faiManagement","CLASS"); @@ -72,6 +74,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); /* Read arrays */ @@ -100,6 +110,11 @@ class workgeneric extends plugin $this->gotoNtpServer=array(); } + /* You can't inherit the NTP service, if we are not member in an object group */ + if(!$this->member_of_ogroup){ + $this->inheritTimeServer = FALSE; + } + /* Create available ntp options */ $tmp = $this->config->data['SERVERS']['NTP']; $this->gotoNtpServers = array(); @@ -123,7 +138,7 @@ class workgeneric extends plugin $tmp = $this->config->data['SERVERS']['SYSLOG']; foreach($tmp as $server){ $visible = $server; - if($server == "default") { + if($server == "default" && $this->member_of_ogroup) { $visible = "["._("inherited")."]"; } $this->gotoSyslogServers[$server] = $visible; @@ -326,6 +341,7 @@ class workgeneric extends plugin /* tell smarty the inherit checkbox state */ $smarty->assign("inheritTimeServer",$this->inheritTimeServer); + $smarty->assign("member_of_ogroup",$this->member_of_ogroup); /* Show main page */ $smarty->assign("netconfig", $this->netConfigDNS->execute()); @@ -354,6 +370,10 @@ class workgeneric extends plugin $og->save (); } } + + if(isset($_POST["inheritAll"])){ + $this->set_everything_to_inherited(); + } } @@ -380,13 +400,16 @@ class workgeneric extends plugin /* Set inherit mode */ if((isset($_POST['workgeneric_posted'])) && ($this->acl_is_writeable("gotoNtpServer"))){ - if(isset($_POST["inheritTimeServer"])){ + if(isset($_POST["inheritTimeServer"]) && $this->member_of_ogroup){ $this->inheritTimeServer = true; }else{ $this->inheritTimeServer = false; } } - + + if(isset($_POST["inheritAll"])){ + $this->set_everything_to_inherited(); + } } @@ -605,7 +628,26 @@ class workgeneric extends plugin )); } -} + function set_everything_to_inherited() + { + $this->gotoSyslogServer = "default"; + $this->inheritTimeServer = TRUE; + + /* 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","gotoXMouseport") 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: ?>