X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=include%2Fclass_plugin.inc;h=c41ac56fa96d78e279ab205772067eec37dfd660;hb=8d25a981707ac7e708aca0ed6216c5379a1228f8;hp=3ebd529b95ce2d1bbddeb48fe9fdb8ae579d3335;hpb=9f075daee706f79e6a8887cbc78bf4f3ca075f9e;p=gosa.git diff --git a/include/class_plugin.inc b/include/class_plugin.inc index 3ebd529b9..c41ac56fa 100644 --- a/include/class_plugin.inc +++ b/include/class_plugin.inc @@ -114,7 +114,7 @@ class plugin \param dn Distinguished name to initialize plugin from \sa plugin() */ - function plugin ($config, $dn= NULL) + function plugin ($config, $dn= NULL, $parent= NULL) { /* Configuration is fine, allways */ $this->config= $config; @@ -130,8 +130,12 @@ class plugin if ($dn != NULL){ /* Load data to 'attrs' and save 'dn' */ - $ldap->cat ($dn); - $this->attrs= $ldap->fetch(); + if ($parent != NULL){ + $this->attrs= $parent->attrs; + } else { + $ldap->cat ($dn); + $this->attrs= $ldap->fetch(); + } /* Copy needed attributes */ foreach ($this->attributes as $val){ @@ -264,7 +268,7 @@ class plugin foreach ($this->attributes as $val){ if (chkacl ($this->acl, "$val") == "" && isset ($_POST["$val"])){ /* Check for modifications */ - if (get_magic_quotes_gpc()) { + if ((get_magic_quotes_gpc()) && !is_array($_POST["$val"])) { $data= stripcslashes($_POST["$val"]); } else { $data= $this->$val = $_POST["$val"]; @@ -860,7 +864,9 @@ class plugin } $todo[] = "is_account"; foreach($todo as $var){ - $this->$var = $source->$var; + if (isset($source->$var)){ + $this->$var= $source->$var; + } } }