Code

Fixed removal of template and profile entries.
[gosa.git] / gosa-plugins / fai / admin / fai / class_faiTemplate.inc
index 27591a8c4f636049a1605b49c3f4eaae2005d06e..47313ac420467f4357e809df160d771ce8f86a6e 100644 (file)
@@ -69,14 +69,14 @@ class faiTemplate extends plugin
 
     // Prepare lists
     $this->templateList = new sortableListing();
+    $this->templateList->setInstantDelete(false);
     $this->templateList->setDeleteable(true);
     $this->templateList->setEditable(true);
     $this->templateList->setWidth("100%");
-    $this->templateList->setHeight("120px");
-    $this->templateList->setColspecs(array('200px','*'));
-    $this->templateList->setHeader(array(_("Name"),_("Download")));
-    $this->templateList->setDefaultSortColumn(1);
-
+    $this->templateList->setHeight("220px");
+    $this->templateList->setColspecs(array('*','18px'));
+    $this->templateList->setHeader(array(_("Name"),""));
+    $this->templateList->setDefaultSortColumn(0);
   }
 
 
@@ -96,7 +96,6 @@ class faiTemplate extends plugin
         if(in_array_ics($attrs,$this->sub64coded)){
           $var = base64_decode($var);
         }
-        $var = stripslashes($var);
 
         /*  check if this is a binary entry */
         if(in_array_ics($attrs,$this->subBinary)){
@@ -280,6 +279,7 @@ class faiTemplate extends plugin
     $this->templateList->setAcl($acl,preg_match('/^freeze/', $this->FAIstate));
 
     $tmp = $this->getList(true);
+    $data = $lData = array();
     foreach($this->SubObjects as $key => $name){
 
       /* Skip removed entries */ 
@@ -309,11 +309,7 @@ class faiTemplate extends plugin
      * If we post the escaped strings they will be escaped again
      */
     foreach($this->attributes as $attrs){
-      if(get_magic_quotes_gpc()){
-        $smarty->assign($attrs,stripslashes($this->$attrs));
-      }else{
-        $smarty->assign($attrs,($this->$attrs));
-      }
+      $smarty->assign($attrs,set_post($this->$attrs));
     }
 
     $dn = $this->acl_base_for_current_object($this->dn);
@@ -404,7 +400,7 @@ class faiTemplate extends plugin
      */
     if($this->is_new){
       $release = $this->parent->parent->fai_release;
-      $new_dn= 'cn='.$this->cn.",".get_ou("faiTemplate", "faiTemplateRDN") .get_ou("faiTemplate", "faiTemplateRDN") .$release;
+      $new_dn= 'cn='.$this->cn.",".get_ou("faiTemplate", "faiTemplateRDN").get_ou("faiManagement", "faiBaseRDN").$release;
       $res = faiManagement::check_class_name("FAItemplate",$this->cn,$new_dn);
       if(isset($res[$this->cn])){
         $message[] = msgPool::duplicated(_("Name"));
@@ -535,14 +531,14 @@ class faiTemplate extends plugin
                   "name"          => "faiTemplateRDN",
                   "type"          => "rdn",
                   "default"       => "ou=templates,",
-                  "description"   => "The 'faiTemplateRDN' statement defines the location where new fai-templates will be created. The default is 'ou=templates,'.",
+                  "description"   => _("RDN for FAI template storage."),
                   "check"         => "gosaProperty::isRdn",
-                  "migrate"       => "",
+                  "migrate"       => "migrate_faiTemplateRDN",
                   "group"         => "plugin",
-                  "mandatory"     => FALSE)),
+                  "mandatory"     => TRUE)),
 
           "plProvidedAcls" => array(
-              "cn"                => _("Name")." ("._("Readonly").")",
+              "cn"                => _("Name")." ("._("Read-only").")",
             "description"       => _("Description"))
           ));
   }
@@ -556,7 +552,7 @@ class faiTemplate extends plugin
   {
     $vars = array("cn");
     $smarty = get_smarty();
-    $smarty->assign("cn", htmlentities($this->cn));
+    $smarty->assign("cn", set_post($this->cn));
     $str = $smarty->fetch(get_template_path("paste_generic.tpl",TRUE));
     $ret = array();
     $ret['string'] = $str;