Browse Source

N°1027 Internal

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@4899 a333f486-631f-4898-b8df-5754b55c2be0
glajarige 7 years ago
parent
commit
008b4a761a
1 changed files with 15 additions and 0 deletions
  1. 15 0
      datamodels/2.x/itop-portal-base/portal/web/index.php

+ 15 - 0
datamodels/2.x/itop-portal-base/portal/web/index.php

@@ -137,6 +137,21 @@ $oApp->before(function(Symfony\Component\HttpFoundation\Request $oRequest, Silex
     $oKPI->ComputeAndReport('Parsing portal configuration');
     // Loading current user
     ApplicationHelper::LoadCurrentUser($oApp);
+
+    // Checking that user is allowed this portal
+    $bAllowed = false;
+    foreach($oApp['combodo.portal.instance.conf']['portals'] as $aAllowedPortal)
+    {
+        if($aAllowedPortal['id'] === PORTAL_ID)
+        {
+            $bAllowed = true;
+            break;
+        }
+    }
+    if(!$bAllowed)
+    {
+        $oApp->abort(404);
+    }
 }, Application::EARLY_EVENT);
 
 // Running application