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, master has been updated
via d487a43ea2ad4dcffee0c5661ba697d0b4da1b96 (commit)
via 64ceafb1110a015d04759e67d6b2985b5e74bcdf (commit)
via 2533ff429f10c9883272a2fb1eccc5d6d78f57ae (commit)
via 182b0887087cad83827308bfd256b02662dcb457 (commit)
via 1904e67d6469e3c2688f734f14cb5a15e886c0ac (commit)
via b7f4aadbc9dd39c8f1f265ef1602c321a83c421c (commit)
from 69ce94fa4bee5d4288142cdf9a4fdb69e27717a7 (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 -----------------------------------------------------------------
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=d487a43ea2ad4dcffee0c5661ba697d0b4da1b96
commit d487a43ea2ad4dcffee0c5661ba697d0b4da1b96
Author: Marc-Etienne Vargenau <[email protected]>
Date: Thu Jul 13 11:53:43 2017 +0200
Whitespace
diff --git a/src/www/pm/browse_task.php b/src/www/pm/browse_task.php
index d94339b..5c64e16 100644
--- a/src/www/pm/browse_task.php
+++ b/src/www/pm/browse_task.php
@@ -103,7 +103,7 @@ $techs = $engine->getUsersByAllowedAction('pm',
$pg->getID(), 'tech');
$tech_select_arr = array();
foreach ($techs as $tech) {
- $tech_select_arr[$tech->getID()] = $tech->getRealName() ;
+ $tech_select_arr[$tech->getID()] = $tech->getRealName();
}
$tech_select_arr[0] = _('Any');
@@ -184,7 +184,7 @@ if ($rows < 1) {
/*
Now display the tasks in a table with priority colors
*/
- $IS_ADMIN = forge_check_perm ('pm', $pg->getID(), 'manager') ;
+ $IS_ADMIN = forge_check_perm('pm', $pg->getID(), 'manager');
if ($IS_ADMIN) {
echo $HTML->openForm(array('name' => 'taskList', 'action' =>
'/pm/task.php?group_id='.$group_id.'&group_project_id='.$pg->getID(), 'method'
=> 'post'));
@@ -315,20 +315,20 @@ if ($rows < 1) {
creating a custom technician box which includes "No
Change" and "Nobody"
*/
- $engine = RBACEngine::getInstance () ;
- $techs = $engine->getUsersByAllowedAction ('pm', $pg->getID(),
'tech') ;
+ $engine = RBACEngine::getInstance();
+ $techs = $engine->getUsersByAllowedAction('pm', $pg->getID(),
'tech');
- $tech_id_arr = array () ;
- $tech_name_arr = array () ;
+ $tech_id_arr = array();
+ $tech_name_arr = array();
foreach ($techs as $tech) {
- $tech_id_arr[] = $tech->getID() ;
- $tech_name_arr[] = $tech->getRealName() ;
+ $tech_id_arr[] = $tech->getID();
+ $tech_name_arr[] = $tech->getRealName();
}
$tech_id_arr[]='100.1';
$tech_name_arr[]=_('Unassigned');
- $tech_box=html_build_select_box_from_arrays
($tech_id_arr,$tech_name_arr,'assigned_to',
+
$tech_box=html_build_select_box_from_arrays($tech_id_arr,$tech_name_arr,'assigned_to',
'100',true,_('No Change'));
echo '<fieldset id="fieldset1_closed" class="coolfieldset">
@@ -339,13 +339,13 @@ if ($rows < 1) {
<tr>
<td>'._('Category')._(':').'</td>
- <td>'. $pg->categoryBox ('category_id','xzxz',true,
_('No Change')) .'</td>
+ <td>'. $pg->categoryBox('category_id','xzxz',true,
_('No Change')) .'</td>
</tr>
<tr>
<td>'._('Priority')._(':').'</td>
<td>';
- echo build_priority_select_box ('priority', '100',
true);
+ echo build_priority_select_box('priority', '100', true);
echo '</td>
</tr>
@@ -356,7 +356,7 @@ if ($rows < 1) {
<tr>
<td>'._('State')._(':').'</td>
- <td>'. $pg->statusBox ('status_id','xzxz',true,_('No
Change')) .'</td>
+ <td>'. $pg->statusBox('status_id','xzxz',true,_('No
Change')) .'</td>
</tr>
<tr>
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=64ceafb1110a015d04759e67d6b2985b5e74bcdf
commit 64ceafb1110a015d04759e67d6b2985b5e74bcdf
Author: Marc-Etienne Vargenau <[email protected]>
Date: Thu Jul 13 11:49:27 2017 +0200
Add <label>s
diff --git a/src/www/forum/admin/index.php b/src/www/forum/admin/index.php
index 4bd5940..06047c1 100644
--- a/src/www/forum/admin/index.php
+++ b/src/www/forum/admin/index.php
@@ -108,12 +108,12 @@ if (getStringFromRequest('add_forum')) {
<input type="hidden" name="add_forum" value="y" />
<input type="hidden" name="group_id"
value="'.$group_id.'" />
<input type="hidden" name="form_key" value="' .
form_generate_key() . '" />
- <strong>'._('Forum
Name').utils_requiredField()._(':').'</strong><br />
- <input type="text" name="forum_name"
required="required" value="" size="20" maxlength="30" pattern=".{3,}" />
+ <label for="forum_name"><strong>'._('Forum
Name').utils_requiredField()._(':').'</strong></label>
+ <input id="forum_name" type="text" name="forum_name"
required="required" value="" size="20" maxlength="30" pattern=".{3,}" />
</p>
<p>
-
<strong>'._('Description').utils_requiredField()._(':').'</strong><br />
- <input type="text" name="description"
required="required" value="" size="40" maxlength="80" pattern=".{10,}" />
+ <label
for="description"><strong>'._('Description').utils_requiredField()._(':').'</strong></label>
+ <input id="description" type="text" name="description"
required="required" value="" size="40" maxlength="80" pattern=".{10,}" />
</p>
<p>
<strong>'._('Email All Posts To:').'</strong><br />
@@ -169,16 +169,14 @@ if (getStringFromRequest('add_forum')) {
$f = new Forum ($g,$group_forum_id);
forum_header(array('title'=>_('Permanently Delete Forum'), 'modal' =>
1));
- echo '<p>
- <strong>'._('You are about to permanently and
irretrievably delete this entire forum and all its contents!').'</strong><br />
- </p>';
+ echo '<p><strong>'._('You are about to permanently and irretrievably
delete this entire forum and all its contents!').'</strong></p>';
echo $HTML->openForm(array('method' => 'post', 'action' =>
getStringFromServer('PHP_SELF')));
echo ' <input type="hidden" name="post_changes" value="y" />
<input type="hidden" name="deleteforum" value="y" />
<input type="hidden" name="group_id"
value="'.$group_id.'" />
<input type="hidden" name="group_forum_id"
value="'.$group_forum_id.'" />
- <input type="checkbox" name="sure" value="1" />'._('I
am Sure').'<br />
- <input type="checkbox" name="really_sure" value="1"
/>'._('I am Really Sure').'<br />
+ <input id="sure" type="checkbox" name="sure" value="1"
/><label for="sure">'._('I am Sure').'</label><br />
+ <input id="really_sure" type="checkbox"
name="really_sure" value="1" /><label for="really_sure">'._('I am Really
Sure').'</label><br />
<input type="submit" name="submit"
value="'._('Delete').'" />';
echo $HTML->closeForm();
forum_footer();
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=2533ff429f10c9883272a2fb1eccc5d6d78f57ae
commit 2533ff429f10c9883272a2fb1eccc5d6d78f57ae
Author: Marc-Etienne Vargenau <[email protected]>
Date: Thu Jul 13 11:47:29 2017 +0200
Whitespace
diff --git a/src/common/tracker/actions/mod.php
b/src/common/tracker/actions/mod.php
index 825dbf0..a83fb3b 100644
--- a/src/common/tracker/actions/mod.php
+++ b/src/common/tracker/actions/mod.php
@@ -44,7 +44,7 @@ function gettipspan($idpart, $content) {
html_use_jqueryui();
html_use_coolfieldset();
html_use_jquerydatetimepicker();
-$ath->header(array ('title'=> $ah->getStringID().' '. $ah->getSummary(),
'atid'=>$ath->getID()));
+$ath->header(array('title'=> $ah->getStringID().' '. $ah->getSummary(),
'atid'=>$ath->getID()));
echo notepad_func();
echo init_datetimepicker();
@@ -113,7 +113,7 @@ echo $HTML->listTableTop();
$submittedUnixName =
$ah->getSubmittedUnixName();
$submittedBy = $ah->getSubmittedBy();
?>
- (<samp><?php echo util_make_link_u
($submittedUnixName,$submittedBy,$submittedUnixName); ?></samp>)
+ (<samp><?php echo
util_make_link_u($submittedUnixName,$submittedBy,$submittedUnixName); ?></samp>)
<?php } ?>
</td>
<td><strong><?php echo _('Date Submitted')._(':');
?></strong><br />
@@ -133,20 +133,20 @@ echo $HTML->listTableTop();
<td><strong><?php echo _('Data Type'). _(': ') ?></strong><br />
<?php
-$atf = new ArtifactTypeFactory ($group);
-$tids = array () ;
+$atf = new ArtifactTypeFactory($group);
+$tids = array();
foreach ($atf->getArtifactTypes() as $at) {
- if (forge_check_perm ('tracker', $at->getID(), 'manager')) {
- $tids[] = $at->getID() ;
+ if (forge_check_perm('tracker', $at->getID(), 'manager')) {
+ $tids[] = $at->getID();
}
}
$res = db_query_params('SELECT group_artifact_id, name
FROM artifact_group_list
WHERE group_artifact_id = ANY ($1)',
- array (db_int_array_to_any_clause ($tids))) ;
+ array(db_int_array_to_any_clause($tids)));
-echo html_build_select_box ($res,'new_artifact_type_id',$ath->getID(),false);
+echo html_build_select_box($res,'new_artifact_type_id',$ath->getID(),false);
?>
</td>
@@ -360,7 +360,7 @@ if (forge_get_config('use_artefacts_dependencies')) { ?>
}
if (forge_get_config('use_object_associations')) { ?>
<div id="tabber-object-associations" class="tabbertab">
- <?php if (forge_check_perm ('tracker',$ath->getID(),'submit')) {
+ <?php if (forge_check_perm('tracker',$ath->getID(),'submit')) {
echo
$ah->showAssociations('/tracker/?func=removeassoc&aid='.$ah->getID().'&group_id='.$ath->Group->getID().'&atid='.$ath->getID());
echo $ah->showAddAssociations();
} else {
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=182b0887087cad83827308bfd256b02662dcb457
commit 182b0887087cad83827308bfd256b02662dcb457
Author: Marc-Etienne Vargenau <[email protected]>
Date: Thu Jul 13 11:43:19 2017 +0200
Test isset
diff --git a/src/common/tracker/actions/browse.php
b/src/common/tracker/actions/browse.php
index 8dca560..20ffedc 100644
--- a/src/common/tracker/actions/browse.php
+++ b/src/common/tracker/actions/browse.php
@@ -138,7 +138,7 @@ if ($set == 'custom') {
}
}
-if (is_array($_extra_fields)) {
+if (isset($_extra_fields) && is_array($_extra_fields)) {
$keys=array_keys($_extra_fields);
foreach ($keys as $key) {
if ($_extra_fields[$key] != 'Array') {
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=1904e67d6469e3c2688f734f14cb5a15e886c0ac
commit 1904e67d6469e3c2688f734f14cb5a15e886c0ac
Author: Marc-Etienne Vargenau <[email protected]>
Date: Thu Jul 13 11:42:42 2017 +0200
Consistent case
diff --git a/src/common/include/Role.class.php
b/src/common/include/Role.class.php
index e19f8b2..d1ac768 100644
--- a/src/common/include/Role.class.php
+++ b/src/common/include/Role.class.php
@@ -40,12 +40,12 @@ class Role extends RoleExplicit implements PFO_RoleExplicit
{
* @param object $group The Group object.
* @param int|bool $role_id The role_id.
*/
- function __construct($Group, $role_id = false) {
+ function __construct($group, $role_id = false) {
parent::__construct();
- if (!$Group || !is_object($Group) || $Group->isError()) {
- $Group = NULL;
+ if (!$group || !is_object($group) || $group->isError()) {
+ $group = NULL;
}
- $this->Group =& $Group;
+ $this->Group =& $group;
$hook_params = array();
$hook_params['role'] =& $this;
@@ -237,7 +237,7 @@ class Role extends RoleExplicit implements PFO_RoleExplicit
{
if (array_key_exists ($name, $this->defaults)) {
$arr =& $this->defaults[$name];
} else {
- $arr = array () ;
+ $arr = array();
}
$data = array();
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=b7f4aadbc9dd39c8f1f265ef1602c321a83c421c
commit b7f4aadbc9dd39c8f1f265ef1602c321a83c421c
Author: Marc-Etienne Vargenau <[email protected]>
Date: Thu Jul 13 11:37:50 2017 +0200
Whitespace
diff --git a/src/common/include/RBAC.php b/src/common/include/RBAC.php
index af76e29..6f047fa 100644
--- a/src/common/include/RBAC.php
+++ b/src/common/include/RBAC.php
@@ -153,22 +153,22 @@ abstract class BaseRole extends FFError {
}
public function getUsers() {
- return array () ;
+ return array();
}
public function hasUser($user) {
- throw new Exception ("Not implemented") ;
+ throw new Exception ("Not implemented");
}
function hasGlobalPermission($section, $action = NULL) {
- return $this->hasPermission ($section, -1, $action) ;
+ return $this->hasPermission ($section, -1, $action);
}
public function getSettings() {
- throw new Exception ("Not implemented") ;
+ throw new Exception ("Not implemented");
}
public function setSettings($data) {
- throw new Exception ("Not implemented") ;
+ throw new Exception ("Not implemented");
}
- public function delete () {
- throw new Exception ("Not implemented") ;
+ public function delete() {
+ throw new Exception ("Not implemented");
}
/**
@@ -210,7 +210,7 @@ abstract class BaseRole extends FFError {
$project->getID()));
if (db_numrows($res)) {
- return true ;
+ return true;
}
$res = db_query_params('INSERT INTO role_project_refs (role_id,
group_id) VALUES ($1, $2)',
array($this->getID(),
@@ -229,7 +229,7 @@ abstract class BaseRole extends FFError {
}
}
- return true ;
+ return true;
}
function unlinkProject($project) { // From the PFO spec
@@ -248,7 +248,7 @@ abstract class BaseRole extends FFError {
return false;
}
- $this->removeObsoleteSettings ();
+ $this->removeObsoleteSettings();
foreach ($this->getUsers() as $u) {
if (!$SYS->sysCheckCreateUser($u->getID())) {
@@ -270,7 +270,7 @@ abstract class BaseRole extends FFError {
$systasksq->add(SYSTASK_CORE, 'SCM_REPO',
$project->getID());
}
- return true ;
+ return true;
}
/**
@@ -287,7 +287,7 @@ abstract class BaseRole extends FFError {
unset($this->perms_array);
$res = db_query_params('SELECT * FROM pfo_role WHERE
role_id=$1',
- array ($role_id)) ;
+ array ($role_id));
if (!$res || db_numrows($res) < 1) {
$this->setError('BaseRole::fetchData()::'.db_error());
return false;
@@ -319,18 +319,18 @@ abstract class BaseRole extends FFError {
return;
}
- $role_id = $this->getID () ;
+ $role_id = $this->getID();
db_query_params ('DELETE FROM pfo_role_setting WHERE role_id=$1
AND section_name=$2 AND ref_id=$3',
array ($role_id,
$section,
- $reference)) ;
+ $reference));
db_query_params ('INSERT INTO pfo_role_setting (role_id,
section_name, ref_id, perm_val) VALUES ($1, $2, $3, $4)',
array ($role_id,
$section,
$reference,
- $value)) ;
+ $value));
$this->perms_array[$section][$reference] = $value;
# Change repo permissions when we change anonymous access
@@ -345,17 +345,17 @@ abstract class BaseRole extends FFError {
$result = array();
$group_id = $project->getID();
- $sections = array ('project_read', 'project_admin', 'scm',
'docman', 'tracker_admin', 'new_tracker') ;
+ $sections = array ('project_read', 'project_admin', 'scm',
'docman', 'tracker_admin', 'new_tracker');
foreach ($sections as $section) {
- $result[$section][$group_id] = $this->getVal ($section,
$group_id) ;
+ $result[$section][$group_id] = $this->getVal ($section,
$group_id);
}
if ($project->usesTracker()) {
- $atf = new ArtifactTypeFactory ($project) ;
+ $atf = new ArtifactTypeFactory ($project);
if (!$atf->isError()) {
- $tids = $atf->getAllArtifactTypeIds () ;
+ $tids = $atf->getAllArtifactTypeIds();
foreach ($tids as $tid) {
- $result['tracker'][$tid] =
$this->getVal ('tracker', $tid) ;
+ $result['tracker'][$tid] =
$this->getVal ('tracker', $tid);
}
}
array_push ($sections,'tracker');
@@ -381,16 +381,16 @@ abstract class BaseRole extends FFError {
/*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) ;
+ $result[$section_forum][$group_id] = $this->getVal
($section_forum, $group_id);
}
$sections = array_merge($sections, $sections_forum);
if ($project->usesForum()) {
- $ff = new ForumFactory ($project) ;
+ $ff = new ForumFactory ($project);
if (!$ff->isError()) {
- $fids = $ff->getAllForumIdsWithNews () ;
+ $fids = $ff->getAllForumIdsWithNews();
foreach ($fids as $fid) {
- $result['forum'][$fid] = $this->getVal
('forum', $fid) ;
+ $result['forum'][$fid] = $this->getVal
('forum', $fid);
}
}
array_push ($sections,'forum');
@@ -399,19 +399,19 @@ abstract class BaseRole extends FFError {
/*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) ;
+ $result[$section_pm][$group_id] = $this->getVal
($section_pm, $group_id);
}
$sections = array_merge($sections, $sections_pm);
if ($project->usesPM()) {
- $pgf = new ProjectGroupFactory ($project) ;
+ $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);
}
}
- array_push ($sections,'pm') ;
+ array_push ($sections,'pm');
}
// Add settings not yet listed so far (probably plugins)
@@ -424,12 +424,12 @@ abstract class BaseRole extends FFError {
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) ;
+ $result[$section][$group_id] =
$this->getVal ($section, $group_id);
}
}
}
- return $result ;
+ return $result;
}
/**
@@ -439,23 +439,23 @@ abstract class BaseRole extends FFError {
*
* @return array array of permission for global settings
*/
- function getGlobalSettings () {
+ function getGlobalSettings() {
$result = array();
- $sections = array ('forge_admin', 'forge_stats',
'approve_projects', 'approve_news') ;
+ $sections = array ('forge_admin', 'forge_stats',
'approve_projects', 'approve_news');
foreach ($sections as $section) {
- $result[$section][-1] = $this->getVal($section, -1) ;
+ $result[$section][-1] = $this->getVal($section, -1);
}
// Add settings not yet listed so far (probably plugins)
foreach (array_keys ($this->perms_array) as $section) {
if (!in_array ($section, $sections)) {
if (in_array ($section,
$this->global_settings)) {
- $result[$section][-1] = $this->getVal
($section, -1) ;
+ $result[$section][-1] = $this->getVal
($section, -1);
}
}
}
- return $result ;
+ return $result;
}
/**
@@ -471,30 +471,30 @@ abstract class BaseRole extends FFError {
$value = 0;
}
- $min = PHP_INT_MAX ;
- $mask = 0 ;
+ $min = PHP_INT_MAX;
+ $mask = 0;
switch ($section) {
case 'forge_admin':
- return $value ;
- break ;
+ return $value;
+ break;
case 'forge_read':
case 'approve_projects':
case 'approve_news':
case 'project_admin':
if ($this->hasGlobalPermission('forge_admin')) {
- return 1 ;
+ return 1;
}
- return $value ;
- break ;
+ return $value;
+ break;
case 'forge_stats':
if ($this->hasGlobalPermission('forge_admin')) {
- return 2 ;
+ return 2;
}
- return $value ;
- break ;
+ return $value;
+ break;
case 'project_read':
if ($this->hasPermission('project_admin', $reference)) {
@@ -510,26 +510,26 @@ abstract class BaseRole extends FFError {
} elseif (!$this->hasPermission('project_read',
$reference)) {
return 0;
}
- return $value ;
- break ;
+ return $value;
+ break;
case 'frs_admin':
case 'scm':
if ($this->hasPermission('project_admin', $reference)) {
- return 2 ;
+ return 2;
} elseif (!$this->hasPermission('project_read',
$reference)) {
return 0;
}
- return $value ;
- break ;
+ return $value;
+ break;
case 'docman':
if ($this->hasPermission('project_admin', $reference)) {
- return 4 ;
+ return 4;
} elseif (!$this->hasPermission('project_read',
$reference)) {
return 0;
}
- return $value ;
- break ;
+ return $value;
+ break;
case 'frs':
if ($this->hasPermission('frs_admin',
frspackage_get_groupid($reference), 'admin')) {
@@ -537,82 +537,83 @@ abstract class BaseRole extends FFError {
} elseif (!$this->hasPermission('project_read',
frspackage_get_groupid($reference))) {
return 0;
}
- return $value ;
- break ;
+ return $value;
+ break;
case 'new_frs':
if ($this->hasPermission('frs_admin', $reference,
'admin')) {
return 4;
} elseif (!$this->hasPermission('project_read',
$reference)) {
return 0;
}
- return $value ;
- break ;
+ return $value;
+ break;
+
case 'forum':
if ($this->hasPermission('forum_admin',
forum_get_groupid($reference))) {
- return 4 ;
+ return 4;
} elseif (!$this->hasPermission('project_read',
forum_get_groupid($reference))) {
return 0;
}
- return $value ;
- break ;
+ return $value;
+ break;
case 'new_forum':
if ($this->hasPermission('forum_admin', $reference)) {
- return 4 ;
+ return 4;
} elseif (!$this->hasPermission('project_read',
$reference)) {
return 0;
}
- return $value ;
- break ;
+ return $value;
+ break;
case 'tracker':
if ($this->hasPermission('tracker_admin',
artifacttype_get_groupid($reference))) {
- return 29 | $value ;
+ return 29 | $value;
} elseif (!$this->hasPermission('project_read',
artifacttype_get_groupid($reference))) {
return 0;
}
- return $value ;
- break ;
+ return $value;
+ break;
case 'new_tracker':
if ($this->hasPermission('tracker_admin', $reference)) {
- return 29 | $value ;
+ return 29 | $value;
} elseif (!$this->hasPermission('project_read',
$reference)) {
return 0;
}
- return $value ;
- break ;
+ return $value;
+ break;
case 'pm':
if ($this->hasPermission('pm_admin',
projectgroup_get_groupid($reference))) {
- return 5 | $value ;
+ return 5 | $value;
} elseif (!$this->hasPermission('project_read',
projectgroup_get_groupid($reference))) {
return 0;
}
- return $value ;
- break ;
+ return $value;
+ break;
case 'new_pm':
if ($this->hasPermission('pm_admin', $reference)) {
- return 5 | $value ;
+ return 5 | $value;
} elseif (!$this->hasPermission('project_read',
$reference)) {
return 0;
}
- return $value ;
- break ;
+ return $value;
+ break;
default:
- $hook_params = array ();
- $hook_params['role'] = $this ;
- $hook_params['section'] = $section ;
- $hook_params['reference'] = $reference ;
- $hook_params['value'] = $value ;
- $hook_params['result'] = NULL ;
+ $hook_params = array();
+ $hook_params['role'] = $this;
+ $hook_params['section'] = $section;
+ $hook_params['reference'] = $reference;
+ $hook_params['value'] = $value;
+ $hook_params['result'] = NULL;
plugin_hook_by_reference ("role_get_setting",
$hook_params);
- return $hook_params['result'] ;
- break ;
+ return $hook_params['result'];
+ break;
}
}
function getSettingRaw($section, $reference) {
if (isset ($this->perms_array[$section][$reference])) {
- return $this->perms_array[$section][$reference] ;
+ return $this->perms_array[$section][$reference];
}
}
@@ -627,7 +628,7 @@ abstract class BaseRole extends FFError {
if (!$ref_id) {
$ref_id=0;
}
- return $this->getSetting($section, $ref_id) ;
+ return $this->getSetting($section, $ref_id);
}
/**
@@ -658,10 +659,10 @@ abstract class BaseRole extends FFError {
}
function hasPermission($section, $reference, $action = NULL) {
- $result = false ;
- $value = $this->getSetting ($section, $reference) ;
- $min = PHP_INT_MAX ;
- $mask = 0 ;
+ $result = false;
+ $value = $this->getSetting ($section, $reference);
+ $min = PHP_INT_MAX;
+ $mask = 0;
switch ($section) {
case 'forge_admin':
@@ -673,48 +674,48 @@ abstract class BaseRole extends FFError {
case 'tracker_admin':
case 'pm_admin':
case 'forum_admin':
- return ($value >= 1) ;
- break ;
+ return ($value >= 1);
+ break;
case 'forge_stats':
case 'frs_admin':
switch ($action) {
case 'read':
- return ($value >= 1) ;
- break ;
+ return ($value >= 1);
+ break;
case 'admin':
- return ($value >= 2) ;
- break ;
+ return ($value >= 2);
+ break;
}
- break ;
+ break;
case 'scm':
switch ($action) {
case 'read':
- return ($value >= 1) ;
- break ;
+ return ($value >= 1);
+ break;
case 'write':
- return ($value >= 2) ;
- break ;
+ return ($value >= 2);
+ break;
}
- break ;
+ break;
case 'docman':
switch ($action) {
case 'read':
- return ($value >= 1) ;
- break ;
+ return ($value >= 1);
+ break;
case 'submit':
- return ($value >= 2) ;
- break ;
+ return ($value >= 2);
+ break;
case 'approve':
- return ($value >= 3) ;
- break ;
+ return ($value >= 3);
+ break;
case 'admin':
- return ($value >= 4) ;
- break ;
+ return ($value >= 4);
+ break;
}
- break ;
+ break;
case 'frs':
case 'new_frs':
@@ -738,66 +739,66 @@ abstract class BaseRole extends FFError {
case 'new_forum':
switch ($action) {
case 'read':
- return ($value >= 1) ;
- break ;
+ return ($value >= 1);
+ break;
case 'post':
- return ($value >= 2) ;
- break ;
+ return ($value >= 2);
+ break;
case 'unmoderated_post':
- return ($value >= 3) ;
- break ;
+ return ($value >= 3);
+ break;
case 'moderate':
- return ($value >= 4) ;
- break ;
+ return ($value >= 4);
+ break;
}
- break ;
+ break;
case 'tracker':
case 'new_tracker':
switch ($action) {
case 'read':
- return (($value & 1) != 0) ;
- break ;
+ return (($value & 1) != 0);
+ break;
case 'tech':
- return (($value & 2) != 0) ;
- break ;
+ return (($value & 2) != 0);
+ break;
case 'manager':
- return (($value & 4) != 0) ;
- break ;
+ return (($value & 4) != 0);
+ break;
case 'submit':
- return (($value & 8) != 0) ;
- break ;
+ return (($value & 8) != 0);
+ break;
case 'vote':
return (($value & 16) != 0);
break;
}
- break ;
+ break;
case 'pm':
case 'new_pm':
switch ($action) {
case 'read':
- return (($value & 1) != 0) ;
- break ;
+ return (($value & 1) != 0);
+ break;
case 'tech':
- return (($value & 2) != 0) ;
- break ;
+ return (($value & 2) != 0);
+ break;
case 'manager':
- return (($value & 4) != 0) ;
- break ;
+ return (($value & 4) != 0);
+ break;
}
- break ;
+ break;
default:
- $hook_params = array ();
- $hook_params['section'] = $section ;
- $hook_params['reference'] = $reference ;
- $hook_params['action'] = $action ;
- $hook_params['value'] = $value ;
- $hook_params['result'] = false ;
+ $hook_params = array();
+ $hook_params['section'] = $section;
+ $hook_params['reference'] = $reference;
+ $hook_params['action'] = $action;
+ $hook_params['value'] = $value;
+ $hook_params['result'] = false;
plugin_hook_by_reference ("role_has_permission",
$hook_params);
- return $hook_params['result'] ;
- break ;
+ return $hook_params['result'];
+ break;
}
}
@@ -826,10 +827,10 @@ abstract class BaseRole extends FFError {
db_begin();
- $role_id = $this->getID () ;
+ $role_id = $this->getID();
if ($role_name != $this->getName()) {
- $this->setName($role_name) ;
+ $this->setName($role_name);
}
db_prepare ('INSERT INTO pfo_role_setting (role_id,
section_name, ref_id, perm_val) VALUES ($1, $2, $3, $4)',
@@ -871,7 +872,7 @@ abstract class BaseRole extends FFError {
db_unprepare ('delete_from_pfo_role_setting');
db_unprepare ('update_pfo_role_setting');
- $hook_params = array ();
+ $hook_params = array();
$hook_params['role'] =& $this;
$hook_params['role_id'] = $this->getID();
$hook_params['data'] = $data;
@@ -895,71 +896,71 @@ abstract class BaseRole extends FFError {
function getDisplayableName($group = NULL) {
if ($this->getHomeProject() == NULL) {
return sprintf (_('%s (global role)'),
- $this->getName ()) ;
+ $this->getName());
} elseif ($group == NULL
|| $this->getHomeProject()->getID() !=
$group->getID()) {
return sprintf (_('%s (in project %s)'),
- $this->getName (),
-
$this->getHomeProject()->getPublicName()) ;
+ $this->getName(),
+
$this->getHomeProject()->getPublicName());
} else {
- return $this->getName () ;
+ return $this->getName();
}
}
- function removeObsoleteSettings () {
- db_begin () ;
+ function removeObsoleteSettings() {
+ db_begin();
// Remove obsolete project-wide settings
$sections = array ('project_read', 'project_admin',
'frs_admin', 'new_frs', 'scm', 'docman', 'tracker_admin', 'new_tracker',
'forum_admin', 'new_forum', 'pm_admin', 'new_pm');
db_query_params ('DELETE FROM pfo_role_setting where role_id=$1
AND section_name=ANY($2) and ref_id NOT IN (SELECT home_group_id FROM pfo_role
WHERE role_id=$1 AND home_group_id IS NOT NULL UNION SELECT group_id from
role_project_refs WHERE role_id=$1)',
array ($this->getID(),
-
db_string_array_to_any_clause($sections))) ;
+
db_string_array_to_any_clause($sections)));
// Remove obsolete settings for multiple-instance tools
db_query_params ('DELETE FROM pfo_role_setting where role_id=$1
AND section_name=$2 and ref_id NOT IN (SELECT group_artifact_id FROM
artifact_group_list WHERE group_id IN (SELECT home_group_id FROM pfo_role WHERE
role_id=$1 AND home_group_id IS NOT NULL UNION SELECT group_id from
role_project_refs WHERE role_id=$1))',
array ($this->getID(),
- 'tracker')) ;
+ 'tracker'));
db_query_params ('DELETE FROM pfo_role_setting where role_id=$1
AND section_name=$2 and ref_id NOT IN (SELECT group_project_id FROM
project_group_list WHERE group_id IN (SELECT home_group_id FROM pfo_role WHERE
role_id=$1 AND home_group_id IS NOT NULL UNION SELECT group_id from
role_project_refs WHERE role_id=$1))',
array ($this->getID(),
- 'pm')) ;
+ 'pm'));
db_query_params ('DELETE FROM pfo_role_setting where role_id=$1
AND section_name=$2 and ref_id NOT IN (SELECT group_forum_id FROM
forum_group_list WHERE group_id IN (SELECT home_group_id FROM pfo_role WHERE
role_id=$1 AND home_group_id IS NOT NULL UNION SELECT group_id from
role_project_refs WHERE role_id=$1))',
array ($this->getID(),
- 'forum')) ;
+ 'forum'));
db_query_params ('DELETE FROM pfo_role_setting where role_id=$1
AND section_name=$2 and ref_id NOT IN (SELECT package_id FROM frs_package WHERE
group_id IN (SELECT home_group_id FROM pfo_role WHERE role_id=$1 AND
home_group_id IS NOT NULL UNION SELECT group_id from role_project_refs WHERE
role_id=$1))',
- array ($this->getID(), 'frs')) ;
+ array ($this->getID(), 'frs'));
- db_commit () ;
+ db_commit();
$this->fetchData($this->getID());
- return true ;
+ return true;
}
function normalizePermsForSection (&$new_pa, $section, $refid) {
if (array_key_exists ($section, $this->perms_array)
&& array_key_exists ($refid, $this->perms_array[$section]))
{
- $new_pa[$section][$refid] =
$this->perms_array[$section][$refid] ;
+ $new_pa[$section][$refid] =
$this->perms_array[$section][$refid];
} elseif (array_key_exists ($this->data_array['role_name'],
$this->defaults)
&& array_key_exists ($section,
$this->defaults[$this->data_array['role_name']])) {
- $new_pa[$section][$refid] =
$this->defaults[$this->data_array['role_name']][$section] ;
+ $new_pa[$section][$refid] =
$this->defaults[$this->data_array['role_name']][$section];
} else {
- $new_pa[$section][$refid] = 0 ;
+ $new_pa[$section][$refid] = 0;
}
- return $new_pa ;
+ return $new_pa;
}
- function normalizeData () { // From the PFO spec
- $this->removeObsoleteSettings () ;
+ function normalizeData() { // From the PFO spec
+ $this->removeObsoleteSettings();
- $this->fetchData ($this->getID()) ;
+ $this->fetchData ($this->getID());
- $projects = $this->getLinkedProjects() ;
- $new_pa = array () ;
+ $projects = $this->getLinkedProjects();
+ $new_pa = array();
// Add missing settings
// ...project-wide settings
- $arr = array ('project_read', 'project_admin', 'scm', 'docman',
'frs_admin', 'new_frs', 'tracker_admin', 'new_tracker', 'forum_admin',
'new_forum', 'pm_admin', 'new_pm') ;
+ $arr = array ('project_read', 'project_admin', 'scm', 'docman',
'frs_admin', 'new_frs', 'tracker_admin', 'new_tracker', 'forum_admin',
'new_forum', 'pm_admin', 'new_pm');
foreach ($projects as $p) {
foreach ($arr as $section) {
- $this->normalizePermsForSection ($new_pa,
$section, $p->getID()) ;
+ $this->normalizePermsForSection ($new_pa,
$section, $p->getID());
}
}
$this->normalizePermsForSection($new_pa, 'forge_admin', -1);
@@ -967,9 +968,9 @@ abstract class BaseRole extends FFError {
$this->normalizePermsForSection($new_pa, 'approve_news', -1);
$this->normalizePermsForSection($new_pa, 'forge_stats', -1);
- $hook_params = array ();
+ $hook_params = array();
$hook_params['role'] =& $this;
- $hook_params['new_pa'] =& $new_pa ;
+ $hook_params['new_pa'] =& $new_pa;
plugin_hook ("role_normalize", $hook_params);
// ...tracker-related settings
@@ -985,50 +986,50 @@ abstract class BaseRole extends FFError {
$tid = $row['group_artifact_id'];
if (array_key_exists ('tracker', $this->perms_array)
&& array_key_exists ($tid,
$this->perms_array['tracker']) ) {
- $new_pa['tracker'][$tid] =
$this->perms_array['tracker'][$tid] ;
+ $new_pa['tracker'][$tid] =
$this->perms_array['tracker'][$tid];
} elseif (array_key_exists ('new_tracker',
$this->perms_array)
&& array_key_exists ($p->getID(),
$this->perms_array['new_tracker']) ) {
- $new_pa['tracker'][$tid] =
$new_pa['new_tracker'][$p->getID()] ;
+ $new_pa['tracker'][$tid] =
$new_pa['new_tracker'][$p->getID()];
}
}
// ...forum-related settings
- $new_pa['forum'] = array () ;
+ $new_pa['forum'] = array();
foreach ($projects as $p) {
if (!$p->usesForum()) {
continue;
}
- $ff = new ForumFactory ($p) ;
+ $ff = new ForumFactory ($p);
if (!$ff->isError()) {
- $fids = $ff->getAllForumIdsWithNews () ;
+ $fids = $ff->getAllForumIdsWithNews();
foreach ($fids as $fid) {
if (array_key_exists ('forum',
$this->perms_array)
&& array_key_exists ($fid,
$this->perms_array['forum']) ) {
- $new_pa['forum'][$fid] =
$this->perms_array['forum'][$fid] ;
+ $new_pa['forum'][$fid] =
$this->perms_array['forum'][$fid];
} elseif (array_key_exists
('new_forum', $this->perms_array)
&& array_key_exists
($p->getID(), $this->perms_array['new_forum']) ) {
- $new_pa['forum'][$fid] =
$new_pa['new_forum'][$p->getID()] ;
+ $new_pa['forum'][$fid] =
$new_pa['new_forum'][$p->getID()];
}
}
}
}
// ...pm-related settings
- $new_pa['pm'] = array () ;
+ $new_pa['pm'] = array();
foreach ($projects as $p) {
if (!$p->usesPM()) {
continue;
}
- $pgf = new ProjectGroupFactory ($p) ;
+ $pgf = new ProjectGroupFactory ($p);
if (!$pgf->isError()) {
- $pgids = $pgf->getAllProjectGroupIds () ;
+ $pgids = $pgf->getAllProjectGroupIds();
foreach ($pgids as $gid) {
if (array_key_exists ('pm',
$this->perms_array)
&& array_key_exists ($gid,
$this->perms_array['pm']) ) {
- $new_pa['pm'][$gid] =
$this->perms_array['pm'][$gid] ;
+ $new_pa['pm'][$gid] =
$this->perms_array['pm'][$gid];
} elseif (array_key_exists ('new_pm',
$this->perms_array)
&& array_key_exists
($p->getID(), $this->perms_array['new_pm']) ) {
- $new_pa['pm'][$gid] =
$new_pa['new_pm'][$p->getID()] ;
+ $new_pa['pm'][$gid] =
$new_pa['new_pm'][$p->getID()];
}
}
}
@@ -1045,9 +1046,9 @@ abstract class BaseRole extends FFError {
$frspids = $frspf->getAllPackagesIds();
foreach ($frspids as $frspid) {
if (array_key_exists('frs',
$this->perms_array) && array_key_exists($frspid, $this->perms_array['frs'])) {
- $new_pa['frs'][$frspid] =
$this->perms_array['frs'][$frspid] ;
+ $new_pa['frs'][$frspid] =
$this->perms_array['frs'][$frspid];
} elseif (array_key_exists('new_frs',
$this->perms_array) && array_key_exists($p->getID(),
$this->perms_array['new_frs']) ) {
- $new_pa['frs'][$frspid] =
$new_pa['new_frs'][$p->getID()] ;
+ $new_pa['frs'][$frspid] =
$new_pa['new_frs'][$p->getID()];
}
}
}
@@ -1178,8 +1179,8 @@ abstract class RoleExplicit extends BaseRole implements
PFO_RoleExplicit {
class RoleAnonymous extends BaseRole implements PFO_RoleAnonymous {
// This role is implemented as a singleton
- private static $_instance ;
- private $_role_id ;
+ private static $_instance;
+ private $_role_id;
public static function getInstance() {
if (isset(self::$_instance)) {
return self::$_instance;
@@ -1202,13 +1203,13 @@ class RoleAnonymous extends BaseRole implements
PFO_RoleAnonymous {
}
$res = db_query_params('SELECT r.role_id FROM pfo_role r,
pfo_role_class c WHERE r.role_class = c.class_id AND c.class_name = $1',
- array('PFO_RoleAnonymous')) ;
+ array('PFO_RoleAnonymous'));
if (!$res || !db_numrows($res)) {
throw new Exception(_('No PFO_RoleAnonymous role in the
database'));
}
- self::$_instance->_role_id = db_result ($res, 0, 'role_id') ;
+ self::$_instance->_role_id = db_result ($res, 0, 'role_id');
- $hook_params = array ();
+ $hook_params = array();
$hook_params['role'] =& self::$_instance;
plugin_hook ('role_get', $hook_params);
@@ -1221,13 +1222,13 @@ class RoleAnonymous extends BaseRole implements
PFO_RoleAnonymous {
return $this->_role_id;
}
public function isPublic() {
- return true ;
+ return true;
}
public function setPublic($flag) {
throw new Exception(_('Cannot setPublic() on RoleAnonymous'));
}
public function getHomeProject() {
- return NULL ;
+ return NULL;
}
public function getName() {
return _('Anonymous/not logged in');
@@ -1239,8 +1240,8 @@ class RoleAnonymous extends BaseRole implements
PFO_RoleAnonymous {
class RoleLoggedIn extends BaseRole implements PFO_RoleLoggedin {
// This role is implemented as a singleton
- private static $_instance ;
- private $_role_id ;
+ private static $_instance;
+ private $_role_id;
public static function getInstance() {
if (isset(self::$_instance)) {
return self::$_instance;
@@ -1256,7 +1257,7 @@ class RoleLoggedIn extends BaseRole implements
PFO_RoleLoggedin {
}
self::$_instance->_role_id = db_result ($res, 0, 'role_id');
- $hook_params = array ();
+ $hook_params = array();
$hook_params['role'] =& self::$_instance;
plugin_hook ('role_get', $hook_params);
@@ -1306,7 +1307,7 @@ class RoleComparator {
switch ($this->criterion) {
case 'name':
return strcoll ($a->getName(), $b->getName());
- break ;
+ break;
case 'id':
$aid = $a->getID();
$bid = $b->getID();
@@ -1342,33 +1343,33 @@ class RoleComparator {
* @return number
*/
function CompareNoRef ($a, $b) {
- $ap = $a->getHomeProject() ;
- $bp = $b->getHomeProject() ;
+ $ap = $a->getHomeProject();
+ $bp = $b->getHomeProject();
if ($ap == NULL && $bp != NULL) {
- return -1 ;
+ return -1;
} elseif ($ap != NULL && $bp == NULL) {
- return 1 ;
+ return 1;
} elseif ($ap == NULL && $bp == NULL) {
- $tmp = strcoll ($a->getName(), $b->getName()) ;
- return $tmp ;
+ $tmp = strcoll ($a->getName(), $b->getName());
+ return $tmp;
} else {
- $projcmp = new ProjectComparator () ;
- $projcmp->criterion = 'name' ;
- $tmp = $projcmp->Compare ($ap, $bp) ;
+ $projcmp = new ProjectComparator();
+ $projcmp->criterion = 'name';
+ $tmp = $projcmp->Compare ($ap, $bp);
if ($tmp) { /* Different projects, sort accordingly */
- return $tmp ;
+ return $tmp;
}
- return strcoll ($a->getName(), $b->getName()) ;
+ return strcoll ($a->getName(), $b->getName());
}
}
}
function sortRoleList (&$list, $relative_to = NULL, $criterion='composite') {
- $cmp = new RoleComparator () ;
- $cmp->criterion = $criterion ;
- $cmp->reference_project = $relative_to ;
+ $cmp = new RoleComparator();
+ $cmp->criterion = $criterion;
+ $cmp->reference_project = $relative_to;
- return usort ($list, array ($cmp, 'Compare')) ;
+ return usort ($list, array ($cmp, 'Compare'));
}
// Local Variables:
-----------------------------------------------------------------------
Summary of changes:
src/common/include/RBAC.php | 427 +++++++++++++++++-----------------
src/common/include/Role.class.php | 10 +-
src/common/tracker/actions/browse.php | 2 +-
src/common/tracker/actions/mod.php | 18 +-
src/www/forum/admin/index.php | 16 +-
src/www/pm/browse_task.php | 24 +-
6 files changed, 248 insertions(+), 249 deletions(-)
hooks/post-receive
--
FusionForge
_______________________________________________
Fusionforge-commits mailing list
[email protected]
http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-commits