1 <?php
3 class tabsHook extends tabs
4 {
5 var $base= "";
7 function tabsHook($config, $data, $dn,$category)
8 {
9 tabs::tabs($config, $data, $dn,$category);
10 /* Add references/acls/snapshots */
11 $this->addSpecialTabs();
12 }
14 function check($ignore_account= FALSE)
15 {
16 return (tabs::check(TRUE));
17 }
20 function save($ignore_account= FALSE)
21 {
22 $baseobject= $this->by_object['faiHook'];
24 $new_dn= 'cn='.$baseobject->cn.",ou=hooks,ou=fai,ou=configs,ou=systems,".$_SESSION['CurrentMainBase'];
26 if($_SESSION['faifilter']['branch']!="main"){
27 $new_dn ='cn='.$baseobject->cn.",ou=hooks,".$_SESSION['faifilter']['branch'];
28 }
30 if ($this->dn != $new_dn && $this->dn != "new"){
32 /* if( new_dn is subtree of this->dn ) */
33 $cnt1 = count(split(",",$this->dn));
34 $cnt2 = count(split(",",$new_dn));
35 if((strstr($new_dn,$this->dn))&&($cnt1<$cnt2)){
36 print_red(_("Try to move tree failed. Destination tree is subtree of source tree."));
37 }else{
38 // $baseobject->recursive_move($this->dn, $new_dn);
39 }
40 }
41 $this->dn= $new_dn;
43 tabs::save(TRUE);
44 }
46 }
48 ?>