From: hickert Date: Wed, 18 Jan 2006 08:54:21 +0000 (+0000) Subject: Added better check for naming check X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=3a2f5743c0128411ce661b44e132ed7c9bbe7c4b;p=gosa.git Added better check for naming check git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2516 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/systems/class_glpiAttachmentPool.inc b/plugins/admin/systems/class_glpiAttachmentPool.inc index 6ee839e4a..3a8c3d9de 100644 --- a/plugins/admin/systems/class_glpiAttachmentPool.inc +++ b/plugins/admin/systems/class_glpiAttachmentPool.inc @@ -316,9 +316,16 @@ class glpiAttachmentPool extends plugin $att = $this->parent->handle->getAttachments(); $ok = true; $this->name=trim($this->name); + foreach($att as $val){ - if($val['name'] == $this->name){ - $ok = false; + if(!isset($this->entry['ID'])){ + if($val['name'] == $this->name){ + $ok = false; + } + }else{ + if(($val['name'] == $this->name)&&($this->entry['ID'] != $val['ID'])){ + $ok = false; + } } } if(!$ok){