[Fusionforge-commits] FusionForge branch Branch_5_2 updated. a23f5d6fccb35ffb8cd09e4d4f82aa82fe1c7d34
Thorsten Glaser
mirabilos at fusionforge.org
Fri Feb 28 17:57:42 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_2 has been updated
via a23f5d6fccb35ffb8cd09e4d4f82aa82fe1c7d34 (commit)
via f6bd8fa0be9537a1c05d9e83c0c3c870e1809d64 (commit)
via 54b3e3731d97478b4cb1a96e954847f794b6d53d (commit)
via 91124f3e4cc418eefd8b93ac0d478b424c92f21e (commit)
via a87dc4c23ce452b0fb0e454b7359eafa9f90d1d1 (commit)
via 7ce3d5e8434eae994dbe4a1b9f37cf4603484a97 (commit)
via 650dc62d57c184d19b2c7c8780faf69831c5aa8d (commit)
via bd8e2cfe113f5b14a5426e41100571f753502c73 (commit)
via b6ce41babcb1a78ffe879e95fa7628755a173e3d (commit)
via fb04b1f94a24220fa430914efec2e4b1639e303e (commit)
from 1254786f5341f3bfdfbcfd56a9042ea4c49b9fdd (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 a23f5d6fccb35ffb8cd09e4d4f82aa82fe1c7d34
Merge: 1254786 f6bd8fa
Author: Thorsten Glaser <t.glaser at tarent.de>
Date: Fri Feb 28 17:57:33 2014 +0100
Merge remote-tracking branch 'origin/Branch_5_1' into Branch_5_2
Conflicts:
3rd-party/Makefile.rh
src/common/include/Group.class.php
src/common/include/RBAC.php
src/common/include/RBACEngine.class.php
src/common/tracker/ArtifactType.class.php
src/plugins/scmsvn/common/SVNPlugin.class.php
diff --cc src/common/include/RBAC.php
index 7176247,a1d4bd8..c41329b
--- a/src/common/include/RBAC.php
+++ b/src/common/include/RBAC.php
@@@ -321,62 -546,64 +321,69 @@@ abstract class BaseRole extends Error
$result = array () ;
$group_id = $project->getID() ;
- if (USE_PFO_RBAC) {
- $sections = array ('project_read', 'project_admin', 'frs', 'scm', 'docman', 'tracker_admin', 'new_tracker', 'forum_admin', 'new_forum', 'pm_admin', 'new_pm') ;
- foreach ($sections as $section) {
- $result[$section][$group_id] = $this->getVal ($section, $group_id) ;
- }
- } else {
- $sections = array ('projectadmin', 'frs', 'scm', 'docman', 'trackeradmin', 'newtracker', 'forumadmin', 'newforum', 'pmadmin', 'newpm', 'webcal') ;
- foreach ($sections as $section) {
- $result[$section][0] = $this->getVal ($section, 0) ;
- }
+ $sections = array ('project_read', 'project_admin', 'frs', 'scm', 'docman', 'tracker_admin', 'new_tracker') ;
+ foreach ($sections as $section) {
+ $result[$section][$group_id] = $this->getVal ($section, $group_id) ;
}
- $atf = new ArtifactTypeFactory ($project) ;
- if (!$atf->isError()) {
- $tids = $atf->getAllArtifactTypeIds () ;
- foreach ($tids as $tid) {
- $result['tracker'][$tid] = $this->getVal ('tracker', $tid) ;
+ if ($project->usesTracker()) {
+ $atf = new ArtifactTypeFactory ($project) ;
+ if (!$atf->isError()) {
+ $tids = $atf->getAllArtifactTypeIds () ;
+ foreach ($tids as $tid) {
+ $result['tracker'][$tid] = $this->getVal ('tracker', $tid) ;
+ }
}
- $sections[] = 'tracker' ;
++ array_push ($sections,'tracker');
+ }
- array_push ($sections,'tracker');
+
++ /*XXX merge from Branch_5_1: maybe this also only if usesForum? */
+ $sections_forum = array('forum_admin', 'new_forum');
+ foreach ($sections_forum as $section_forum) {
+ $result[$section_forum][$group_id] = $this->getVal ($section_forum, $group_id) ;
}
+ $sections = array_merge($sections, $sections_forum);
-
- $ff = new ForumFactory ($project) ;
- if (!$ff->isError()) {
- $fids = $ff->getAllForumIdsWithNews () ;
- foreach ($fids as $fid) {
- $result['forum'][$fid] = $this->getVal ('forum', $fid) ;
+
+ if ($project->usesForum()) {
+ $ff = new ForumFactory ($project) ;
+ if (!$ff->isError()) {
- $fids = $ff->getAllForumIds();
++ $fids = $ff->getAllForumIdsWithNews () ;
+ foreach ($fids as $fid) {
- $result['forum'][$fid] = $this->getVal('forum', $fid);
++ $result['forum'][$fid] = $this->getVal ('forum', $fid) ;
+ }
}
- $sections[] = 'forum' ;
++ array_push ($sections,'forum');
+ }
- array_push ($sections,'forum');
+
++ /*XXX see above, maybe only if usesPM? */
+ $sections_pm = array('pm_admin', 'new_pm');
+ foreach ($sections_pm as $section_pm) {
+ $result[$section_pm][$group_id] = $this->getVal ($section_pm, $group_id) ;
}
+ $sections = array_merge($sections, $sections_pm);
- $pgf = new ProjectGroupFactory ($project) ;
- if (!$pgf->isError()) {
- $pgids = $pgf->getAllProjectGroupIds () ;
- foreach ($pgids as $pgid) {
- $result['pm'][$pgid] = $this->getVal ('pm', $pgid) ;
+ if ($project->usesPM()) {
+ $pgf = new ProjectGroupFactory ($project) ;
+ if (!$pgf->isError()) {
- $pgids = $pgf->getAllProjectGroupIds();
++ $pgids = $pgf->getAllProjectGroupIds () ;
+ foreach ($pgids as $pgid) {
- $result['pm'][$pgid] = $this->getVal('pm', $pgid);
++ $result['pm'][$pgid] = $this->getVal ('pm', $pgid) ;
+ }
}
- $sections[] = 'pm' ;
++ array_push ($sections,'pm') ;
}
- array_push ($sections,'pm') ;
-
- if (USE_PFO_RBAC) {
- // Add settings not yet listed so far (probably plugins)
- // Currently handled:
- // - global settings (ignored here)
- // - project-wide settings (core and plugins)
- // - settings for multiple-instance tools coming from the core (trackers/pm/forums)
- // TODO:
- // - settings for multiple-instance tools from plugins
- foreach (array_keys ($this->perms_array) as $section) {
- if (!in_array ($section, $sections)) {
- if (!in_array ($section, $this->global_settings)) {
- $result[$section][$group_id] = $this->getVal ($section, $group_id) ;
- }
+ // Add settings not yet listed so far (probably plugins)
+ // Currently handled:
+ // - global settings (ignored here)
+ // - project-wide settings (core and plugins)
+ // - settings for multiple-instance tools coming from the core (trackers/pm/forums)
+ // TODO:
+ // - settings for multiple-instance tools from plugins
+ foreach (array_keys ($this->perms_array) as $section) {
+ if (!in_array ($section, $sections)) {
+ if (!in_array ($section, $this->global_settings)) {
+ $result[$section][$group_id] = $this->getVal ($section, $group_id) ;
}
}
}
diff --cc src/common/include/RBACEngine.class.php
index 27f630a,7a96f69..e45126c
--- a/src/common/include/RBACEngine.class.php
+++ b/src/common/include/RBACEngine.class.php
@@@ -150,15 -115,28 +150,20 @@@ class RBACEngine extends Error implemen
$result[] = RoleAnonymous::getInstance() ;
$result[] = RoleLoggedIn::getInstance() ;
-
+
- $uid = is_object($user) ? $user->getID() : $user;
+ $uid_s = is_object($user) ? $user->getID() : $user;
+ $uid = util_nat0($uid_s);
+ if ($uid === false) {
+ /* no valid number; would make Postgres error out */
+ return $result;
+ }
- if (USE_PFO_RBAC) {
- $res = db_query_params ('SELECT role_id FROM pfo_user_role WHERE user_id=$1',
- array ($uid));
- while ($arr = db_fetch_array($res)) {
- $result[] = $this->getRoleById ($arr['role_id']) ;
- }
- } else {
- $res = db_query_params ('SELECT role_id FROM user_group WHERE user_id=$1',
- array ($uid));
- while ($arr = db_fetch_array($res)) {
- $result[] = $this->getRoleById ($arr['role_id']) ;
- }
+ $res = db_query_params ('SELECT role_id FROM pfo_user_role WHERE user_id=$1',
+ array ($uid));
+ while ($arr = db_fetch_array($res)) {
+ $result[] = $this->getRoleById ($arr['role_id']) ;
}
-
+
return $result ;
}
diff --cc src/plugins/scmsvn/common/SVNPlugin.class.php
index 15248c9,bae019c..e96d93f
--- a/src/plugins/scmsvn/common/SVNPlugin.class.php
+++ b/src/plugins/scmsvn/common/SVNPlugin.class.php
@@@ -260,7 -257,7 +260,8 @@@ class SVNPlugin extends SCMPlugin
if ($ret != 0) {
return false;
}
- system("sed -i '/enable-rep-sharing = false/s/^. //' $repo/db/fsfs.conf");
++ system ("sed -i '/enable-rep-sharing = false/s/^. //' $repo/db/fsfs.conf") ;
+ system ("svn mkdir -m'Init' file:///$repo/trunk file:///$repo/tags file:///$repo/branches >/dev/null") ;
if (forge_get_config('use_ssh', 'scmsvn')) {
$unix_group = 'scm_' . $project->getUnixName() ;
system ("find $repo -type d | xargs -I{} chmod g+s {}") ;
-----------------------------------------------------------------------
Summary of changes:
src/common/include/RBAC.php | 47 ++++++++++++++-----------
src/common/include/RBACEngine.class.php | 7 +++-
src/common/tracker/ArtifactType.class.php | 2 +-
src/plugins/scmsvn/common/SVNPlugin.class.php | 1 +
4 files changed, 35 insertions(+), 22 deletions(-)
hooks/post-receive
--
FusionForge
More information about the Fusionforge-commits
mailing list