Code

Apply fix for #3750
[gosa.git] / trunk / gosa-plugins / fai / admin / fai / tabsPartition.inc
1 <?php
3 class tabsPartition extends tabs
4 {
5   var $base= "";
6   var $parent ="";
8   function tabsPartition($config, $data, $dn,$category)
9   {
10         tabs::tabs($config, $data, $dn,$category);
12         /* Add references/acls/snapshots */
13 #       $this->addSpecialTabs();
14   }
16   function check($ignore_account= FALSE)
17   {
18         return (tabs::check(TRUE));
19   }
20   
22   function save($ignore_account= FALSE)
23   {
24         $baseobject= $this->by_object['faiPartitionTable'];
26         $new_dn ='cn='.$baseobject->cn.",".get_ou('faiPartitionRDN').$this->parent->fai_release;
28         if ($this->dn != $new_dn && $this->dn != "new"){
29                 
30                 /* if( new_dn is subtree of this->dn ) */
31                 $cnt1 = count(split(",",$this->dn));
32                 $cnt2 = count(split(",",$new_dn));
33                 if((strstr($new_dn,$this->dn))&&($cnt1<$cnt2)){
34                         msg_dialog::display(_("Error"), _("Moving the tree failed. Destination tree is subtree of source tree."), ERROR_DIALOG);
35                 }else{
36 //                      $baseobject->recursive_move($this->dn, $new_dn);
37                 }
38         }
39         $this->dn= $new_dn;
41         tabs::save(TRUE);
42   }
44 }
46 ?>