diff --git a/plugins/admin/systems/class_servGeneric.inc b/plugins/admin/systems/class_servGeneric.inc
index 116628786e14a2ee21968b3b5ab93cf7199d682c..b46e85b29ceb61d2f4b63dd497a77d7c9dbf97de 100644 (file)
function servgeneric (&$config, $dn= NULL, $parent= NULL)
{
/* Check if FAI is activated */
- $tmp = search_config($config->data,"faiManagement","CLASS");
+ $tmp = $config->search("faiManagement", "CLASS",array('menu','tabs'));
+
if(!empty($tmp)){
$this->fai_activated = TRUE;
}
} else {
$this->base= preg_replace ("/^[^,]+,[^,]+,[^,]+,/", "", $this->dn);
}
- $this->netConfigDNS = new termDNS($this->config,$this->dn,$this->objectclasses);
+ $this->netConfigDNS = new termDNS($this->config,$this,$this->objectclasses);
$this->netConfigDNS->set_acl_category("server");
$this->netConfigDNS->set_acl_base($this->base);
}
/* Do we represent a valid server? */
- if (!$this->is_account && $this->parent == NULL){
+ if (!$this->is_account && $this->parent === NULL){
$display= "<img alt=\"\" src=\"images/stop.png\" align=middle> <b>".
_("This 'dn' has no server features.")."</b>";
return($display);
/* Check for action */
if (isset($_POST['action']) && $this->acl_is_writeable("FAIstate")){
- $cmd= search_config($this->config->data['TABS'], "workgeneric", "ACTIONCMD");
+ $cmd = $this->config->search("workgeneric", "ACTIONCMD",array('tabs'));
if ($cmd == ""){
print_red(_("No ACTIONCMD definition found in your gosa.conf"));
} else {
/* Show main page */
$smarty->assign("fai_activated",$this->fai_activated);
- $smarty->assign("netconfig", $this->netConfigDNS->execute());
+
+ $str = $this->netConfigDNS->execute();
+ if(is_object($this->netConfigDNS->dialog)){
+ return($str);
+ }
+ $smarty->assign("netconfig", $str);
$smarty->assign("modes", $this->modes);
return($smarty->fetch (get_template_path('server.tpl', TRUE)));
$message[]= _("The required field 'Server name' is not set.");
}
+ /* Check if given name is a valid host/dns name */
+ if(!is_dns_name($this->cn)){
+ $message[] = _("Please specify a valid name for this object.");
+ }
+
if ($this->orig_dn != $this->dn){
$ldap= $this->config->get_ldap_link();
$ldap->cd ($this->base);
}
show_ldap_error($ldap->get_error(), sprintf(_("Saving of system server/generic with dn '%s' failed."),$this->dn));
$this->netConfigDNS->cn = $this->cn;
- $this->netConfigDNS->save($this->dn);
+ $this->netConfigDNS->save();
/* Optionally execute a command after we're done */
if(!$this->didAction){