Code

Updated copy & paste acls, centralized checks
[gosa.git] / gosa-core / plugins / admin / ogroups / tabs_ogroups.inc
index 843b5452e9a8110ed9293a1ad03a0368a3db1f61..47af9e79ae6ac30f61ecf813c05d62316ca23f65 100644 (file)
@@ -179,25 +179,6 @@ class ogrouptabs extends tabs
       }
     }
 
-    /* Add application tab if user or group is member in this object group*/
-    if(class_available("appgroup")){
-      if((preg_match("/G/",$objects) || preg_match("/U/",$objects)) && !isset($this->by_name['appgroup'])){
-        $this->by_name['appgroup']= _("Application");
-        $this->by_object['appgroup']= new appgroup($this->config, $this->dn);
-        $this->by_object['appgroup']->acl = "#all#";
-        $this->by_object['appgroup']->parent= &$this;
-      }
-    }
-
-    /* Remove application tab if not required any longer */
-    if(class_available("appgroup")){
-      if(!preg_match("/G/",$objects) && !preg_match("/U/",$objects) && isset($this->by_name['appgroup'])){
-        $this->by_object['appgroup']->remove_from_parent();
-        unset($this->by_name['appgroup']);
-        unset($this->by_object['appgroup']);
-      }
-    }
-
     /* Add environment tab if user or group is member in this object group*/
     if(class_available("environment")){
       if((preg_match("/G/",$objects) || preg_match("/U/",$objects)) && !isset($this->by_name['environment'])){
@@ -216,6 +197,26 @@ class ogrouptabs extends tabs
         unset($this->by_object['environment']);
       }
     }
+
+    /* Add application tab if user or group is member in this object group*/
+    if(class_available("appgroup")){
+      if((preg_match("/G/",$objects) || preg_match("/U/",$objects)) && !isset($this->by_name['appgroup'])){
+        $this->by_name['appgroup']= _("Applications");
+        $this->by_object['appgroup']= new appgroup($this->config, $this->dn);
+        $this->by_object['appgroup']->acl = "#all#";
+        $this->by_object['appgroup']->parent= &$this;
+      }
+    }
+
+    /* Remove application tab if not required any longer */
+    if(class_available("appgroup")){
+      if(!preg_match("/G/",$objects) && !preg_match("/U/",$objects) && isset($this->by_name['appgroup'])){
+        $this->by_object['appgroup']->remove_from_parent();
+        unset($this->by_name['appgroup']);
+        unset($this->by_object['appgroup']);
+      }
+    }
+
     /* Move reference tab to second position from right */
     if(class_available("acl")){
       if(isset($this->by_name['acl'])){