Code

Applied in_array strict patches from trunk
[gosa.git] / gosa-core / plugins / admin / ogroups / tabs_ogroups.inc
index 740eb25c0b3a537a21383f2a61d1db71034211ac..c285290fee4a29641930efdcfd23095bc9c6ab45 100644 (file)
@@ -63,7 +63,7 @@ class ogrouptabs extends tabs
                 if(isset($this->by_object['ogroup']->objcache[$dn])){
                     $obj = $this->by_object['ogroup']->objcache[$dn];
                     if(isset($obj['objectClass'])){
-                        if(in_array("goFonAccount",$obj['objectClass'])){
+                        if(in_array_strict("goFonAccount",$obj['objectClass'])){
                             $usePhoneTab = true;
                         }
                     }
@@ -82,6 +82,11 @@ class ogrouptabs extends tabs
                 $this->remove('mailogroup');
             }
         }
+        if(class_available("GroupwareDistributionList")){
+            if(!preg_match("/U/",$objects) && isset($this->by_object['GroupwareDistributionList'])){
+                $this->remove('GroupwareDistributionList');
+            }
+        }
 
         /* Remove terminal group, if theres no terminal left in the object list 
          */
@@ -130,7 +135,7 @@ class ogrouptabs extends tabs
                     if(isset($this->by_object['ogroup']->objcache[$dn])){
                         $obj = $this->by_object['ogroup']->objcache[$dn];
                         if(isset($obj['objectClass'])){
-                            if(in_array("goFonAccount",$obj['objectClass'])){
+                            if(in_array_strict("goFonAccount",$obj['objectClass'])){
                                 $this->by_name['phonequeue']= _("Phone queue");
                                 $this->by_object['phonequeue']= new phonequeue($this->config, $this->dn);
                                 $this->by_object['phonequeue']->parent= &$this;
@@ -154,6 +159,14 @@ class ogrouptabs extends tabs
                 }
             }
         }
+        if(class_available("GroupwareDistributionList")){
+            if((preg_match("/U/",$objects))&&(!isset($this->by_object['GroupwareDistributionList']))){
+                $this->by_name['GroupwareDistributionList']= _("Groupware");
+                $this->by_object['GroupwareDistributionList']= new GroupwareDistributionList($this->config, $this->dn);
+                $this->by_object['GroupwareDistributionList']->parent= &$this;
+                $this->add('GroupwareDistributionList');
+            }
+        }
 
         /* Add Terminal tab */
         if(class_available("termgroup")){
@@ -365,11 +378,8 @@ class ogrouptabs extends tabs
             $this->dn= 'cn='.$baseobject->cn.','.get_ou("group", "ogroupRDN").$baseobject->base;
         }
 
-        /* Only delete attributes if there are members left */
-        if (count($this->by_object['ogroup']->memberList) != 0) {
-            foreach(array_keys($this->to_remove) as $object) {
-                $this->to_remove[$object]->remove_from_parent();
-            }
+        foreach(array_keys($this->to_remove) as $object) {
+            $this->to_remove[$object]->remove_from_parent();
         }
         tabs::save();
     }