From: hickert Date: Thu, 27 Apr 2006 04:29:05 +0000 (+0000) Subject: Base for printGeneric wasn't set correctly X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=4599960b14f2a9b49c6fdddb030b5fa30004594e;p=gosa.git Base for printGeneric wasn't set correctly git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3129 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/systems/class_printGeneric.inc b/plugins/admin/systems/class_printGeneric.inc index e18bf2409..51b124383 100644 --- a/plugins/admin/systems/class_printGeneric.inc +++ b/plugins/admin/systems/class_printGeneric.inc @@ -91,7 +91,13 @@ class printgeneric extends plugin $this->base= dn2base($ui->dn); $this->cn= ""; } else { - $this->base= dn2base($this->dn); + + /* Set base and check if the extracted base exists */ + $this->base= preg_replace("/ou=printers,ou=systems,/","",dn2base($this->dn)); + if(!isset($this->config->idepartments[$this->base])){ + print_red(_("Can't extract a valid base out of object dn, setting base to '%s'."),$_SESSION['CurrentMainBase']); + $this->base = $_SESSION['CurrentMainBase']; + } } /* Extract selected ppd */ @@ -588,7 +594,7 @@ class printgeneric extends plugin if(($this->BelongsTo == "Printer") && (empty($this->cn))){ $message[]= "The required field 'Printer name' is not set."; } - + /* Check if there is already an entry with this cn*/ if (($this->orig_dn != $dn)&&($this->BelongsTo == "Printer")){ $ldap= $this->config->get_ldap_link();