Code

* Created "old" branch and moved stuff
[gosa.git] / branches / old / gosa-plugins / fai / admin / fai / tabsProfile.inc
diff --git a/branches/old/gosa-plugins/fai/admin/fai/tabsProfile.inc b/branches/old/gosa-plugins/fai/admin/fai/tabsProfile.inc
new file mode 100644 (file)
index 0000000..45e91d8
--- /dev/null
@@ -0,0 +1,45 @@
+<?php
+
+class tabsProfile extends tabs
+{
+  var $base= "";
+  var $parent ="";
+
+  function tabsProfile($config, $data, $dn,$category)
+  {
+       tabs::tabs($config, $data, $dn,$category);
+
+       /* Add references/acls/snapshots */
+#      $this->addSpecialTabs();
+  }
+
+  function check($ignore_account= FALSE)
+  {
+       return (tabs::check(TRUE));
+  }
+  
+
+  function save($ignore_account= FALSE)
+  {
+       $baseobject= $this->by_object['faiProfile'];
+       $new_dn ='cn='.$baseobject->cn.",".get_ou('faiprofileou').$this->parent->fai_release;
+                       
+       if ($this->dn != $new_dn && $this->dn != "new"){
+               
+               /* if( new_dn is subtree of this->dn ) */
+               $cnt1 = count(split(",",$this->dn));
+               $cnt2 = count(split(",",$new_dn));
+               if((strstr($new_dn,$this->dn))&&($cnt1<$cnt2)){
+                       msg_dialog::display(_("Error"), _("Moving the tree failed. Destination tree is subtree of source tree."), ERROR_DIALOG);
+               }else{
+//                     $baseobject->recursive_move($this->dn, $new_dn);
+               }
+       }
+       $this->dn= $new_dn;
+
+       tabs::save(TRUE);
+  }
+
+}
+
+?>