Code

Added sorting to FAIscripts
[gosa.git] / plugins / admin / fai / class_faiTemplateEntry.inc
index 7a3c48ddf370042b058dca626bc8da9956fded21..203c789baa6769a8a6b7eb2894faffa903cc7a70 100644 (file)
@@ -25,7 +25,7 @@ class faiTemplateEntry extends plugin
   var $user          = "root";
   var $group         = "root";
   var $binary        = false;
-
+  var $parent        = NULL;
   var $FAIstate      = "";
   
   function faiTemplateEntry ($config, $dn= NULL,$object=false)
@@ -184,6 +184,10 @@ class faiTemplateEntry extends plugin
     /* Call common method to give check the hook */
     $message= plugin::check();
 
+    if(isset($this->parent->SubObjects[$this->cn]) && $this->cn != $this->orig_cn){
+      $message[] =_("There is already a template with the given name.");
+    }
+
     if(empty($this->FAItemplateFile)){
       $message[]=_("Please specify a value for attribute 'file'.");
     }