diff --git a/plugins/admin/systems/class_servGeneric.inc b/plugins/admin/systems/class_servGeneric.inc
index d44b6763b8cb800dce8859222f7f59bb71f3dfcb..116628786e14a2ee21968b3b5ab93cf7199d682c 100644 (file)
var $fai_activated =FALSE;
var $view_logged = FALSE;
- function servgeneric ($config, $dn= NULL, $parent= NULL)
+ function servgeneric (&$config, $dn= NULL, $parent= NULL)
{
/* Check if FAI is activated */
$tmp = search_config($config->data,"faiManagement","CLASS");
if ($ldap->count() != 0){
while ($attrs= $ldap->fetch()){
if ($attrs['dn'] != $this->orig_dn){
- if(!preg_match("/,ou=incoming,/",$attrs['dn'])){
+ if(!preg_match("/cn=dhcp,/",$attrs['dn']) && !preg_match("/,ou=incoming,/",$attrs['dn']) && preg_match("/,ou=servers,ou=systems,/",$attrs['dn'])){
$message[]= sprintf (_("There is already an entry '%s' in the base choosen by you"), $this->cn);
break;
}
/* cn is not case sensitive for ldap, but for php it is!! */
if($this->config->current['DNMODE'] == "cn"){
if (strtolower($this->orig_dn) != (strtolower($this->dn))){
- $this->move($this->orig_dn, $this->dn);
+ $this->recursive_move($this->orig_dn, $this->dn);
plugin::save();
}
}else{
if ($this->orig_dn != $this->dn){
- $this->move($this->orig_dn, $this->dn);
+ $this->recursive_move($this->orig_dn, $this->dn);
plugin::save();
}
}
}
+ /* Display generic part for server copy & paste */
+ function getCopyDialog()
+ {
+ $vars = array("cn");
+
+ $smarty = get_smarty();
+ $smarty->assign("cn" ,$this->cn);
+ $smarty->assign("object","server");
+ $str = $smarty->fetch(get_template_path("paste_generic.tpl",TRUE));
+ $ret = array();
+ $ret['string'] = $str;
+ $ret['status'] = "";
+ return($ret);
+ }
+
+
+ function saveCopyDialog()
+ {
+ if(isset($_POST['cn'])){
+ $this->cn = $_POST['cn'];
+ }
+ }
+
+
+ function PrepareForCopyPaste($source)
+ {
+ plugin::PrepareForCopyPaste($source);
+ if(isset($source['macAddress'][0])){
+ $this->netConfigDNS->macAddress = $source['macAddress'][0];
+ }
+ if(isset($source['ipHostNumber'][0])){
+ $this->netConfigDNS->ipHostNumber = $source['ipHostNumber'][0];
+ }
+
+ }
+
+
+
/* Return plugin informations for acl handling */
function plInfo()
{
"plPriority" => 1,
"plSection" => array("administration"),
"plCategory" => array("server" => array("description" => _("Server"),
- "objectClass" => "gotoWorkstation")),
+ "objectClass" => "goServer")),
"plProvidedAcls"=> array(
"cn" => _("Name"),
"description" => _("Description"),