diff --git a/plugins/admin/systems/class_workstationGeneric.inc b/plugins/admin/systems/class_workstationGeneric.inc
index 70d3dfce9d7e84239e9941a513f856b38de3edd5..e3900e931c2e1b098d02dd8be6be11886fd7e4c1 100644 (file)
var $fai_activated = FALSE;
+ var $member_of_ogroup = FALSE;
+
function workgeneric ($config, $dn= NULL, $parent= NULL)
{
$tmp = search_config($config->data,"faiManagement","CLASS");
}
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 */
$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();
$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;
/* 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());
$og->save ();
}
}
+
+ if(isset($_POST["inheritAll"])){
+ $this->set_everything_to_inherited();
+ }
}
/* 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();
+ }
}
));
}
-}
+ 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:
?>