Code

Apply fix for #4170
[gosa.git] / trunk / gosa-plugins / fai / admin / fai / tabsTemplate.inc
1 <?php
3 class tabsTemplate extends tabs
4 {
5   var $base= "";
6   var $parent ="";
8   function tabsTemplate($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['faiTemplate'];
25         $new_dn ='cn='.$baseobject->cn.",".get_ou('faiTemplateRDN').$this->parent->fai_release;
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                         msg_dialog::display(_("Error"), _("Moving the tree failed. Destination tree is subtree of source tree."), ERROR_DIALOG);
34                 }else{
35 //                      $baseobject->recursive_move($this->dn, $new_dn);
36                 }
37         }
38         $this->dn= $new_dn;
40         tabs::save(TRUE);
41   }
43 }
45 ?>