[Fusionforge-commits] r10714 - trunk/src/common/include

Roland Mas lolando at libremir.placard.fr.eu.org
Sun Sep 26 16:36:29 CEST 2010


Author: lolando
Date: 2010-09-26 16:36:28 +0200 (Sun, 26 Sep 2010)
New Revision: 10714

Modified:
   trunk/src/common/include/RBACEngine.class.php
Log:
Unbreak infinite recursion triggered in User::getGroups()

Modified: trunk/src/common/include/RBACEngine.class.php
===================================================================
--- trunk/src/common/include/RBACEngine.class.php	2010-09-26 14:29:46 UTC (rev 10713)
+++ trunk/src/common/include/RBACEngine.class.php	2010-09-26 14:36:28 UTC (rev 10714)
@@ -125,9 +125,10 @@
 				$result[] = $this->getRoleById ($arr['role_id']) ;
 			}
 		} else {
-			$groups = $user->getGroups() ;
-			foreach ($groups as $g) {
-				$result[] = $user->getRole($g) ;
+			$res = db_query_params ('SELECT role_id FROM user_group WHERE user_id=$1',
+						array ($user->getID()));
+			while ($arr =& db_fetch_array($res)) {
+				$result[] = $this->getRoleById ($arr['role_id']) ;
 			}
 		}
 		




More information about the Fusionforge-commits mailing list