[Fusionforge-commits] r9789 - trunk/gforge/common/include

Roland Mas lolando at libremir.placard.fr.eu.org
Fri May 21 09:45:34 CEST 2010


Author: lolando
Date: 2010-05-21 09:45:33 +0200 (Fri, 21 May 2010)
New Revision: 9789

Modified:
   trunk/gforge/common/include/RBAC.php
Log:
Moved more code into the compatibility block

Modified: trunk/gforge/common/include/RBAC.php
===================================================================
--- trunk/gforge/common/include/RBAC.php	2010-05-21 07:45:22 UTC (rev 9788)
+++ trunk/gforge/common/include/RBAC.php	2010-05-21 07:45:33 UTC (rev 9789)
@@ -78,17 +78,6 @@
 		}
 		$this->data_array =& db_fetch_array($res);
 
-		$res = db_query_params ('SELECT * FROM role_setting WHERE role_id=$1',
-					array ($role_id)) ;
-		if (!$res) {
-			$this->setError('Role::fetchData()::'.db_error());
-			return false;
-		}
-		$this->setting_array=array();
-		while ($arr =& db_fetch_array($res)) {
-			$this->setting_array[$arr['section_name']][$arr['ref_id']] = $arr['value'];
-		}
-
 		if (USE_PFO_RBAC) {
 			$res = db_query_params ('SELECT section, reference, value FROM role_perms WHERE role_id=$1',
 						array ($role_id)) ;
@@ -100,7 +89,21 @@
 			while ($arr =& db_fetch_array($res)) {
 				$this->perms_array[$arr['section']][$arr['reference']] = $arr['value'];
 			}
-		} else { 	// Map pre-PFO RBAC section names and values to the new values
+		} else {
+			// Load pre-PFO RBAC settings...
+			$res = db_query_params ('SELECT * FROM role_setting WHERE role_id=$1',
+						array ($role_id)) ;
+			if (!$res) {
+				$this->setError('Role::fetchData()::'.db_error());
+				return false;
+			}
+			$this->setting_array=array();
+			while ($arr =& db_fetch_array($res)) {
+				$this->setting_array[$arr['section_name']][$arr['ref_id']] = $arr['value'];
+			}
+
+			// ...and map section names and values to the new values
+
 			$this->perms_array=array();
 			foreach ($this->setting_array as $oldsection => $t) {
 				switch ($oldsection) {




More information about the Fusionforge-commits mailing list