[Fusionforge-commits] r14742 - in branches/Branch_5_1: . src/common/include

Roland Mas lolando at fusionforge.org
Fri Nov 4 11:53:46 CET 2011


Author: lolando
Date: 2011-11-04 11:53:44 +0100 (Fri, 04 Nov 2011)
New Revision: 14742

Modified:
   branches/Branch_5_1/
   branches/Branch_5_1/src/common/include/RBAC.php
Log:
Backported bugfix from trunk

Modified: branches/Branch_5_1/src/common/include/RBAC.php
===================================================================
--- branches/Branch_5_1/src/common/include/RBAC.php	2011-11-04 09:47:42 UTC (rev 14741)
+++ branches/Branch_5_1/src/common/include/RBAC.php	2011-11-04 10:53:44 UTC (rev 14742)
@@ -503,6 +503,11 @@
 	}
 
 	function setSetting ($section, $reference, $value) {
+		$cur = $this->getSettingRaw($section, $reference);
+		if (($value == $cur) && ($cur != NULL)) {
+			return true;
+		}
+
 		$role_id = $this->getID () ;
 
 		$res = db_query_params ('DELETE FROM pfo_role_setting WHERE role_id=$1 AND section_name=$2 AND ref_id=$3',
@@ -595,6 +600,14 @@
 	}
 
         function getSetting($section, $reference) {
+	    $r = $this->getSettingRaw($section, $reference);
+	    if ($r == NULL) {
+		    return 0;
+	    }
+	    return $r;
+    }
+
+    function getSettingRaw($section, $reference) {
                 if (isset ($this->perms_array[$section][$reference])) {
 			$value = $this->perms_array[$section][$reference] ;
 		} else {
@@ -706,7 +719,7 @@
 			$hook_params['section'] = $section ;
 			$hook_params['reference'] = $reference ;
 			$hook_params['value'] = $value ;
-			$hook_params['result'] = 0 ;
+			$hook_params['result'] = NULL ;
 			plugin_hook_by_reference ("role_get_setting", $hook_params);
 			return $hook_params['result'] ;
 			break ;




More information about the Fusionforge-commits mailing list