Code

Mo-Mo-Mo-Monster Diff - Removed Department selection from managment list and all...
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 14 Apr 2008 13:31:39 +0000 (13:31 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 14 Apr 2008 13:31:39 +0000 (13:31 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10424 594d385d-05f5-0310-b6e9-bd551577e9d8

19 files changed:
gosa-plugins/fai/admin/fai/branch_selector.tpl
gosa-plugins/fai/admin/fai/class_askClassName.inc
gosa-plugins/fai/admin/fai/class_divListFai.inc
gosa-plugins/fai/admin/fai/class_faiHook.inc
gosa-plugins/fai/admin/fai/class_faiManagement.inc
gosa-plugins/fai/admin/fai/class_faiPackage.inc
gosa-plugins/fai/admin/fai/class_faiPartitionTable.inc
gosa-plugins/fai/admin/fai/class_faiProfile.inc
gosa-plugins/fai/admin/fai/class_faiProfileEntry.inc
gosa-plugins/fai/admin/fai/class_faiScript.inc
gosa-plugins/fai/admin/fai/class_faiTemplate.inc
gosa-plugins/fai/admin/fai/class_faiVariable.inc
gosa-plugins/fai/admin/fai/tabsHook.inc
gosa-plugins/fai/admin/fai/tabsPackage.inc
gosa-plugins/fai/admin/fai/tabsPartition.inc
gosa-plugins/fai/admin/fai/tabsProfile.inc
gosa-plugins/fai/admin/fai/tabsScript.inc
gosa-plugins/fai/admin/fai/tabsTemplate.inc
gosa-plugins/fai/admin/fai/tabsVariable.inc

index 67d4d0b4f888a8779f506bd06a02af01db3677c7..b5bac4656b64fe5a3c5782dfcb85f1410d394584 100644 (file)
@@ -6,8 +6,8 @@
      <tr>
       <td>
     {t}Current release{/t}&nbsp;
-    <select name="selectedBranch" onChange="document.mainform.submit();">
-        {html_options options=$branches selected=$selectedBranch}
+    <select name="fai_release" onChange="document.mainform.submit();">
+        {html_options output=$fai_releases values=$fai_releases selected=$fai_release}
     </select>
       </td>
      </tr>
                {t}Create new locked branch{/t}
     {/if}
 
-    {if $selectedBranch != "main" && $allow_remove}
+    {if $fai_release != $fai_base && $allow_remove}
     <br>
         <input class="center" type="image" name="remove_branch" src="images/lists/trash.png">
            <a href="?plug={$plug_id}&act=remove_branch">{t}Delete current release{/t}</a>
     {/if}
       </td>
      </tr>
-        </table>
+   </table>
    </div>
 <br>
 
index cde5eb96604a8d5a009b8b7ce150d78d8e171414..e409a868f98ac9015aad5d11f8a6ad9d90ddf2b5 100644 (file)
@@ -11,15 +11,13 @@ class askClassName extends plugin
   var $forbidden          = array();
   var $ClassName          = "";  
   var $ClassAlreadyExists = false;
+  var $parent;
 
   function askClassName (&$config,$dn,$ui,$objectClass)
   {
     $this->ui = $ui;
     $this->objectClass = $objectClass;
     plugin::plugin ($config, $dn);
-    if(!session::is_set('CurrentMainBase')){
-      session::set('CurrentMainBase',$this->config->current['BASE']);
-    }
   }
 
   function execute()
@@ -31,25 +29,16 @@ class askClassName extends plugin
     $smarty = get_smarty();
     $display= "";
 
-    /* The faifilter contais 
-     * The base for all fai objects 
-     */
-    $faifilter  = session::get('faifilter');
-
     /* First search for every ou, in given fai base
      * With a second search detect all object that belong to the different ous. 
      */
 
-    $base = get_ou('faiou').session::get('CurrentMainBase');
-    if($faifilter['branch'] != "main"){
-      $base = $faifilter['branch'];
-    }
+    $base = $this->parent->fai_release;
     $ldap = $this->config->get_ldap_link();
 
-
     $type_acl_mapping = array(
         "FAIpartitionTable"  => "faiPartitionTable",
-        "FAIpackageList"     => "faiPackage",
+        "FAIpackageList"     => "faiPackageList",
         "FAIscript"          => "faiScript",
         "FAIvariable"        => "faiVariable",
         "FAIhook"            => "faiHook",
index 2252fd92eca9c71211b60d3bbc09b29abc38f4c3..78009204429adc3ef0c8a940e663d593aa71385a 100644 (file)
@@ -2,12 +2,6 @@
 
 class divListFai extends MultiSelectWindow
 {
-  /* Current base */
-  var $selectedBase       = "";
-  var $selectedBranch     = "main";
-  var $AvailableBranches  = array();
-  var $departments        = array();
-
   /* Regex */
   var $Regex              = "*";
   var $ShowProfiles;
@@ -24,8 +18,6 @@ class divListFai extends MultiSelectWindow
   var $parent             ;
   var $ui                 ;
 
-  var $SaveAdditionalVars = array("selectedBranch");
-
   function divListFai (&$config,$parent)
   {
     MultiSelectWindow::MultiSelectWindow($config, "Fai", "fai");
@@ -33,14 +25,8 @@ class divListFai extends MultiSelectWindow
     $this->parent       = $parent;
     $this->ui           = get_userinfo();
 
-    /* Set default base */
-    if(!session::is_set('CurrentMainBase')){
-      session::set('CurrentMainBase',$this->config->current['BASE']);
-    }
-    $this->selectedBase  = session::get('CurrentMainBase');
-
     /* Set list strings */
-    $this->SetTitle(_("List of classes"));
+    $this->SetTitle(  _("List of classes"));
     $this->SetSummary(_("List of deployment classes and packages"));
 
     /* Result page will look like a headpage */
@@ -54,9 +40,6 @@ class divListFai extends MultiSelectWindow
 
     /* Dynamic action col, depending on snapshot icons */
     $action_col_size = 120;
-#   if($this->parent->snapshotEnabled()){
-#     $action_col_size += 32;
-#   }
 
     /* Toggle all selected / deselected */
     $chk = "<input type='checkbox' id='select_all' name='select_all'
@@ -97,11 +80,13 @@ class divListFai extends MultiSelectWindow
       $c = $this->config->search("faiManagement", "POSTCREATE",array('menu','tabs'));
 
       $smarty = get_smarty();
+      $releases = $this->parent->getBranches();
       $smarty->assign("allow_create", $c);
       $smarty->assign("allow_remove", $r);
-      $smarty->assign("selectedBranch",$this->selectedBranch);
+      $smarty->assign("fai_release" , $releases[$this->parent->fai_release]);
+      $smarty->assign("fai_base"    , $releases[$this->parent->fai_base]);
       $smarty->assign("branchimage","images/branch.png");
-      $smarty->assign("branches",$this->AvailableBranches);
+      $smarty->assign("fai_releases", $releases);
       $plug_id = 0;       
       if(isset($_GET['plug'])){
         $plug_id = $_GET['plug'];
@@ -114,66 +99,17 @@ class divListFai extends MultiSelectWindow
 
   function GenHeader()
   {
-    /* Prepare departments,
-       which are shown in the listbox on top of the listbox
-     */
-    $options= "";
-
     /* Get all departments within this subtree */
     $ui= get_userinfo();
     $first = "";
     $found = FALSE;
     $base = $this->config->current['BASE'];
 
-    /* Add base */
-    $tmp = array();
-    $tmp[] = array("dn"=>$this->config->current['BASE']);
-    $tmp=  array_merge($tmp,get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))", $this->module, $base,
-                    array("ou", "description"), GL_SIZELIMIT | GL_SUBSEARCH));
-
-    $deps = array();
-    foreach($tmp as $tm){
-      $deps[$tm['dn']] = $tm['dn'];
-    }
-
-    /* Load possible departments */
-    $ui= get_userinfo();
-    $tdeps= $ui->get_module_departments("fai");
-    $ids = $this->config->idepartments;
-    $first = "";
-    $found = FALSE;
-    foreach($ids as $dep => $name){
-      if(isset($deps[$dep]) && in_array_ics($dep, $tdeps)){
-
-        /* Keep first base dn in mind, we could need this
-         *  info if no valid base was found
-         */
-        if(empty($first)) {
-          $first = $dep['dn'];
-        }
-
-        $value = $ids[$dep];
-        if ($this->selectedBase == $dep){
-          $found = TRUE;
-          $options.= "<option selected='selected' value='".$dep."'>$value</option>";
-        } else {
-          $options.= "<option value='".$dep."'>$value</option>";
-        }
-      }
-    }
-
-    /* The currently used base is not visible with your acl setup.
-     * Set base to first useable base.
-     */
-    if(!$found){
-      $this->selectedBase = $first;
-    }
-
     /* Add seperator */
     $add_sep = false;
 
     /* Get complete fai acls, to be able to check if we must show or hide the snapshot abilities */ 
-    $acl_all = $ui->has_complete_category_acls($this->selectedBase,$this->module);
+    $acl_all = $ui->has_complete_category_acls($this->parent->fai_base,$this->module);
 
     /* Add default header */
     $listhead = MultiSelectWindow::get_default_header();
@@ -183,16 +119,11 @@ class divListFai extends MultiSelectWindow
       $listhead .=" <img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'>&nbsp;";
     }
 
-    $listhead .=  _("Base")."&nbsp;<select name='CurrentMainBase' onChange='mainform.submit()' class='center'>$options</select>".
-      " <input class='center' type='image' src='images/list_submit.png' align='middle'
-      title='"._("Submit department")."' name='submit_department' alt='".  _("Submit")."'>&nbsp;";
-
-
     $s  = ".|"._("Actions")."|\n";
     $s .= "..|<img src='images/list_new.png' alt='' border='0' class='center'>".
       "&nbsp;"._("Create")."|\n";
 
-    $acl = $ui->get_permissions($this->selectedBase,"fai/faiProfile");
+    $acl = $ui->get_permissions($this->parent->fai_base,"fai/faiProfile");
     if(preg_match("/c/",$acl)){
       $s.= "...|<input class='center' type='image' src='images/fai_new_profile.png' alt=''>".
         "&nbsp;"._("Profile")."|Create_profile|\n";
@@ -208,7 +139,7 @@ class divListFai extends MultiSelectWindow
         array("images/fai_new_packages.png"       , _("Package list")     ,"Create_package"   , _("PK") , "faiPackage"));
 
     foreach($arr as $ar){
-      $acl = $ui->get_permissions($this->selectedBase,"fai/".$ar[4]);
+      $acl = $ui->get_permissions($this->parent->fai_base,"fai/".$ar[4]);
       if(preg_match("/c/",$acl)){
         $s.= "...|<input class='center' type='image' src='".$ar[0]."' alt=''>".
           "&nbsp;".$ar[1]."|".$ar[2]."|\n";
@@ -319,7 +250,7 @@ class divListFai extends MultiSelectWindow
        /* Add copy & cut icons */
        $ui = get_userinfo();
        $action ="";
-       $acl_all = $ui->has_complete_category_acls($this->selectedBase,$this->module);
+       $acl_all = $ui->has_complete_category_acls($this->parent->fai_base,$this->module);
        if(preg_match("/(c.*w|w.*c)/",$acl_all) && $this->parent->CopyPasteHandler){
          $action .= "<input class='center' type='image'
            src='images/lists/cut.png' alt='"._("cut")."' name='cut_%KEY%' title='"._("Cut this entry")."'>&nbsp;";
@@ -408,9 +339,6 @@ class divListFai extends MultiSelectWindow
   {
     /* Save automatic created POSTs like regex, checkboxes */
     MultiSelectWindow::save_object(); 
-    $faifilter = session::get('faifilter');
-    $faifilter['branch'] = $this->selectedBranch; 
-    session::set('faifilter',$faifilter);
   }
 }
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
index b385e490d1b86397100a915683943d6587c18c06..92b43193cb2fc93412e98932af8ebbf0493ed604 100644 (file)
@@ -412,27 +412,20 @@ class faiHook extends plugin
    */
   function remove_from_parent()
   {
-    $ldap = $this->config->get_ldap_link();
-    $ldap->cd ($this->dn);
-
-    $faifilter = session::get('faifilter');
-    $use_dn = preg_replace("/".normalizePreg(FAI::get_release_dn($this->dn))."/i", $faifilter['branch'], $this->dn);
-    if($faifilter['branch'] == "main"){
-      $use_dn = $this->dn;
-    }
-
-    FAI::prepare_to_save_FAI_object($use_dn,array(),true);
-
-    new log("remove","fai/".get_class($this),$use_dn,$this->attributes);
+    if($this->acl_is_removeable()){
+      $ldap = $this->config->get_ldap_link();
+      $ldap->cd ($this->dn);
+      $release = $this->parent->parent->fai_release;
+      $use_dn = preg_replace("/".normalizePreg(FAI::get_release_dn($this->dn))."/i", $release, $this->dn);
+      new log("remove","fai/".get_class($this),$use_dn,$this->attributes);
+      FAI::prepare_to_save_FAI_object($use_dn,array(),true);
 
-    foreach($this->SubObjects as $name => $obj){
-      $use_dn = preg_replace("/".normalizePreg(FAI::get_release_dn($this->dn))."/i", $faifilter['branch'], $obj['dn']);
-      if($faifilter['branch'] == "main"){
-        $use_dn = $obj['dn'];
+      foreach($this->SubObjects as $name => $obj){
+        $use_dn = preg_replace("/".normalizePreg(FAI::get_release_dn($this->dn))."/i", $release, $obj['dn']);
+        FAI::prepare_to_save_FAI_object($use_dn,array(),true);
       }
-      FAI::prepare_to_save_FAI_object($use_dn,array(),true);
+      $this->handle_post_events("remove");
     }
-    $this->handle_post_events("remove");    
   }
 
 
@@ -460,12 +453,8 @@ class faiHook extends plugin
     /* Ensure that we do not overwrite an allready existing entry 
      */
     if($this->is_new){
-      $new_dn= 'cn='.$this->cn.",".get_ou('faihookou').get_ou('faiou').session::get('CurrentMainBase');
-      $faifilter = session::get('faifilter');
-      if($faifilter['branch']!="main"){
-        $new_dn ='cn='.$this->cn.",".get_ou('faihookou').$faifilter['branch'];
-      }
-
+      $release = $this->parent->parent->fai_release;
+      $new_dn= 'cn='.$this->cn.",".get_ou('faihookou').get_ou('faiou').$release;
       $res = faiManagement::check_class_name("FAIhook",$this->cn,$new_dn);
       if(isset($res[$this->cn])){
         $message[] = msgPool::duplicated(_("Name"));
index 34144831efa6e1486d16b9fa294a819a5f47486e..28c5a8337fb88ffa2fe3d51884a3428dbd025f3d 100644 (file)
@@ -44,13 +44,14 @@ class faiManagement extends plugin
   var $DivListFai;
   var $start_pasting_copied_objects = FALSE;
   var $CopyPasteHandler = FALSE;
-  var $base = "";
 
   /* Allow inserting of new elements if freezed releases 
   */
   var $allow_freeze_object_attach = FALSE;
 
   var $no_save;
+  var $fai_base     ="";
+  var $fai_release  ="";
 
        /* construction/reconstruction 
         */
@@ -65,9 +66,18 @@ class faiManagement extends plugin
     $this->DivListFai = new divListFai($this->config,$this);
 
     /* Copy & Paste handler */
-    if ($this->config->boolValueIsTrue("main", "enableCopyPaste")){
+    if ($this->config->boolValueIsTrue($this->fai_base, "enableCopyPaste")){
       $this->CopyPasteHandler= new CopyPasteHandler($this->config);
     }
+
+    /* Set default release */
+    $this->fai_base = get_ou("faiou")."ou=Direktorium,".$this->config->current['BASE'];
+    if(!session::is_set("fai_filter")){
+      session::set("fai_filter",array("fai_release" => $this->fai_base));
+    }
+
+    $fai_filter = session::get("fai_filter");
+    $this->fai_release = $fai_filter['fai_release'];
        }
 
        function execute()
@@ -75,6 +85,8 @@ class faiManagement extends plugin
     /* Call parent execute */
     plugin::execute();
 
+    print_a(array($this->fai_base,$this->fai_release));
+
     /* Initialise vars and smarty */
                $smarty         = get_smarty();
                $smarty->assign("BranchName","");
@@ -305,6 +317,7 @@ class faiManagement extends plugin
         if(preg_match("/d/",$acl)){
 
           $this->dialog = new $type[0]($this->config, $this->config->data['TABS'][$type[2]], $dn,"fai");
+          $this->dialog->parent = &$this;
           $this->dialog->set_acl_base($dn);
           $this->dialog->by_object[$type[1]]->remove_from_parent ();
           unset ($this->dialog);
@@ -377,6 +390,7 @@ class faiManagement extends plugin
 
           $this->dialog = new $type[0]($this->config,  $this->config->data['TABS'][$type[2]], $this->dn,"fai");
           $this->dialog->set_acl_base($this->dn);
+          $this->dialog->parent = &$this;
           $this->dialog->by_object[$type[1]]->remove_from_parent ();
           unset ($this->dialog);
           $this->dialog= FALSE;
@@ -419,7 +433,7 @@ class faiManagement extends plugin
                        add_lock ($this->dn, $this->ui->dn);
 
                        $this->dialog     = new $a_setup[0]($this->config,$this->config->data['TABS'][$a_setup[2]],$this->dn,"fai");
-
+      $this->dialog->parent = &$this;
       $this->dialog->set_acl_base($this->dn);
                        $this->is_dialog  = true;
 
@@ -441,7 +455,7 @@ class faiManagement extends plugin
     /* Remove branch 
      */
     if($s_action == "remove_branch"){
-      $base= $this->DivListFai->selectedBranch;
+      $base= $this->fai_release;
 
       /* Check if we have a post remove method configured
        *  else skip this operation. (Skip:Button in the ui should be disabled in this case too)
@@ -451,7 +465,7 @@ class faiManagement extends plugin
            we're allowed to remove this 'dn' */
         if($this->acl_is_removeable()){
 
-          $smarty->assign("info", msgPool::deleteInfo(@LDAP::fix($this->DivListFai->selectedBranch),_("FAI branch/freeze")));
+          $smarty->assign("info", msgPool::deleteInfo(@LDAP::fix($this->fai_release),_("FAI branch/freeze")));
           return($smarty->fetch(get_template_path('remove_branch.tpl',TRUE)));
         } else {
           msg_dialog::display(_("Permission error"), _("You have no permission to delete this release!"), ERROR_DIALOG);
@@ -471,7 +485,7 @@ class faiManagement extends plugin
        */
       if("" != $this->config->search("faiManagement", "POSTREMOVE",array('menu','tabs'))){
 
-        $bb =  $this->DivListFai->selectedBranch;
+        $bb =  $this->fai_release;
         if(!isset($ldap)){
           $ldap = $this->config->get_ldap_link();
         }
@@ -484,7 +498,7 @@ class faiManagement extends plugin
           $ldap->recursive_remove();
           $ldap->cd(preg_replace('/,'.normalizePreg(get_ou('faiou')).'/', ','.get_ou('applicationou'), $bb));
           $ldap->recursive_remove();
-          $this->DivListFai->selectedBranch = "main";
+          $this->fai_release = $this->fai_base;
 
           /* Post remove */
           $this->lock_name   = $name;
@@ -514,7 +528,7 @@ class faiManagement extends plugin
       $name = $_POST['BranchName'];
       $is_ok = true;
       $smarty->assign("BranchName",$name);
-      $base= get_ou('faiou').$this->DivListFai->selectedBase;
+      $base= $this->fai_base;
 
       /* Check used characters */
       if(preg_match("/[^0-9a-z \ö\ä\ü\.-_:,]/i",$name)){
@@ -523,7 +537,7 @@ class faiManagement extends plugin
       }
 
       /* Check if this name is already in use */
-      if(!$this->CheckNewBranchName($_POST['BranchName'],$this->DivListFai->selectedBranch)){
+      if(!$this->CheckNewBranchName($_POST['BranchName'],$this->fai_release)){
         msg_dialog::display(_("Error"), msgPool::duplicated(_("Name")), ERROR_DIALOG);
         $is_ok = false;
       }
@@ -569,17 +583,17 @@ class faiManagement extends plugin
         $ldap = $this->config->get_ldap_link();
 
         $baseToUse = $base;
-        if($this->DivListFai->selectedBranch != "main" ){
-          $baseToUse = $this->DivListFai->selectedBranch;
+        if($this->fai_release !=  $this->fai_base){
+          $baseToUse = $this->fai_release;
         }
 
         /* Create new Release name to be able to set faidebianRelease for FAIpackageList */
 
         $CurrentReleases  = $this->getBranches();
         $NewReleaseName   = $name;
-        if(isset($CurrentReleases[$this->DivListFai->selectedBranch])) {
-          if($this->DivListFai->selectedBranch != "main"){
-            $NewReleaseName = $CurrentReleases[$this->DivListFai->selectedBranch]."/".$name;
+        if(isset($CurrentReleases[$this->fai_release])) {
+          if($this->fai_release != $this->fai_base){
+            $NewReleaseName = $CurrentReleases[$this->fai_release]."/".$name;
             $NewReleaseName = preg_replace("#\/#","/",$NewReleaseName); 
           }else{
             $NewReleaseName   = $name;
@@ -616,7 +630,7 @@ class faiManagement extends plugin
 
         /* Duplicate group application releases 
          */
-        FAI::copy_FAI_group_releases($CurrentReleases[$this->DivListFai->selectedBranch],$name,$type);
+        FAI::copy_FAI_group_releases($CurrentReleases[$this->fai_release],$name,$type);
 
         /* Duplicate applications 
          */
@@ -737,9 +751,10 @@ class faiManagement extends plugin
                     "new_package"       =>  _("package list"));
 
     if(isset($types[$s_action])){
-      $acl = $this->ui->get_permissions($this->DivListFai->selectedBase,"fai/".$type_acl_mapping[$types[$s_action]]);
+      $acl = $this->ui->get_permissions($this->fai_base,"fai/".$type_acl_mapping[$types[$s_action]]);
       if(preg_match("/c/",$acl)){
         $this->dialog = new askClassName($this->config,$this->dn,$this->ui,$types[$s_action]);
+        $this->dialog->parent = &$this;
       }else{
         msg_dialog::display(_("Permission error"), sprintf(_("You have no permission to create a new %s!"), $types_i18n[$s_action]), ERROR_DIALOG);
       }
@@ -749,11 +764,12 @@ class faiManagement extends plugin
     if($s_action == "new_profile"){
       $this->dn = "new" ;
 
-      $acl = $this->ui->get_permissions($this->DivListFai->selectedBase,"fai/faiProfile");
+      $acl = $this->ui->get_permissions($this->fai_base,"fai/faiProfile");
       if(preg_match("/c/",$acl)){
         $a_setup= $this->get_type(array("objectClass"=>array("FAIprofile")));
         $this->dialog = new $a_setup[0]($this->config,$this->config->data['TABS'][$a_setup[2]],$this->dn,"fai");
         $this->dialog->set_acl_base($this->base);
+        $this->dialog->parent = &$this;
 
         $this->is_dialog = false;
       }else{
@@ -781,6 +797,7 @@ class faiManagement extends plugin
           $this->dialog = new $a_setup[0]($this->config,$this->config->data['TABS'][$a_setup[2]],$this->dn,"fai");
           $this->dialog->set_acl_base($this->base);
           $this->dialog->by_object[$a_setup[1]]->cn = $name;
+          $this->dialog->parent = &$this;
           $this->is_dialog = true;
         }
       }                
@@ -882,7 +899,7 @@ class faiManagement extends plugin
      ****************/
 
     /* Check if there is a snapshot dialog open */
-    $base = $this->DivListFai->selectedBase;
+    $base = $this->fai_base;
     if($str = $this->showSnapshotDialog($base,$this->get_used_snapshot_bases())){
       return($str);
     }
@@ -891,7 +908,6 @@ class faiManagement extends plugin
     $this->reload();
     $this->DivListFai->parent = $this;
     $this->DivListFai->execute();
-    $this->DivListFai->AddDepartments($this->DivListFai->selectedBase,4,1);
     $this->DivListFai->setEntries($this->objects);
     return($this->DivListFai->Draw());
        }
@@ -903,11 +919,7 @@ class faiManagement extends plugin
     $tmp = array();
     $types = array("faipartitionou","faiscriptou","faitemplateou","faihookou","faiprofileou","faivariableou","faipackageou");
     foreach($types as $type){
-      if($this->DivListFai->selectedBranch == "main"){
-        $tmp[] = get_ou($type).get_ou('faiou').$this->DivListFai->selectedBase;
-      }else{
-        $tmp[] = get_ou($type).$this->DivListFai->selectedBranch;
-      }
+      $tmp[] = get_ou($type).$this->fai_release;
     }
     return($tmp);
   }
@@ -916,10 +928,10 @@ class faiManagement extends plugin
   /* Get available branches for current base */
   function getBranches($base = false,$prefix = "")
   {
-    $ret = array("/"=>"main");
+    $ret = array("/"=>$this->fai_base);
     $ldap = $this->config->get_ldap_link();
     if(!$base){
-      $base = session::get('CurrentMainBase');
+      $base = $this->fai_base;
     }
     $tmp = FAI::get_all_releases_from_base($base,true);
     foreach($tmp as $dn => $name){
@@ -954,13 +966,13 @@ class faiManagement extends plugin
     $this->objects  = array();
 
     /* Get base */
-    $base = get_ou('faiou').$this->DivListFai->selectedBase;
-    if($this->DivListFai->selectedBranch != "main"){
+    $base = $this->fai_base;
+    if($this->fai_release != $this->fai_base){
       $br = $this->getBranches();
-      if(isset($br[$this->DivListFai->selectedBranch])){
-        $base = $this->DivListFai->selectedBranch;
+      if(isset($br[$this->fai_release])){
+        $base = $this->fai_release;
       }else{
-        $base = get_ou('faiou').$this->DivListFai->selectedBase;
+        $base = $this->fai_base;
       }
     }
     $this->base = $base;
@@ -1097,7 +1109,7 @@ class faiManagement extends plugin
 
   function CheckNewBranchName($name,$base)
   {
-    $f = $this->DivListFai->selectedBranch;
+    $f = $this->fai_release;
     if($name == ""){
       return(false);
     }elseif(in_array($name,$this->getBranches($f))) {
@@ -1112,6 +1124,16 @@ class faiManagement extends plugin
   {
     $this->DivListFai->save_object();
 
+    /* Get posted release */
+    $r_releases = array_flip($this->getBranches());
+    if(isset($_POST['fai_release']) && isset($r_releases[get_post('fai_release')])){
+      $this->fai_release = $r_releases[get_post('fai_release')];
+
+      $fai_filter = session::get("fai_filter");
+      $fai_filter['fai_release'] = $this->fai_release;
+      session::set("fai_filter",$fai_filter);
+    }
+
     if(is_object($this->CopyPasteHandler)){
       $this->CopyPasteHandler->save_object();
     }
@@ -1125,10 +1147,6 @@ class faiManagement extends plugin
       return("");
     }
 
-    $base = $this->DivListFai->selectedBranch;
-    if($base == "main"){
-      $base = $this->DivListFai->selectedBase;
-    }
 
     /* Add a single entry to queue */
     if($s_action == "cut" || $s_action == "copy"){
@@ -1175,7 +1193,6 @@ class faiManagement extends plugin
 
       /* Get dialog */
       $data = $this->CopyPasteHandler->execute();
-      $this->CopyPasteHandler->SetVar("base",$base);
 
       FAI::save_release_changes_now();
 
index 1814daf6f3275e359a797d847e7d9e6b5532a451..f7a8e9277dd0aaac3a934b90d7154c110fb7b5f0 100644 (file)
@@ -176,8 +176,8 @@ class faiPackage extends plugin
     if(!$this->is_account){
 
       /* Assemble release name */
-      $faifilter = session::get('faifilter');
-      $tmp= preg_replace('/,'.normalizePreg(get_ou('faiou')).'.*$/', '', $faifilter['branch']);
+      $release = $this->parent->parent->fai_release;
+      $tmp= preg_replace('/,'.normalizePreg(get_ou('faiou')).'.*$/', '', $release);
       $tmp= preg_replace('/ou=/', '', $tmp);
       $rev= array_reverse(split(',', $tmp));
       $this->FAIdebianRelease= "";
@@ -345,24 +345,14 @@ class faiPackage extends plugin
   {
     $ldap = $this->config->get_ldap_link();
     $ldap->cd ($this->dn);
-
-    $faifilter = session::get('faifilter');
-    $use_dn = preg_replace("/".normalizePreg(FAI::get_release_dn($this->dn))."/i", $faifilter['branch'], $this->dn);
-    if($faifilter['branch'] == "main"){
-      $use_dn = $this->dn;
-    }
-
+    $release = $this->parent->parent->fai_release;
+    $use_dn = preg_replace("/".normalizePreg(FAI::get_release_dn($this->dn))."/i", $release, $this->dn);
     FAI::prepare_to_save_FAI_object($use_dn,array(),true);
-
     new log("remove","fai/".get_class($this),$use_dn,$this->attributes);
-
     foreach($this->ConfiguredPackages as $pkgname => $attrs){
       foreach($attrs as $name => $attr){
         $pkgdn =  "FAIvariable=".$name.",".$this->dn;
-        $use_dn = preg_replace("/".normalizePreg(FAI::get_release_dn($this->dn))."/i", $faifilter['branch'], $pkgdn);
-        if($faifilter['branch'] == "main"){
-          $use_dn = $obj['dn'];
-        }
+        $use_dn = preg_replace("/".normalizePreg(FAI::get_release_dn($this->dn))."/i", $release, $pkgdn);
         FAI::prepare_to_save_FAI_object($use_dn,array(),true);
       }
     }
@@ -398,12 +388,8 @@ class faiPackage extends plugin
     /* Ensure that we do not overwrite an allready existing entry 
      */
     if($this->is_new){
-      $new_dn= 'cn='.$this->cn.",".get_ou('faipackageou').get_ou('faiou').session::get('CurrentMainBase');
-      $faifilter = session::get('faifilter');
-      if($faifilter['branch']!="main"){
-        $new_dn ='cn='.$this->cn.",".get_ou('faipackageou').$faifilter['branch'];
-      }
-
+      $release = $this->parent->parent->fai_filter;
+      $new_dn= 'cn='.$this->cn.",".get_ou('faipackageou').get_ou('faiou').$release;
       $res = faiManagement::check_class_name("FAIpackageList",$this->cn,$new_dn);
       if(isset($res[$this->cn])){
         $message[] = msgPool::duplicated(_("Name"));
@@ -476,8 +462,9 @@ class faiPackage extends plugin
 
     /* Assemble release name */
     if($this->FAIdebianRelease == "ClearFromCopyPaste"){
-      $faifilter = session::get('faifilter');
-      $tmp= preg_replace('/,'.normalizePreg(get_ou('faiou')).'.*$/', '', $faifilter['branch']);
+
+      $current_release  = $this->parent->parent->fai_release;
+      $tmp= preg_replace('/,'.normalizePreg(get_ou('faiou')).'.*$/', '', $current_release);
       $tmp= preg_replace('/ou=/', '', $tmp);
       $rev= array_reverse(split(',', $tmp));
       $this->FAIdebianRelease= "";
index c721a8ed73eb40ff52052423d4f83d480cc9a92a..8d848e77b2098430c4fbb364b298b4ed79d9f5b4 100644 (file)
@@ -344,32 +344,18 @@ class faiPartitionTable extends plugin
     $ldap = $this->config->get_ldap_link();
     $ldap->cd ($this->dn);
 
-    $faifilter = session::get('faifilter');
-    $use_dn = preg_replace("/".normalizePreg(FAI::get_release_dn($this->dn))."/i", $faifilter['branch'], $this->dn);
-    if($faifilter['branch'] == "main"){
-      $use_dn = $this->dn;
-    }
+    $release = $this->parent->parent->fai_release;
+    $use_dn = preg_replace("/".normalizePreg(FAI::get_release_dn($this->dn))."/i", $release, $this->dn);
 
     FAI::prepare_to_save_FAI_object($use_dn,array(),true);
-
     new log("remove","fai/".get_class($this),$use_dn,$this->attributes);   
     foreach($this->disks as $disk){
-
       $disk_dn = "cn=".$disk['cn'].",".$this->dn;
-      $use_dn = preg_replace("/".normalizePreg(FAI::get_release_dn($this->dn))."/i", $faifilter['branch'], $disk_dn);
-      if($faifilter['branch'] == "main"){
-        $use_dn = $disk_dn;
-      }
+      $use_dn = preg_replace("/".normalizePreg(FAI::get_release_dn($this->dn))."/i",$release, $disk_dn);
       FAI::prepare_to_save_FAI_object($use_dn,array(),true);
-
       foreach($disk['partitions'] as $key => $partition){    
-     
         $partition_dn= "FAIpartitionNr=".$partition['FAIpartitionNr'].",".$disk_dn;      
-        $use_dn = preg_replace("/".normalizePreg(FAI::get_release_dn($this->dn))."/i", $faifilter['branch'], $partition_dn);
-        if($faifilter['branch'] == "main"){
-          $use_dn = $disk_dn;
-        }
+        $use_dn = preg_replace("/".normalizePreg(FAI::get_release_dn($this->dn))."/i", $release, $partition_dn);
         FAI::prepare_to_save_FAI_object($use_dn,array(),true);
       }
     }
@@ -399,12 +385,8 @@ class faiPartitionTable extends plugin
     /* Ensure that we do not overwrite an allready existing entry 
      */
     if($this->is_new){
-      $new_dn= 'cn='.$this->cn.",".get_ou('faipartitionou').get_ou('faiou').session::get('CurrentMainBase');
-      $faifilter = session::get('faifilter');
-      if($faifilter['branch']!="main"){
-        $new_dn ='cn='.$this->cn.",".get_ou('faipartitionou').$faifilter['branch'];
-      }
-
+      $release = $this->parent->parent->fai_filter;
+      $new_dn= 'cn='.$this->cn.",".get_ou('faipartitionou').get_ou('faiou').$release;
       $res = faiManagement::check_class_name("FAIpartitionTable",$this->cn,$new_dn);
       if(isset($res[$this->cn])){
         $message[] = msgPool::duplicated(_("Name"));
index 83a57eddb1be385860d82f3acbfb69ccc02a51c8..cb71d0d06479ccbdf14f17d3104ad9bea38b537c 100644 (file)
@@ -363,13 +363,8 @@ class faiProfile extends plugin
   {
     $ldap = $this->config->get_ldap_link();
     $ldap->cd ($this->dn);
-
-    $faifilter = session::get('faifilter');
-    $use_dn = preg_replace("/".normalizePreg(FAI::get_release_dn($this->dn))."/i", $faifilter['branch'], $this->dn);
-    if($faifilter['branch'] == "main"){
-      $use_dn = $this->dn;
-    }
-
+    $release = $this->parent->parent->fai_release;
+    $use_dn = preg_replace("/".normalizePreg(FAI::get_release_dn($this->dn))."/i", $release, $this->dn);
     new log("remove","fai/".get_class($this),$use_dn,$this->attributes);
     FAI::prepare_to_save_FAI_object($use_dn,array(),true);
     $this->handle_post_events("remove");    
@@ -401,11 +396,8 @@ class faiProfile extends plugin
     /* Ensure that we do not overwrite an allready existing entry 
      */
     if($this->dn == "new" || $this->cn != $this->old_cn){
-      $new_dn= 'cn='.$this->cn.",".get_ou('faiprofileou').get_ou('faiou').session::get('CurrentMainBase');
-      $faifilter = session::get('faifilter');
-      if($faifilter['branch']!="main"){
-        $new_dn ='cn='.$this->cn.",".get_ou('faiprofileou').$faifilter['branch'];
-      }
+      $release = $this->parent->parent->fai_filter;
+      $new_dn= 'cn='.$this->cn.",".get_ou('faiprofileou').get_ou('faiou').$release;
       $res = faiManagement::check_class_name("FAIprofile",$this->cn,$new_dn);
       if(isset($res[$this->cn])){
         $message[] = msgPool::duplicated(_("Name"));
index d15526631cb65faa85ae77e529b1e36ff507c415..86ca1c6b2227ca239c426ffe6088bde804d81a2f 100644 (file)
@@ -16,12 +16,8 @@ class faiProfileEntry extends plugin
     plugin::plugin ($config, $dn);
 
     /* Search only in fai tree */
-    $base = get_ou('faiou').session::get('CurrentMainBase');
-    $faifilter = session::get('faifilter');
-    if($faifilter['branch']!="main"){
-      $base = $faifilter['branch'];
-    }
-  
+    $base = $this->parent->parent->fai_release; 
     $this->ui = get_userinfo();
 
     $filter = "(|(objectClass=FAIscript)(objectClass=FAItemplate)(objectClass=FAIhook)".
index 500dddb0af8aa82b4e2420bd4e74fb13d73706e5..e15c840a4ed6348804c4bc8c47204673de388251 100644 (file)
@@ -451,21 +451,13 @@ class faiScript extends plugin
     if($this->acl_is_removeable()){
       $ldap = $this->config->get_ldap_link();
       $ldap->cd ($this->dn);
-      $faifilter = session::get('faifilter');
-      $use_dn = preg_replace("/".normalizePreg(FAI::get_release_dn($this->dn))."/i", $faifilter['branch'], $this->dn);
-      if($faifilter['branch'] == "main"){
-        $use_dn = $this->dn;
-      }
-   
+      $release = $this->parent->parent->fai_release;
+      $use_dn = preg_replace("/".normalizePreg(FAI::get_release_dn($this->dn))."/i", $release, $this->dn);
       new log("remove","fai/".get_class($this),$use_dn,$this->attributes);
       FAI::prepare_to_save_FAI_object($use_dn,array(),true);
-      
       foreach($this->SubObjects as $name => $obj){
-        $use_dn = preg_replace("/".normalizePreg(FAI::get_release_dn($this->dn))."/i", $faifilter['branch'], $obj['dn']);
-        if($faifilter['branch'] == "main"){
-          $use_dn = $obj['dn'];
-        }
+        $use_dn = preg_replace("/".normalizePreg(FAI::get_release_dn($this->dn))."/i", $release, $obj['dn']);
         FAI::prepare_to_save_FAI_object($use_dn,array(),true);
       }
       $this->handle_post_events("remove");
@@ -509,12 +501,8 @@ class faiScript extends plugin
     /* Ensure that we do not overwrite an allready existing entry 
      */
     if($this->is_new){
-      $new_dn= 'cn='.$this->cn.",".get_ou('faiscriptou').get_ou('faiou').session::get('CurrentMainBase');
-      $faifilter = session::get('faifilter');
-      if($faifilter['branch']!="main"){
-        $new_dn ='cn='.$this->cn.",".get_ou('faiscriptou').$faifilter['branch'];
-      }
-
+      $release = $this->parent->parent->fai_release;
+      $new_dn= 'cn='.$this->cn.",".get_ou('faiscriptou').get_ou('faiou').$release;
       $res = faiManagement::check_class_name("FAIscript",$this->cn,$new_dn);
       if(isset($res[$this->cn])){
         $message[] = msgPool::duplicated(_("Name"));
index 7ea9a836befe4cb641f8e529647b32c37aa6c773..d0cc63c2bdc6c2fd5e50fbfc11cea406dfdc2cd0 100644 (file)
@@ -395,26 +395,20 @@ class faiTemplate extends plugin
    */
   function remove_from_parent()
   {
-    $ldap = $this->config->get_ldap_link();
-    $ldap->cd ($this->dn);
-
-    $faifilter = session::get('faifilter');
-    $use_dn = preg_replace("/".normalizePreg(FAI::get_release_dn($this->dn))."/i", $faifilter['branch'], $this->dn);
-    if($faifilter['branch'] == "main"){
-      $use_dn = $this->dn;
-    }
-
-    FAI::prepare_to_save_FAI_object($use_dn,array(),true);
-    new log("remove","fai/".get_class($this),$use_dn,$this->attributes);
+    if($this->acl_is_removeable()){
+      $ldap = $this->config->get_ldap_link();
+      $ldap->cd ($this->dn);
+      $release = $this->parent->parent->fai_release;
+      $use_dn = preg_replace("/".normalizePreg(FAI::get_release_dn($this->dn))."/i", $release, $this->dn);
+      new log("remove","fai/".get_class($this),$use_dn,$this->attributes);
+      FAI::prepare_to_save_FAI_object($use_dn,array(),true);
 
-    foreach($this->SubObjects as $name => $obj){
-      $use_dn = preg_replace("/".normalizePreg(FAI::get_release_dn($this->dn))."/i", $faifilter['branch'], $obj['dn']);
-      if($faifilter['branch'] == "main"){
-        $use_dn = $obj['dn'];
+      foreach($this->SubObjects as $name => $obj){
+        $use_dn = preg_replace("/".normalizePreg(FAI::get_release_dn($this->dn))."/i", $release, $obj['dn']);
+        FAI::prepare_to_save_FAI_object($use_dn,array(),true);
       }
-      FAI::prepare_to_save_FAI_object($use_dn,array(),true);
+      $this->handle_post_events("remove");
     }
-    $this->handle_post_events("remove");    
   }
 
 
@@ -437,12 +431,8 @@ class faiTemplate extends plugin
     /* Ensure that we do not overwrite an allready existing entry 
      */
     if($this->is_new){
-      $new_dn= 'cn='.$this->cn.",".get_ou('faitemplateou').get_ou('faiou').session::get('CurrentMainBase');
-      $faifilter = session::get('faifilter');
-      if($faifilter['branch']!="main"){
-        $new_dn ='cn='.$this->cn.",".get_ou('faitemplateou').$faifilter['branch'];
-      }
-
+      $release = $this->parent->parent->fai_release;
+      $new_dn= 'cn='.$this->cn.",".get_ou('faitemplateou').get_ou('faiou').$release;
       $res = faiManagement::check_class_name("FAItemplate",$this->cn,$new_dn);
       if(isset($res[$this->cn])){
         $message[] = msgPool::duplicated(_("Name"));
index af021e7df6f56bf174515bf4b28220171991bdb9..3e026af041aeb22922a7aca40e522c8dd66b6bd4 100644 (file)
@@ -282,21 +282,13 @@ class faiVariable extends plugin
     if($this->acl_is_removeable()){
       $ldap = $this->config->get_ldap_link();
       $ldap->cd ($this->dn);
-
-      $faifilter = session::get('faifilter');
-      $use_dn = preg_replace("/".normalizePreg(FAI::get_release_dn($this->dn))."/i", $faifilter['branch'], $this->dn);
-      if($faifilter['branch'] == "main"){
-        $use_dn = $this->dn;
-      }
-  
-      FAI::prepare_to_save_FAI_object($use_dn,array(),true);
+      $release = $this->parent->parent->fai_release;
+      $use_dn = preg_replace("/".normalizePreg(FAI::get_release_dn($this->dn))."/i", $release, $this->dn);
       new log("remove","fai/".get_class($this),$use_dn,$this->attributes);
+      FAI::prepare_to_save_FAI_object($use_dn,array(),true);
 
       foreach($this->SubObjects as $name => $obj){
-        $use_dn = preg_replace("/".normalizePreg(FAI::get_release_dn($this->dn))."/i", $faifilter['branch'], $obj['dn']);
-        if($faifilter['branch'] == "main"){
-          $use_dn = $obj['dn'];
-        }
+        $use_dn = preg_replace("/".normalizePreg(FAI::get_release_dn($this->dn))."/i", $release, $obj['dn']);
         FAI::prepare_to_save_FAI_object($use_dn,array(),true);
       }
       $this->handle_post_events("remove");
@@ -328,12 +320,8 @@ class faiVariable extends plugin
     /* Ensure that we do not overwrite an allready existing entry 
      */
     if($this->is_new){
-      $new_dn= 'cn='.$this->cn.",".get_ou('faivariableou').get_ou('faiou').session::get('CurrentMainBase');
-      $faifilter = session::get('faifilter');
-      if($faifilter['branch']!="main"){
-        $new_dn ='cn='.$this->cn.",".get_ou('faivariableou').$faifilter['branch'];
-      }
-
+      $release = $this->parent->parent->fai_filter;
+      $new_dn= 'cn='.$this->cn.",".get_ou('faivariableou').get_ou('faiou').$release;
       $res = faiManagement::check_class_name("FAIvariable",$this->cn,$new_dn);
       if(isset($res[$this->cn])){
         $message[] = msgPool::duplicated(_("Name"));
index ad41dbdf84e1e1aea0e284e3b2877faccba40243..7b0859fb62ac06a426c9c3f4797aff1cccb7e96c 100644 (file)
@@ -3,6 +3,7 @@
 class tabsHook extends tabs
 {
   var $base= "";
+  var $parent;
 
   function tabsHook($config, $data, $dn,$category)
   {
@@ -20,12 +21,7 @@ class tabsHook extends tabs
   function save($ignore_account= FALSE)
   {
        $baseobject= $this->by_object['faiHook'];
-
-       $new_dn= 'cn='.$baseobject->cn.",".get_ou('faihookou').get_ou('faiou').session::get('CurrentMainBase');
-       $faifilter = session::get('faifilter'); 
-       if($faifilter['branch']!="main"){
-               $new_dn ='cn='.$baseobject->cn.",".get_ou('faihookou').$faifilter['branch'];
-       }
+       $new_dn ='cn='.$baseobject->cn.",".get_ou('faihookou').$this->parent->fai_release;
 
        if ($this->dn != $new_dn && $this->dn != "new"){
                
index 197f86370caf39ce737a247e10cbf2c0e90bd435..e3101d4f484e22ca5d237e354863692456a4b5cd 100644 (file)
@@ -3,6 +3,7 @@
 class tabsPackage extends tabs
 {
   var $base= "";
+  var $parent;
 
   function tabsPackage($config, $data, $dn,$category)
   {
@@ -21,14 +22,7 @@ class tabsPackage extends tabs
   function save($ignore_account= FALSE)
   {
        $baseobject= $this->by_object['faiPackage'];
-
-       $new_dn= 'cn='.$baseobject->cn.",".get_ou('faipackageou').get_ou('faiou').session::get('CurrentMainBase');
-
-       $faifilter = session::get('faifilter');
-
-       if($faifilter['branch']!="main"){
-               $new_dn ='cn='.$baseobject->cn.",".get_ou('faipackageou').$faifilter['branch'];
-       }
+       $new_dn ='cn='.$baseobject->cn.",".get_ou('faipackageou').$this->parent->fai_release;
                        
        if ($this->dn != $new_dn && $this->dn != "new"){
                
index b1aab1e09bbf2a946996d0497beb9d6f7ff2356c..33cb80ba8a184d2c088f044c500a22333312a22e 100644 (file)
@@ -3,6 +3,7 @@
 class tabsPartition extends tabs
 {
   var $base= "";
+  var $parent;
 
   function tabsPartition($config, $data, $dn,$category)
   {
@@ -22,12 +23,7 @@ class tabsPartition extends tabs
   {
        $baseobject= $this->by_object['faiPartitionTable'];
 
-       $new_dn= 'cn='.$baseobject->cn.",".get_ou('faipartitionou').get_ou('faiou').session::get('CurrentMainBase');
-
-       $faifilter = session::get('faifilter'); 
-       if($faifilter['branch']!="main"){
-               $new_dn ='cn='.$baseobject->cn.",".get_ou('faipartitionou').$faifilter['branch'];
-       }
+       $new_dn ='cn='.$baseobject->cn.",".get_ou('faipartitionou').$this->parent->fai_release;
 
        if ($this->dn != $new_dn && $this->dn != "new"){
                
index 64fc7025c1aa74b4d5773c0a5e8beb9edebbe6e0..6dea9226d83eb444c6cb620977234f46705231e1 100644 (file)
@@ -3,6 +3,7 @@
 class tabsProfile extends tabs
 {
   var $base= "";
+  var $parent;
 
   function tabsProfile($config, $data, $dn,$category)
   {
@@ -21,13 +22,7 @@ class tabsProfile extends tabs
   function save($ignore_account= FALSE)
   {
        $baseobject= $this->by_object['faiProfile'];
-
-       $new_dn= 'cn='.$baseobject->cn.",".get_ou('faiprofileou').get_ou('faiou').session::get('CurrentMainBase');
-
-       $faifilter = session::get('faifilter');
-       if($faifilter['branch']!="main"){
-               $new_dn ='cn='.$baseobject->cn.",".get_ou('faiprofileou').$faifilter['branch'];
-       }
+       $new_dn ='cn='.$baseobject->cn.",".get_ou('faiprofileou').$this->parent->fai_release;
                        
        if ($this->dn != $new_dn && $this->dn != "new"){
                
index 01cafc149cd0b38251ae2afd5f7100bb5d315aaf..3c5059b907bfb0f559d9dcc0cc9c39cf6ea29e68 100644 (file)
@@ -3,6 +3,7 @@
 class tabsScript extends tabs
 {
   var $base= "";
+  var $parent;
 
   function tabsScript($config, $data, $dn,$category)
   {
@@ -21,14 +22,7 @@ class tabsScript extends tabs
   function save($ignore_account= FALSE)
   {
        $baseobject= $this->by_object['faiScript'];
-
-       $new_dn= 'cn='.$baseobject->cn.",".get_ou('faiscriptou').get_ou('faiou').session::get('CurrentMainBase');
-
-       $faifilter = session::get('faifilter');
-
-       if($faifilter['branch']!="main"){
-               $new_dn ='cn='.$baseobject->cn.",".get_ou('faiscriptou').$faifilter['branch'];
-       }
+       $new_dn ='cn='.$baseobject->cn.",".get_ou('faiscriptou').$this->parent->fai_release;
        
        if ($this->dn != $new_dn && $this->dn != "new"){
                
index 3c8576e3c9a9e1a40a8fc4c974f13f1e77a4707a..6e9150812491fee21b95a170c62be872de501ede 100644 (file)
@@ -3,6 +3,7 @@
 class tabsTemplate extends tabs
 {
   var $base= "";
+  var $parent;
 
   function tabsTemplate($config, $data, $dn,$category)
   {
@@ -21,13 +22,7 @@ class tabsTemplate extends tabs
   function save($ignore_account= FALSE)
   {
        $baseobject= $this->by_object['faiTemplate'];
-
-       $new_dn= 'cn='.$baseobject->cn.",".get_ou('faitemplateou').get_ou('faiou').session::get('CurrentMainBase');
-
-       $faifilter = session::get('faifilter');
-       if($faifilter['branch']!="main"){
-               $new_dn ='cn='.$baseobject->cn.",".get_ou('faitemplateou').$faifilter['branch'];
-       }
+       $new_dn ='cn='.$baseobject->cn.",".get_ou('faitemplateou').$this->parent->fai_release;
 
        if ($this->dn != $new_dn && $this->dn != "new"){
                
index 0a4dcfbc6e9de0d95e4fd08beb81426354eefaf9..1e05c873204c1fc71bd10e771a532def3dbd953e 100644 (file)
@@ -3,6 +3,7 @@
 class tabsVariable extends tabs
 {
   var $base= "";
+  var $parent;
 
   function tabsVariable($config, $data, $dn,$category)
   {
@@ -21,14 +22,7 @@ class tabsVariable extends tabs
   function save($ignore_account= FALSE)
   {
        $baseobject= $this->by_object['faiVariable'];
-
-       $new_dn= 'cn='.$baseobject->cn.",".get_ou('faivariableou').get_ou('faiou').session::get('CurrentMainBase');
-
-       $faifilter = session::get('faifilter');
-       
-       if($faifilter['branch']!="main"){
-               $new_dn ='cn='.$baseobject->cn.",".get_ou('faivariableou').$faifilter['branch'];
-       }
+       $new_dn ='cn='.$baseobject->cn.",".get_ou('faivariableou').$this->parent->fai_release;
                        
        if ($this->dn != $new_dn && $this->dn != "new"){