[evolvis-commits] r15110: Moved more code into the compatibility block
mirabilos at evolvis.org
mirabilos at evolvis.org
Mon Feb 28 23:41:15 CET 2011
Author: mirabilos
Date: 2011-02-28 23:41:15 +0100 (Mon, 28 Feb 2011)
New Revision: 15110
Modified:
trunk/gforge_base/evolvisforge-5.1/gforge/common/include/RBAC.php
Log:
Moved more code into the compatibility block
Modified: trunk/gforge_base/evolvisforge-5.1/gforge/common/include/RBAC.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/common/include/RBAC.php 2011-02-28 22:41:13 UTC (rev 15109)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/common/include/RBAC.php 2011-02-28 22:41:15 UTC (rev 15110)
@@ -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 evolvis-commits
mailing list