cf4f2b910ca1a70ce2d981837ed8442700b7d880
1 <?php
3 class tabsVariable extends tabs
4 {
5 var $base= "";
7 function tabsVariable($config, $data, $dn)
8 {
9 tabs::tabs($config, $data, $dn);
10 }
12 function check()
13 {
14 return (tabs::check(TRUE));
15 }
18 function save()
19 {
20 $baseobject= $this->by_object['faiVariable'];
22 $branch = "";
23 if($_SESSION['faifilter']['branch']!="main"){
24 $branch = "ou=".$_SESSION['faifilter']['branch'].",";
25 }
27 $new_dn= 'cn='.$baseobject->cn.",ou=variables,".$branch."ou=fai,ou=configs,ou=systems,".$_SESSION['faifilter']['base'];
29 if ($this->dn != $new_dn && $this->dn != "new"){
31 /* if( new_dn is subtree of this->dn ) */
32 $cnt1 = count(split(",",$this->dn));
33 $cnt2 = count(split(",",$new_dn));
34 if((strstr($new_dn,$this->dn))&&($cnt1<$cnt2)){
35 print_red(_("Try to move tree failed. Destination tree is subtree of source tree."));
36 }else{
37 $baseobject->recursive_move($this->dn, $new_dn);
38 }
39 }
40 $this->dn= $new_dn;
42 tabs::save(TRUE);
43 }
45 }
47 ?>