From: miguel G. <mi...@us...> - 2006-03-20 19:43:38
|
Update of /cvsroot/xrms/xrms/admin/acl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15011 Modified Files: role_permission_grid.php Log Message: Fixed a bug when saving options. It didnt save deselected options.. Index: role_permission_grid.php =================================================================== RCS file: /cvsroot/xrms/xrms/admin/acl/role_permission_grid.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** role_permission_grid.php 2 Jan 2006 22:27:11 -0000 1.6 --- role_permission_grid.php 20 Mar 2006 19:43:25 -0000 1.7 *************** *** 91,98 **** foreach ($scopedata as $cor=>$permdata) { foreach ($permdata as $perm=>$value) { ! // echo "PROCESSING $scope $cor $perm<br>"; if (array_key_exists("$scope,$cor,$perm",$_POST)) { if ($current_permissions[$scope][$cor][$perm]!=1) { ! // echo "acl->add_role_permission($gridrole_id,$cor,$scope,$perm);<br>"; $ret=$acl->add_role_permission($gridrole_id,$cor,$scope,$perm); // if ($ret) echo "PERMISSION SET $scope,$cor,$perm"; --- 91,98 ---- foreach ($scopedata as $cor=>$permdata) { foreach ($permdata as $perm=>$value) { ! // echo "PROCESSING $scope $cor $perm<br>"; if (array_key_exists("$scope,$cor,$perm",$_POST)) { if ($current_permissions[$scope][$cor][$perm]!=1) { ! echo "acl->add_role_permission($gridrole_id,$cor,$scope,$perm);<br>"; $ret=$acl->add_role_permission($gridrole_id,$cor,$scope,$perm); // if ($ret) echo "PERMISSION SET $scope,$cor,$perm"; *************** *** 102,108 **** if ($current_permissions[$scope][$cor][$perm]!=0) { $ret=$acl->get_role_permission($gridrole_id,$cor,$scope,$perm); ! $role_permission_id=$ret['RolePermission_id']; ! $delret=$acl->delete_role_permission($role_permission_id); ! // if ($delret) echo "DELETED $role_permission_id SUCCESSFULLY"; $current_permissions[$scope][$cor][$perm]=0; } --- 102,111 ---- if ($current_permissions[$scope][$cor][$perm]!=0) { $ret=$acl->get_role_permission($gridrole_id,$cor,$scope,$perm); ! //print_r($ret); ! $role_permission_id=array_keys($ret); ! //print_r($role_permission_id); ! $delret=$acl->delete_role_permission($role_permission_id[0]); ! //echo "DELETED $role_permission_id[0] SUCCESSFULLY"; ! $current_permissions[$scope][$cor][$perm]=0; } |