From: hickert Date: Fri, 17 Nov 2006 08:28:44 +0000 (+0000) Subject: Fixed printer creation for new objects (incoming) X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=f16ba220f69a07b885a10c386da4f3000dcb39e0;p=gosa.git Fixed printer creation for new objects (incoming) git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@5147 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/systems/class_printGeneric.inc b/plugins/admin/systems/class_printGeneric.inc index 3738b4f4a..90337b89c 100644 --- a/plugins/admin/systems/class_printGeneric.inc +++ b/plugins/admin/systems/class_printGeneric.inc @@ -758,12 +758,25 @@ class printgeneric extends plugin } } + /* Ensure to create a new object */ + if(preg_match("/ou=incoming,/",$this->orig_dn)){ + $this->orig_dn = "new"; + } + /* Write back to ldap */ $ldap= $this->config->get_ldap_link(); if ($this->orig_dn == 'new'){ $ldap->cd($this->config->current['BASE']); $ldap->create_missing_trees(preg_replace('/^[^,]+,/', '', $this->dn)); $ldap->cd($this->dn); + + /* Remove empty values */ + foreach($this->attrs as $name => $value){ + if(empty($value)){ + unset($this->attrs[$name]); + } + } + $ldap->add($this->attrs); $this->handle_post_events("add"); } else {