Code

Updated get_ou it receives values from the config registry now.
[gosa.git] / gosa-plugins / fai / admin / fai / tabsProfile.inc
1 <?php
3 class tabsProfile extends tabs
4 {
5   var $base= "";
6   var $parent ="";
8   function tabsProfile($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['faiProfile'];
25         $new_dn ='cn='.$baseobject->cn.",".get_ou("faiProfile", "faiProfileRDN").$this->parent->fai_release;
26                         
27         if ($this->dn != $new_dn && $this->dn != "new"){
28                 
29                 /* if( new_dn is subtree of this->dn ) */
30                 $cnt1 = count(explode(",",$this->dn));
31                 $cnt2 = count(explode(",",$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 ?>