diff --git a/gosa-plugins/systems/admin/systems/class_servGeneric.inc b/gosa-plugins/systems/admin/systems/class_servGeneric.inc
index 2886b19b1a244e2a3293d41ef39370f6de489561..df682a60523d8d4279c0ff355acb53dc78d3a51b 100644 (file)
var $modes = array();
var $ui ;
var $validActions = array("reboot" => "", "update" => "", "localboot" => "", "reinstall" => "", "rescan" => "",
- "wake" => "", "memcheck" => "", "sysinfo" => "");
+ "wakeup" => "", "memcheck" => "", "sysinfo" => "");
var $fai_activated =FALSE;
var $view_logged = FALSE;
var $currently_installing = FALSE;
var $currently_installing_warned = FALSE;
+ var $kerberos_key_service = NULL;
+
+ var $mapActions = array("reboot" => "",
+ "instant_update" => "softupdate",
+ "localboot" => "localboot",
+ "update" => "sceduledupdate",
+ "reinstall" => "install",
+ "rescan" => "",
+ "wakeup" => "",
+ "memcheck" => "memcheck",
+ "sysinfo" => "sysinfo");
+
+
function servgeneric (&$config, $dn= NULL, $parent= NULL)
{
/* Check if FAI is activated */
plugin::plugin ($config, $dn, $parent);
+ /* Initialize */
$this->ui = get_userinfo();
$this->modes["active"]= _("Activated");
$this->modes["locked"]= _("Locked");
$this->base= dn2base($ui->dn);
$this->cn= "";
} else {
- $this->base= preg_replace ("/^[^,]+,".normalizePreg(get_ou("serverou"))."/", "", $this->dn);
+ $this->base= preg_replace ("/^[^,]+,".preg_quote(get_ou("serverRDN"), '/')."/i", "", $this->dn);
}
$this->netConfigDNS = new termDNS($this->config,$this,$this->objectclasses);
$this->netConfigDNS->set_acl_category("server");
$this->netConfigDNS->set_acl_base($this->base);
+ $this->netConfigDNS->MACisMust =TRUE;
+
+ /* Initialize kerberos host key plugin */
+ if(class_available("krbHostKeys")){
+ $this->kerberos_key_service = new krbHostKeys($this->config,$this);
+ }
/* Check if this host is currently in installation process*/
- if(class_available("gosaSupportDaemon") && class_available("DaemonEvent")){
+ if($this->dn != "new" && class_available("gosaSupportDaemon") && class_available("DaemonEvent")){
$o = new gosaSupportDaemon();
$e_types = DaemonEvent::get_event_types(USER_EVENT | SYSTEM_EVENT | HIDDEN_EVENT);
$evts = $o->get_entries_by_mac(array($this->netConfigDNS->macAddress));
"localboot" => _("Force localboot"),
"sysinfo" => _("System analysis")));
} else {
- $smarty->assign("actions", array("wake" => _("Wake up"),
+ $smarty->assign("actions", array("wakeup" => _("Wake up"),
"reinstall" => _("Reinstall"),
"update" => _("System update"),
"memcheck" => _("Memory test"),
$smarty->assign("modes", $this->modes);
$smarty->assign("currently_installing", $this->currently_installing);
+ $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('server.tpl', TRUE)));
}
return;
}
+ /* Remove kerberos key dependencies too */
+ if(is_object($this->kerberos_key_service)){
+ $this->kerberos_key_service->remove_from_parent_by_prefix("host/");
+ }
+
$this->netConfigDNS->remove_from_parent();
$ldap= $this->config->get_ldap_link();
$ldap->rmdir($this->dn);
$this->base = $base_tmp;
}
}
+
+ /* Hanle kerberos host key plugin */
+ if(is_object($this->kerberos_key_service)){
+ $this->kerberos_key_service->save_object_by_prefix("host/");
+ }
}
/* Call common method to give check the hook */
$message= plugin::check();
$message= array_merge($message, $this->netConfigDNS->check());
- $this->dn= "cn=".$this->cn.",".get_ou('serverou').$this->base;
+ $this->dn= "cn=".$this->cn.",".get_ou('serverRDN').$this->base;
/* must: cn */
if ($this->cn == ""){
if ($ldap->count() != 0){
while ($attrs= $ldap->fetch()){
if ($attrs['dn'] != $this->orig_dn){
- if(!preg_match("/cn=dhcp,/",$attrs['dn']) && !preg_match("/,".get_ou('incomingou')."/",$attrs['dn']) && preg_match("/,".get_ou('serverou')."/",$attrs['dn'])){
+ if(!preg_match("/cn=dhcp,/",$attrs['dn']) && !preg_match("/,".preg_quote(get_ou('systemIncomingRDN'), '/')."/i",$attrs['dn']) && preg_match("/,".preg_quote(get_ou('serverRDN'), '/')."/i",$attrs['dn'])){
$message[]= msgPool::duplicated(_("Server name"));
break;
}
}
/* Warn the user, that this host is currently installing */
- if($this->currently_installing && !$this->currently_installing_warned && !preg_match("/".normalizePreg(get_ou("incomingou"))."/",$this->orig_dn)){
+ if($this->currently_installing && !$this->currently_installing_warned && !preg_match("/".preg_quote(get_ou("systemIncomingRDN"), '/')."/i",$this->orig_dn)){
/* Force aborting without message dialog */
$message[] = "";
"plCategory" => array("server" => array("description" => _("Server"),
"objectClass" => "goServer")),
"plProvidedAcls"=> array(
- "cn" => _("Name"),
- "description" => _("Description"),
- "gotoMode" => _("Goto mode"),
- "base" => _("Base"),
- "FAIstate" => _("Action flag"))
+ "cn" => _("Name"),
+ "description" => _("Description"),
+ "base" => _("Base"),
+
+ "gotoMode" => _("Goto mode"),
+ "userPassword"=> _("Root password"),
+ "FAIstate" => _("Action flag"))
));
}
+
+
+ function is_modal_dialog()
+ {
+ return((isset($this->dialog) && $this->dialog) || (isset($this->netConfigDNS->dialog) && $this->netConfigDNS->dialog));
+ }
+
}
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: