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

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


Author: lolando
Date: 2010-05-21 09:44:39 +0200 (Fri, 21 May 2010)
New Revision: 9784

Modified:
   trunk/gforge/common/include/Role.class.php
Log:
Use string comparisons when mapping old permissions to PFO RBAC values

Modified: trunk/gforge/common/include/Role.class.php
===================================================================
--- trunk/gforge/common/include/Role.class.php	2010-05-21 07:44:29 UTC (rev 9783)
+++ trunk/gforge/common/include/Role.class.php	2010-05-21 07:44:39 UTC (rev 9784)
@@ -486,7 +486,7 @@
 					switch ($newsection) {
 					case 'project_admin':
 						switch ($oldvalue) {
-						case 0: $newvalue = 0 ; break ;
+						case '0': $newvalue = 0 ; break ;
 						case 'A': $newvalue = 1 ; break ;
 						}
 					break;
@@ -495,19 +495,19 @@
 					case 'pm_admin':
 					case 'forum_admin':
 						switch ($oldvalue) {
-						case 0: $newvalue = 0 ; break ;
-						case 2: $newvalue = 1 ; break ;
+						case '0': $newvalue = 0 ; break ;
+						case '2': $newvalue = 1 ; break ;
 						}
 					break;
 					
 					case 'tracker':
 					case 'pm':
-						switch ($value) {
-						case -1: $newvalue = 0 ; break ;
-						case 0: $newvalue = 1 ; break ;
-						case 1: $newvalue = 3 ; break ;
-						case 2: $newvalue = 7 ; break ;
-						case 3: $newvalue = 5 ; break ;
+						switch ($oldvalue) {
+						case '-1': $newvalue = 0 ; break ;
+						case '0': $newvalue = 1 ; break ;
+						case '1': $newvalue = 3 ; break ;
+						case '2': $newvalue = 7 ; break ;
+						case '3': $newvalue = 5 ; break ;
 						}
 					break ;
 




More information about the Fusionforge-commits mailing list