Browse Source

Moved static method GetAllowedPortals() from LoginWebpage class to UserRights class.

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@3862 a333f486-631f-4898-b8df-5754b55c2be0
glajarige 9 năm trước cách đây
mục cha
commit
62564d7dac
2 tập tin đã thay đổi với 26 bổ sung26 xóa
  1. 0 25
      application/loginwebpage.class.inc.php
  2. 26 1
      core/userrights.class.inc.php

+ 0 - 25
application/loginwebpage.class.inc.php

@@ -846,29 +846,4 @@ EOF
 		}
 		return false; // nothing matched !!
 	}
-	
-	public static function GetAllowedPortals()
-	{
-		$aAllowedPortals = array();
-		$aPortalsConf = PortalDispatcherData::GetData();
-		$aDispatchers = array();
-		foreach($aPortalsConf as $sPortalId => $aConf)
-		{
-			$sHandlerClass = $aConf['handler'];
-			$aDispatchers[$sPortalId] = new $sHandlerClass($sPortalId);
-		}
-		
-		foreach($aDispatchers as $sPortalId => $oDispatcher)
-		{
-			if ($oDispatcher->IsUserAllowed())
-			{
-				$aAllowedPortals[] = array(
-					'id' => $sPortalId,
-					'label' => $oDispatcher->GetLabel(),
-					'url' => $oDispatcher->GetUrl(),
-				);
-			}
-		}
-		return $aAllowedPortals;
-	}
 } // End of class

+ 26 - 1
core/userrights.class.inc.php

@@ -974,7 +974,32 @@ class UserRights
 		return self::$m_aPortalUsers[$iUser];
 	}
 
-	public static function ListProfiles($oUser = null)
+	public static function GetAllowedPortals()
+    {
+        $aAllowedPortals = array();
+        $aPortalsConf = PortalDispatcherData::GetData();
+        $aDispatchers = array();
+        foreach ($aPortalsConf as $sPortalId => $aConf)
+        {
+            $sHandlerClass = $aConf['handler'];
+            $aDispatchers[$sPortalId] = new $sHandlerClass($sPortalId);
+        }
+
+        foreach ($aDispatchers as $sPortalId => $oDispatcher)
+        {
+            if ($oDispatcher->IsUserAllowed())
+            {
+                $aAllowedPortals[] = array(
+                    'id' => $sPortalId,
+                    'label' => $oDispatcher->GetLabel(),
+                    'url' => $oDispatcher->GetUrl(),
+                );
+            }
+        }
+        return $aAllowedPortals;
+    }
+
+    public static function ListProfiles($oUser = null)
 	{
 		if (is_null($oUser))
 		{