Code

Fixed removal of template and profile entries.
[gosa.git] / gosa-plugins / fai / admin / fai / class_faiProfile.inc
index 2d6fb5b8ba73d2e435ca431409dfc32a63c79a94..9608e6a2fc36cd5d5324c6f54c1b42e4aa463409 100644 (file)
@@ -68,7 +68,7 @@ class faiProfile extends plugin
 
             /* Sort by categorie */
             foreach($categories as $cat){
-                if(in_array($cat,$attrs['objectClass'])){
+                if(in_array_strict($cat,$attrs['objectClass'])){
 
                     /* Append entry */
                     $this->FAIAllclasses[$attrs['cn'][0]][$cat]=$attrs;
@@ -99,6 +99,7 @@ class faiProfile extends plugin
         // Prepare lists
         $this->classList = new sortableListing(array(),array(), TRUE);
         $this->classList->setDeleteable(true);
+        $this->classList->setInstantDelete(false);
         $this->classList->setEditable(false);
         $this->classList->setWidth("100%");
         $this->classList->setHeight("200px");
@@ -141,10 +142,10 @@ class faiProfile extends plugin
         $sort_once = false;
         if(!preg_match("/freeze/",$this->FAIstate)){
 
-        if(isset($_POST['AddClass']) && $this->acl_is_writeable("FAIclass")){
+            if(isset($_POST['AddClass']) && $this->acl_is_writeable("FAIclass")){
                 $this->classSelect = new classSelect($this->config, get_userinfo());
                 $this->dialog  =true;
-        }
+            }
 
 
             /* Save Dialog */
@@ -212,11 +213,7 @@ class faiProfile 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));
         }
 
 
@@ -284,7 +281,7 @@ class faiProfile extends plugin
          */
         if($this->dn == "new" || $this->cn != $this->old_cn){
             $release = $this->parent->parent->fai_release;
-            $new_dn= 'cn='.$this->cn.",".get_ou('faiProfileRDN').get_ou('faiBaseRDN').$release;
+            $new_dn= 'cn='.$this->cn.",".get_ou("faiProfile", "faiProfileRDN").get_ou("faiManagement", "faiBaseRDN").$release;
             $res = faiManagement::check_class_name("FAIprofile",$this->cn,$new_dn);
             if(isset($res[$this->cn])){
                 $message[] = msgPool::duplicated(_("Name"));
@@ -366,11 +363,11 @@ class faiProfile extends plugin
                             "name"          => "faiProfileRDN",
                             "type"          => "rdn",
                             "default"       => "ou=profiles,",
-                            "description"   => "The 'faiProfileRDN' statement defines the location where new fai-profiles will be created. The default is 'ou=profiles,'.",
+                            "description"   => _("RDN for FAI profile storage."),
                             "check"         => "gosaProperty::isRdn",
-                            "migrate"       => "",
+                            "migrate"       => "migrate_faiProfileRDN",
                             "group"         => "plugin",
-                            "mandatory"     => FALSE)),
+                  "mandatory"     => TRUE)),
 
 
                     "plProvidedAcls" => array(
@@ -389,7 +386,7 @@ class faiProfile 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;