Code

Added ACL checks to the Info page
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 29 Nov 2010 13:34:52 +0000 (13:34 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 29 Nov 2010 13:34:52 +0000 (13:34 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20407 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/plugins/generic/infoPage/class_infoPage.inc

index f88502bce8e5fbfe6e18e318b61dd8fdd276dafe..9a63bda751f5e78a109fe4e04b6ac7a5ad50ad97 100644 (file)
@@ -26,10 +26,10 @@ class infoPage extends plugin
         $str = "";
         foreach($this->config->data['TABS']['MYACCOUNTTABS'] as $pluginData){
             $plugin = $pluginData['CLASS'];
-            $plInfo = call_user_func(array($plugin,'plInfo'));
 
-            list($index, $title, $desc, $icon) = $plist->getPlugData($plugin);
+            if(!$this->checkAccess($plugin)) continue;
 
+            list($index, $title, $desc, $icon) = $plist->getPlugData($plugin);
             $str.= "\n        <div class='icon-menu-item' style='width: 20%;' onclick='openPlugin(\"{$myAccountID}\",\"{$plugin}\")'>";
             $str.= "\n          ".image($icon);
             $str.= "\n          <div class='dsc'>";
@@ -41,6 +41,18 @@ class infoPage extends plugin
         }
         return($str);
     }
+
+    function checkAccess($class)
+    {
+        foreach($this->ui->ocMapping as $cat => $aclClasses){
+            if(in_array($class, $aclClasses)){
+                if(preg_match('/[rw]/',$this->ui->get_permissions($this->ui->dn, "{$cat}/{$class}", ''))){
+                    return(TRUE);
+                }
+            }
+        }
+        return(FALSE);
+    }
     
 
     function detectManagers()