Code

Updated device handling
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 30 Sep 2010 11:26:28 +0000 (11:26 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 30 Sep 2010 11:26:28 +0000 (11:26 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19868 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/goto/admin/systems/goto/Config/class_DeviceConfig.inc
gosa-plugins/goto/admin/systems/goto/Config/class_ItemSelector.inc [new file with mode: 0644]

index 9f06dbd810a5a86a8fab5e1d099dc206c32001d2..afbfc4144fa14ed622f51eb5c5fb1f06bf34430a 100644 (file)
@@ -148,6 +148,11 @@ class DeviceConfig extends management
         $base = (isset($current['base']))? ",".$current['base'] : '';
         $base = "{$type}={$name}{$base}";
 
+
+        if(isset($this->mappingBaseToID[$base])){
+            echo "Cannot add entry, dn already in use! {$base}<br>";
+            return(null);
+        }
     
         // Get next free item slot.
         $id = count($this->allConfiguredItems);
@@ -240,7 +245,7 @@ class DeviceConfig extends management
 
         // Collect item container list to be able to render the fake-base selector
         if(!$this->itemContainerSelector){
-            $this->itemContainerSelector = new releaseSelector(
+            $this->itemContainerSelector = new ItemSelector(
                     $this->getContainerList(), 
                     $this->base, 
                     $this->allConfiguredItems[0]['base']);
diff --git a/gosa-plugins/goto/admin/systems/goto/Config/class_ItemSelector.inc b/gosa-plugins/goto/admin/systems/goto/Config/class_ItemSelector.inc
new file mode 100644 (file)
index 0000000..f4186de
--- /dev/null
@@ -0,0 +1,25 @@
+<?php
+/*
+ * This code is part of GOsa (http://www.gosa-project.org)
+ * Copyright (C) 2003-2010 GONICUS GmbH
+ *
+ * ID: $$Id: class_listing.inc 15296 2010-01-26 08:27:39Z cajus $$
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+class ItemSelector extends releaseSelector {
+}
+?>