Code

Added subdepartments for FAI objects
[gosa.git] / plugins / admin / fai / tabsPartition.inc
1 <?php
3 class tabsPartition extends tabs
4 {
5   var $base= "";
7   function tabsPartition($config, $data, $dn)
8   {
9         tabs::tabs($config, $data, $dn);
10   }
12   function check()
13   {
14         return (tabs::check(TRUE));
15   }
16   
18   function save()
19   {
20         $baseobject= $this->by_object['faiPartitionTable'];
22         // cn=FAIBASE,ou=disk,ou=fai,ou=configs,ou=systems,dc=gonicus,dc=de
23         $new_dn= 'cn='.$baseobject->cn.",ou=disk,ou=fai,ou=configs,ou=systems,".$_SESSION['faifilter']['base'];
24         
25         // Old .. $new_dn= 'ou='.$baseobject->ou.','.$baseobject->base;
27         if ($this->dn != $new_dn && $this->dn != "new"){
28                 
29                 /* if( new_dn is subtree of this->dn ) */
30                 $cnt1 = count(split(",",$this->dn));
31                 $cnt2 = count(split(",",$new_dn));
32                 if((strstr($new_dn,$this->dn))&&($cnt1<$cnt2)){
33                         print_red(_("Try to move tree failed. Destination tree is subtree of source tree."));
34                 }else{
35                         $baseobject->recursive_move($this->dn, $new_dn);
36                 }
37         }
38         $this->dn= $new_dn;
40         tabs::save(TRUE);
41   }
43 }
45 ?>