diff --git a/plugins/admin/systems/class_terminalGeneric.inc b/plugins/admin/systems/class_terminalGeneric.inc
index 205415f09d0ef7232f518fb2b70bf593b8b4f8fb..66500df3464b8721d69cf4b2b7e56a95d7551b39 100644 (file)
class termgeneric extends plugin
{
class termgeneric extends plugin
{
- /* CLI vars */
- var $cli_summary= "Manage terminal base objects";
- var $cli_description= "Some longer text\nfor help";
- var $cli_parameters= array("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser");
-
/* Generic terminal attributes */
var $gotoMode= "disabled";
var $gotoTerminalPath= "";
/* Generic terminal attributes */
var $gotoMode= "disabled";
var $gotoTerminalPath= "";
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)));
}
show_ldap_error($ldap->get_error(), _("Removing terminal failed"));
/* Optionally execute a command after we're done */
show_ldap_error($ldap->get_error(), _("Removing terminal failed"));
/* Optionally execute a command after we're done */
- $this->handle_post_events("remove", array("macAddress" => $this->netConfigDNS->macAddress));
+ $this->handle_post_events("remove",array("macAddress" => $this->netConfigDNS->macAddress,"ipHostNumber" => $this->netConfigDNS->ipHostNumber));
/* Delete references to object groups */
$ldap->cd ($this->config->current['BASE']);
/* Delete references to object groups */
$ldap->cd ($this->config->current['BASE']);
{
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();
+ }
+
}
}
unset($this->attrs['gotoNtpServer']);
}
$ldap->add($this->attrs);
unset($this->attrs['gotoNtpServer']);
}
$ldap->add($this->attrs);
- $this->handle_post_events("add");
+ $this->handle_post_events("add",array("macAddress" => $this->netConfigDNS->macAddress,"ipHostNumber" => $this->netConfigDNS->ipHostNumber));
} else {
$ldap->cd($this->dn);
$this->cleanup();
$ldap->modify ($this->attrs);
} else {
$ldap->cd($this->dn);
$this->cleanup();
$ldap->modify ($this->attrs);
- $this->handle_post_events("modify");
+ $this->handle_post_events("modify",array("macAddress" => $this->netConfigDNS->macAddress,"ipHostNumber" => $this->netConfigDNS->ipHostNumber));
}
/* cn=default and macAddress=- indicates that this is a template */
}
/* cn=default and macAddress=- indicates that this is a template */
$this->netConfigDNS->cn = $this->cn;
$this->netConfigDNS->save($this->dn);
show_ldap_error($ldap->get_error(), _("Saving terminal failed"));
$this->netConfigDNS->cn = $this->cn;
$this->netConfigDNS->save($this->dn);
show_ldap_error($ldap->get_error(), _("Saving terminal failed"));
+ }
+
- /* Optionally execute a command after we're done */
- $this->postcreate();
+ 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";
+ }
}
}
}
}