Code

Added environment to ogroup tabs
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 25 Jun 2007 07:27:08 +0000 (07:27 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 25 Jun 2007 07:27:08 +0000 (07:27 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@6672 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/ogroups/tabs_ogroups.inc

index d343ddb5e1618e9604ba1cb4aaebfbc833f953f2..8fa60234bcf77398408708c45a5d2830094902e2 100644 (file)
@@ -127,7 +127,23 @@ class ogrouptabs extends tabs
       unset($this->by_name['appgroup']);
       unset($this->by_object['appgroup']);
     }  
-  
+    /* Add environment tab if user or group is member in this object group*/ 
+    if((preg_match("/G/",$objects) || preg_match("/U/",$objects)) && !isset($this->by_name['environment'])){
+      $this->by_name['environment']= _("Environment");
+      $this->by_object['environment']= new environment($this->config, $this->dn);
+      $this->by_object['environment']->acl = "#all#";
+      $this->by_object['environment']->parent= &$this;
+    }
+
+    /* Remove environment tab if not required any longer */
+    if(!preg_match("/G/",$objects) && !preg_match("/U/",$objects) && isset($this->by_name['environment'])){
+      $this->by_object['environment']->remove_from_parent();
+      unset($this->by_name['environment']);
+      unset($this->by_object['environment']);
+    }  
+
  
     /* Move reference tab to last position*/
     if(isset($this->by_name['reference'])){