diff --git a/plugins/admin/systems/class_terminalGeneric.inc b/plugins/admin/systems/class_terminalGeneric.inc
index 353ee0d324e67eeeaaaecd467bb0f957faf3256e..66500df3464b8721d69cf4b2b7e56a95d7551b39 100644 (file)
var $fai_activated = FALSE;
var $fai_activated = FALSE;
+ var $member_of_ogroup = FALSE;
+
function termgeneric ($config, $dn= NULL, $parent= NULL)
{
/* Check if FAI is activated */
function termgeneric ($config, $dn= NULL, $parent= NULL)
{
/* Check if FAI is activated */
}
plugin::plugin ($config, $dn, $parent);
}
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){
$this->netConfigDNS = new termDNS($this->config,$this->dn,$this->objectclasses);
/* Read arrays */
foreach (array("ghNetNic", "ghIdeDev", "ghScsiDev") as $val){
$this->gotoNtpServer=array();
}
$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 */
$this->gotoNtpServers = $this->config->data['SERVERS']['NTP'];
foreach($this->gotoNtpServers as $key => $server){
/* Create available ntp options */
$this->gotoNtpServers = $this->config->data['SERVERS']['NTP'];
foreach($this->gotoNtpServers as $key => $server){
$tmp = $this->config->data['SERVERS']['SYSLOG'];
foreach($tmp as $server){
$visible = $server;
$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;
$visible = "["._("inherited")."]";
}
$this->gotoSyslogServers[$server] = $visible;
if($server != "default"){
$tmp2[$server]= $server;
}else{
if($server != "default"){
$tmp2[$server]= $server;
}else{
- $tmp2[$server]="["._("inherited")."]";
+ if($this->member_of_ogroup){
+ $tmp2[$server]="["._("inherited")."]";
+ }
}
}
}
}
$smarty->assign("netconfig", $this->netConfigDNS->execute());
$smarty->assign("fai_activated",$this->fai_activated);
$smarty->assign("actionACL", chkacl($this->acl, 'action'));
$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)));
}
return($smarty->fetch (get_template_path('terminal.tpl', TRUE)));
}
{
plugin::save_object();
$this->netConfigDNS->save_object();
{
plugin::save_object();
$this->netConfigDNS->save_object();
+
/* Save base, since this is no LDAP attribute */
if (isset($_POST['base']) && chkacl($this->acl, "create") == ""){
$this->base= $_POST['base'];
/* Save base, since this is no LDAP attribute */
if (isset($_POST['base']) && chkacl($this->acl, "create") == ""){
$this->base= $_POST['base'];
}
if(isset($_POST['termgeneric_posted']) && chkacl($this->acl,"gotoNtpServer") == ""){
}
if(isset($_POST['termgeneric_posted']) && chkacl($this->acl,"gotoNtpServer") == ""){
- if(isset($_POST["inheritTimeServer"])){
+ if(isset($_POST["inheritTimeServer"]) && $this->member_of_ogroup){
$this->inheritTimeServer = true;
}else{
$this->inheritTimeServer = false;
}
}
$this->inheritTimeServer = true;
}else{
$this->inheritTimeServer = false;
}
}
+
+ if(isset($_POST["inheritAll"])){
+ $this->set_everything_to_inherited();
+ }
+
}
}
show_ldap_error($ldap->get_error(), _("Saving terminal failed"));
}
show_ldap_error($ldap->get_error(), _("Saving terminal failed"));
}
+
+ function set_everything_to_inherited()
+ {
+ $this->gotoTerminalPath = "default";
+ $this->gotoSwapServer = "default" ;
+ $this->gotoSyslogServer = "default";
+ $this->inheritTimeServer = TRUE;
+
+ /* 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","gotoXMouseport") 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:
}
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: