[Fusionforge-commits] FusionForge branch Branch_5_3 updated. da49b0010367b324d684c328657b16ebb411b6ce

Thorsten Glaser mirabilos at fusionforge.org
Mon Jan 5 17:11:19 CET 2015


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  da49b0010367b324d684c328657b16ebb411b6ce (commit)
       via  8ee7f3723aaaf2370e310ae9a58fb7760166996d (commit)
       via  9e5067c33804af319d5225d6b81c4a4d11987e88 (commit)
      from  24140875ef11e08512636d2af4c326269ca0cc20 (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 da49b0010367b324d684c328657b16ebb411b6ce
Merge: 2414087 8ee7f37
Author: Thorsten Glaser <t.glaser at tarent.de>
Date:   Mon Jan 5 17:11:13 2015 +0100

    Merge branch 'Branch_5_2' into Branch_5_3

diff --cc src/common/include/RBACEngine.class.php
index 3c08b70,c466ad7..a60cc7e
--- a/src/common/include/RBACEngine.class.php
+++ b/src/common/include/RBACEngine.class.php
@@@ -501,11 -475,43 +501,43 @@@ function forge_check_perm_for_user ($us
  }
  
  function forge_check_global_perm_for_user ($user, $section, $action = NULL) {
 -	$engine = RBACEngine::getInstance() ;
 +	$engine = RBACEngine::getInstance();
  
 -	return $engine->isGlobalActionAllowedForUser($user, $section, $action) ;
 +	return $engine->isGlobalActionAllowedForUser($user, $section, $action);
  }
  
+ function forge_cache_external_roles($group) {
+ 	global $used_external_roles, $unused_external_roles;
+ 
+ 	$used_external_roles = array();
+ 	$unused_external_roles = array();
+ 	$group_id = $group->getID();
+ 
+ 	foreach (RBACEngine::getInstance()->getPublicRoles() as $r) {
+ 		$grs = $r->getLinkedProjects();
+ 		$seen = false;
+ 		foreach ($grs as $g) {
+ 			if ($g->getID() == $group_id) {
+ 				$seen = true;
+ 				break;
+ 			}
+ 		}
+ 		if (!$seen) {
+ 			$unused_external_roles[] = $r;
+ 		}
+ 	}
+ 
+ 	foreach ($group->getRoles() as $r) {
+ 		if ($r->getHomeProject() == NULL ||
+ 		    $r->getHomeProject()->getID() != $group_id) {
+ 			$used_external_roles[] = $r;
+ 		}
+ 	}
+ 
+ 	sortRoleList($used_external_roles, $group, 'composite');
+ 	sortRoleList($unused_external_roles, $group, 'composite');
+ }
+ 
  // Local Variables:
  // mode: php
  // c-file-style: "bsd"
diff --cc src/www/project/admin/users.php
index 73c67d2,24ef585..89d0aa8
--- a/src/www/project/admin/users.php
+++ b/src/www/project/admin/users.php
@@@ -189,8 -157,7 +159,8 @@@ if (getStringFromRequest('submit')) 
  					$error_msg = $r->getErrorMessage();
  				} else {
  					$feedback = _("Role linked successfully");
 +					$group->addHistory(_('Linked Role'), $r->getName());
- 					cache_external_roles () ;
+ 					forge_cache_external_roles($group);
  				}
  			}
  		}
@@@ -203,8 -170,7 +173,8 @@@
  					$error_msg = $r->getErrorMessage();
  				} else {
  					$feedback = _("Role unlinked successfully");
 +					$group->addHistory(_('Unlinked Role'), $r->getName());
- 					cache_external_roles () ;
+ 					forge_cache_external_roles($group);
  				}
  			}
  		}

-----------------------------------------------------------------------

Summary of changes:
 src/common/include/RBACEngine.class.php |   32 +++++++++++++++++++++++++++
 src/www/project/admin/users.php         |   36 +++----------------------------
 2 files changed, 35 insertions(+), 33 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list