diff --git a/gosa-plugins/goto/admin/systems/goto/class_terminalGeneric.inc b/gosa-plugins/goto/admin/systems/goto/class_terminalGeneric.inc
index 1971c76a83e2495589a0acfb6476248138b36b0d..9fdf6fabeae2b5438450bfa54308c02c450c7ccb 100644 (file)
var $description= "";
var $orig_dn= "";
var $orig_cn= "";
+ var $orig_base= "";
var $inheritTimeServer = true;
var $member_of_ogroup = FALSE;
+ var $kerberos_key_service = NULL;
+
+
function termgeneric (&$config, $dn= NULL, $parent= NULL)
{
/* Check if FAI is activated */
plugin::plugin ($config, $dn, $parent);
+ if(class_available("krbHostKeys")){
+ $this->kerberos_key_service = new krbHostKeys($this->config,$this);
+ }
+
if(!isset($this->parent->by_object['ogroup'])){
$ldap = $this->config->get_ldap_link();
$ldap->cd ($this->config->current['BASE']);
$ui= get_userinfo();
$this->base= dn2base($ui->dn);
} else {
- $this->base= preg_replace ("/^[^,]+,".normalizePreg(get_ou("terminalou"))."/", "", $this->dn);
+ $this->base= preg_replace ("/^[^,]+,".normalizePreg(get_ou("terminalRDN"))."/", "", $this->dn);
}
/* Create an array of all Syslog servers */
$this->orig_dn= $this->dn;
$this->orig_cn= $this->cn;
+ $this->orig_base= $this->base;
}
function set_acl_base($base)
/* Do we represent a valid terminal? */
if (!$this->is_account && $this->parent === NULL){
- $display= "<img alt=\"\" src=\"images/stop.png\" align=middle> <b>".
+ $display= "<img alt=\"\" src=\"images/small-error.png\" align=middle> <b>".
msgPool::noValidExtension(_("terminal"))."</b>";
return($display);
}
if (gosaSupportDaemon::ping($this->netConfigDNS->macAddress)){
$smarty->assign("actions", array( "halt" => _("Switch off"),
"reboot" => _("Reboot"),
- "memcheck" => _("Memory test"),
- "sysinfo" => _("System analysis")));
+ #"memcheck" => _("Memory test"),
+ #"sysinfo" => _("System analysis")
+ ));
} else {
$smarty->assign("actions", array("wake" => _("Wake up"),
- "memcheck" => _("Memory test"),
- "sysinfo" => _("System analysis")));
+ #"memcheck" => _("Memory test"),
+ #"sysinfo" => _("System analysis")
+ ));
}
/* Arrays */
return($str);
}
$smarty->assign("netconfig", $str);
+
+ /* Display kerberos host key options */
+ $smarty->assign("host_key","");
+ if(is_object($this->kerberos_key_service)){
+ $smarty->assign("host_key",$this->kerberos_key_service->execute_by_prefix("host/"));
+ }
+
return($smarty->fetch (get_template_path('terminal.tpl', TRUE, dirname(__FILE__))));
}
msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_DEL, get_class()));
}
+ /* Remove kerberos key dependencies too */
+ if(is_object($this->kerberos_key_service)){
+ $this->kerberos_key_service->remove_from_parent_by_prefix("host/");
+ }
+
/* Optionally execute a command after we're done */
$this->handle_post_events("remove",array("macAddress" => $this->netConfigDNS->macAddress,"ipHostNumber" => $this->netConfigDNS->ipHostNumber));
$this->set_everything_to_inherited();
}
+ /* Hanle kerberos host key plugin */
+ if(is_object($this->kerberos_key_service)){
+ $this->kerberos_key_service->save_object_by_prefix("host/");
+ }
}
}
/* Permissions for that base? */
- $this->dn= "cn=".$this->cn.",".get_ou('terminalou').$this->base;
+ $this->dn= "cn=".$this->cn.",".get_ou('terminalRDN').$this->base;
if ($this->cn == ""){
$message[]= msgPool::required(_("Name"));
}
if ($ldap->count() != 0){
while ($attrs= $ldap->fetch()){
- if (preg_match("/cn=dhcp,/",$attrs['dn']) || preg_match ("/,".normalizePreg(get_ou('incomingou'))."/", $ldap->getDN())){
+ if (preg_match("/cn=dhcp,/",$attrs['dn']) || preg_match ("/,".normalizePreg(get_ou('systemIncomingRDN'))."/", $ldap->getDN())){
continue;
} else {
if ($attrs['dn'] != $this->orig_dn){
$message[]= msgPool::required(_("NTP server"));
}
+ /* Check if we are allowed to create or move this object
+ */
+ if($this->orig_dn == "new" && !$this->acl_is_createable($this->base)){
+ $message[] = msgPool::permCreate();
+ }elseif($this->orig_dn != "new" && $this->base != $this->orig_base && !$this->acl_is_moveable($this->base)){
+ $message[] = msgPool::permMove();
+ }
+
return ($message);
}
}
}
+ /* cn=default and macAddress=- indicates that this is a template */
+ if($this->cn == "default"){
+ $this->netConfigDNS->macAddress = "-";
+ }
+
/* Write back to ldap */
$ldap= $this->config->get_ldap_link();
if ($this->orig_dn == 'new'){
}
$ldap->add($this->attrs);
new log("create","terminal/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+
+ $this->netConfigDNS->cn = $this->cn;
+ $this->netConfigDNS->save();
+
$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);
new log("modify","terminal/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+
+ $this->netConfigDNS->cn = $this->cn;
+ $this->netConfigDNS->save();
+
$this->handle_post_events("modify",array("macAddress" => $this->netConfigDNS->macAddress,"ipHostNumber" => $this->netConfigDNS->ipHostNumber));
/* Update all accessTo/trust dependencies */
}
}
- /* cn=default and macAddress=- indicates that this is a template */
- if($this->cn == "default"){
- $this->netConfigDNS->macAddress = "-";
- }
-
- $this->netConfigDNS->cn = $this->cn;
- $this->netConfigDNS->save();
if (!$ldap->success()){
msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class()));
}
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";
+
+ $this->parent->by_object['workstartup']->gotoLdap_inherit = TRUE;
+ $this->parent->by_object['workstartup']->gotoLdapServers = array();
}
}
}