[Fusionforge-commits] r11683 - branches/Branch_5_1/src/utils/fixscripts

Roland Mas lolando at libremir.placard.fr.eu.org
Wed Dec 1 15:50:35 CET 2010


Author: lolando
Date: 2010-12-01 15:50:34 +0100 (Wed, 01 Dec 2010)
New Revision: 11683

Modified:
   branches/Branch_5_1/src/utils/fixscripts/normalize_roles.php
Log:
Loop on the roles, not on the groups (since otherwise some roles will be processed way too many times, e.g. Anonymous)

Modified: branches/Branch_5_1/src/utils/fixscripts/normalize_roles.php
===================================================================
--- branches/Branch_5_1/src/utils/fixscripts/normalize_roles.php	2010-12-01 14:25:25 UTC (rev 11682)
+++ branches/Branch_5_1/src/utils/fixscripts/normalize_roles.php	2010-12-01 14:50:34 UTC (rev 11683)
@@ -32,19 +32,16 @@
 setup_plugin_manager () ;
 session_set_admin () ;
 
-$res = db_query_params ('SELECT group_id, group_name FROM groups',
+$res = db_query_params ('SELECT role_id FROM pfo_role ORDER BY role_id',
 			array ());
 
 $rows=db_numrows($res);
 
 for ($i=0; $i<$rows; $i++) {
-	echo "Normalizing roles for group ".db_result($res,$i,'group_name')."\n" ;
-
-	$group = group_get_object(db_result($res,$i,'group_id')) ;
-
-	if ($group && !$group->isError()) {
-		$group->normalizeAllRoles () ;
-	}
+	$role = RBACEngine::getInstance()->getRoleById (db_result($res,$i,'role_id')) ;
+	echo "Normalizing role ".$role->getDisplayableName()."\n" ;
+	
+	$role->normalizeData() ;
 }
 
 ?>




More information about the Fusionforge-commits mailing list