Code

Added some group acls
[gosa.git] / plugins / admin / applications / tabs_application.inc
index c884fed956e29cc902f3d68e33ad525cbc1e613b..594b057352c23f8b4c311229f80f2cba0c23c8f5 100644 (file)
@@ -2,36 +2,61 @@
 
 class apptabs extends tabs
 {
+  var $Release= "";
 
   function apptabs($config, $data, $dn)
   {
-       tabs::tabs($config, $data, $dn);
+    tabs::tabs($config, $data, $dn);
+
+    /* Add references/acls/snapshots */
+    $this->addSpecialTabs();
   }
 
-  function save()
+  function set_release($newRelease)
   {
-       $baseobject= $this->by_object['application'];
-
-       /* Check for new 'dn', in order to propagate the
-          'dn' to all plugins */
-       $new_dn= "cn=".$baseobject->cn.",ou=apps,".$baseobject->base;
-
-        /* Move group? */
-        if ($this->dn != $new_dn){
-
-                /* Write entry on new 'dn' */
-                if ($this->dn != "new"){
-                        $baseobject->move($this->dn, $new_dn);
-                        $this->by_object['application']= $baseobject;
-                }
-
-                /* Happen to use the new one */
-                $this->dn= $new_dn;
-        }
+    $this->Release= preg_replace('/,ou=apps,.*$/', '', $newRelease);
+    if ($this->Release != ""){
+      $this->Release= ",".$this->Release;
+    }
+  }
 
-       tabs::save();
+  function save()
+  {
+    $baseobject= $this->by_object['application'];
+
+    /* Check for new 'dn', in order to propagate the
+       'dn' to all plugins */
+    $tmp = search_config($this->config->data,"faiManagement","CLASS");
+    if((!empty($tmp)) && (isset($_SESSION['appfilter']['release']))){
+      if(!$baseobject->isReleaseApplikation){
+        $new_dn= "cn=".$baseobject->cn.",ou=apps,".$baseobject->base;
+      }else{
+        $new_dn ="cn=".$baseobject->cn.",".$_SESSION['appfilter']['release'];
+      }
+    }else{
+      $new_dn= "cn=".$baseobject->cn.",ou=apps,".$baseobject->base;
+    }
+
+    /* Move group? */
+    if ($this->dn != $new_dn){
+
+      /* Write entry on new 'dn' */
+      if ($this->dn != "new"){
+        $baseobject->move($this->dn, $new_dn);
+        $this->by_object['application']= $baseobject;
+      }
+
+      /* Happen to use the new one */
+      $this->dn= $new_dn;
+    }
+
+    tabs::save();
+
+    /* Fix tagging if needed */
+    $baseobject->dn= $this->dn;
+    $baseobject->handle_object_tagging();
   }
 
 }
-
+// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
 ?>