[Fusionforge-commits] FusionForge branch Branch_5_3 updated. 4c4503ac2463bf8dbb829252a252d7e9e5e79bf7
Roland Mas
lolando at fusionforge.org
Mon Jan 27 11:37:12 CET 2014
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FusionForge".
The branch, Branch_5_3 has been updated
via 4c4503ac2463bf8dbb829252a252d7e9e5e79bf7 (commit)
from d8137063c1ccb974ed7afaaf6d2fde653320e2eb (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 4c4503ac2463bf8dbb829252a252d7e9e5e79bf7
Author: Roland Mas <lolando at debian.org>
Date: Mon Jan 27 11:37:06 2014 +0100
Fixed over-enthusiastic deletion of data before partial update
diff --git a/src/common/include/RBAC.php b/src/common/include/RBAC.php
index dc0525e..e97e13a 100644
--- a/src/common/include/RBAC.php
+++ b/src/common/include/RBAC.php
@@ -771,23 +771,29 @@ abstract class BaseRole extends Error {
$this->setName($role_name) ;
}
- $res = db_query_params ('DELETE FROM pfo_role_setting WHERE role_id=$1',
- array ($role_id)) ;
+ $res = db_prepare ('DELETE FROM pfo_role_setting WHERE role_id=$1 AND section_name=$2 AND ref_id=$3',
+ 'delete_from_pfo_role_setting');
$res = db_prepare ('INSERT INTO pfo_role_setting (role_id, section_name, ref_id, perm_val) VALUES ($1, $2, $3, $4)',
'insert_into_pfo_role_setting');
foreach ($data as $sect => $refs) {
foreach ($refs as $refid => $value) {
+ $res = db_execute ('delete_from_pfo_role_setting',
+ array ($role_id,
+ $sect,
+ $refid)) ;
$res = db_execute ('insert_into_pfo_role_setting',
array ($role_id,
$sect,
$refid,
$value)) ;
+ $this->perms_array[$sect][$refid] = $value;
}
}
$res = db_unprepare ('insert_into_pfo_role_setting');
+ $res = db_unprepare ('delete_from_pfo_role_setting');
$hook_params = array ();
$hook_params['role'] =& $this;
-----------------------------------------------------------------------
Summary of changes:
src/common/include/RBAC.php | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
hooks/post-receive
--
FusionForge
More information about the Fusionforge-commits
mailing list