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 c02bad48152ca6295e325bb8046578dbd49e1bc1 (commit)
from b18d3e3ea742fb4adbcd9d6b7b40704752e4ba67 (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=c02bad48152ca6295e325bb8046578dbd49e1bc1
commit c02bad48152ca6295e325bb8046578dbd49e1bc1
Author: Franck Villaume <[email protected]>
Date: Tue May 18 21:07:52 2021 +0200
clean-up: curly braces, remove useless vars
diff --git a/src/plugins/oauthconsumer/include/resource_api.php
b/src/plugins/oauthconsumer/include/resource_api.php
index f5c9356..ee5c399 100644
--- a/src/plugins/oauthconsumer/include/resource_api.php
+++ b/src/plugins/oauthconsumer/include/resource_api.php
@@ -11,42 +11,42 @@ class OAuthResource {
protected $provider_id;
protected $http_method;
- function __construct($url, $provider_id, $http_method, $id=0) {
+ function __construct($url, $provider_id, $http_method, $id=0) {
$this->url = $url;
$this->provider_id = $provider_id;
$this->http_method = $http_method;
$this->id = $id;
}
- public function get_id() {
+ public function get_id() {
return $this->id;
}
- function set_id($id) {
+ function set_id($id) {
$this->id = $id;
}
- public function get_url() {
+ public function get_url() {
return $this->url;
}
- public function get_provider_id() {
+ public function get_provider_id() {
return $this->provider_id;
}
- public function get_http_method() {
+ public function get_http_method() {
return $this->http_method;
}
- function write_to_db() {
+ function write_to_db() {
if ( strlen(trim( $this->url ))==0 || strlen(trim(
$this->provider_id ))==0 || strlen(trim( $this->http_method ))==0 ) {
exit_error( "Error trying to add the oauth resource.
Please try again.", 'oauthconsumer' );
}
$conn = FFOAuthDataStore::singleton();
$id = $conn->save_oauth_resource($this);
- if(!$id) {
+ if (!$id) {
exit_error("Error trying to add new oauth resource to
DB", 'oauthconsumer');
- }else {
+ } else {
$this->set_id($id);
}
}
@@ -66,33 +66,35 @@ class OAuthTransaction {
* @param array $post_data (should be in the form of an array)
* @param boolean $json
*/
- function __construct($provider, $access_token, $resource,
$post_data=NULL) {
+ function __construct($provider, $access_token, $resource,
$post_data=NULL) {
$this->consumer = new
OAuthConsumer($provider->get_consumer_key(), $provider->get_consumer_secret());
$this->token = new OAuthToken($access_token->get_token_key(),
$access_token->get_token_secret());
$this->resource = $resource;
$this->request =
OAuthRequest::from_consumer_and_token($this->consumer, $this->token,
$resource->get_http_method(), $resource->get_url(), $post_data);
}
- function send_request($not_verify_ssl=FALSE) {
+ function send_request($not_verify_ssl=FALSE) {
$hmac = new OAuthSignatureMethod_HMAC_SHA1();
$this->request->sign_request($hmac, $this->consumer,
$this->token);
- if(strcasecmp($this->resource->get_http_method(), "get")==0)
{
+ if (strcasecmp($this->resource->get_http_method(), "get")==0) {
return $this->send_http_get($not_verify_ssl);
- }elseif(strcasecmp($this->resource->get_http_method(),
"post")==0) {
+ } elseif (strcasecmp($this->resource->get_http_method(),
"post")==0) {
return $this->send_http_post($not_verify_ssl);
}
}
- function send_http_get($not_verify_ssl) {
+ function send_http_get($not_verify_ssl) {
$separator = "?";
- if
(strpos($this->request->get_normalized_http_url(),"?")!=false) $separator = "&";
+ if
(strpos($this->request->get_normalized_http_url(),"?")!=false) {
+ $separator = "&";
+ }
$curl = curl_init();
$url =
$this->request->get_normalized_http_url().$separator.$this->request->to_postdata();
curl_setopt($curl, CURLOPT_URL, $url);
- if($not_verify_ssl) {
+ if($not_verify_ssl) {
curl_setopt ($curl, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt ($curl, CURLOPT_SSL_VERIFYPEER, 0);
}
@@ -105,7 +107,7 @@ class OAuthTransaction {
return $response;
}
- function send_http_post($not_verify_ssl) {
+ function send_http_post($not_verify_ssl) {
$curl = curl_init();
curl_setopt($curl, CURLOPT_POST, TRUE);
@@ -113,7 +115,7 @@ class OAuthTransaction {
curl_setopt($curl, CURLOPT_POSTFIELDS,
$this->request->to_postdata());
curl_setopt($curl, CURLOPT_URL,
$this->request->get_normalized_http_url());
- if($not_verify_ssl) {
+ if ($not_verify_ssl) {
curl_setopt ($curl, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt ($curl, CURLOPT_SSL_VERIFYPEER, 0);
}
@@ -125,5 +127,4 @@ class OAuthTransaction {
return $response;
}
-
}
diff --git a/src/plugins/oauthconsumer/www/get_access_token.php
b/src/plugins/oauthconsumer/www/get_access_token.php
index 9ee8cab..47fd0e4 100644
--- a/src/plugins/oauthconsumer/www/get_access_token.php
+++ b/src/plugins/oauthconsumer/www/get_access_token.php
@@ -6,13 +6,13 @@ require_once 'checks.php';
oauthconsumer_CheckUser();
$providers = OAuthProvider::get_all_oauthproviders();
-if(count($providers)>0) {
+if (count($providers) > 0) {
?>
<p>To get an access token, there are three steps involved: </p>
- <ol><li>Get an unauthorized request token
- <li>Authorize the request token
- <li>Exchange the authorized request token for an access token </ol>
- <p>Select a provider from the list below and get started!</p>
+ <ol><li>Get an unauthorized request token
+ <li>Authorize the request token
+ <li>Exchange the authorized request token for an access token </ol>
+ <p>Select a provider from the list below and get started!</p>
<form action="get_access_token.php" method="post">
<select name=providers>
@@ -26,7 +26,7 @@ if(count($providers)>0) {
<?php
$f_provider_name = "Provider";
$f_provider_id = getStringFromPost('providers');
- if($f_provider_id) {
+ if ($f_provider_id) {
$f_provider = OAuthProvider::get_provider($f_provider_id);
$f_provider_name = $f_provider->get_name();
$f_consumer_key = $f_provider->get_consumer_key();
@@ -68,9 +68,9 @@ if(count($providers)>0) {
</table><br />
<?php
- if((strcasecmp(substr($f_request_token_url, 0, 5),"https")==0) ||
+ if ((strcasecmp(substr($f_request_token_url, 0, 5),"https")==0) ||
(strcasecmp(substr($f_authorization_url, 0, 5),"https")==0) ||
- (strcasecmp(substr($f_access_token_url, 0, 5),"https")==0))
{ ?>
+ (strcasecmp(substr($f_access_token_url, 0, 5),"https")==0)) { ?>
<input type="checkbox" name="not_verify_ssl">
<?php echo _('Do not verify SSL Certificate'); ?></input><br
/><br />
<?php
@@ -118,7 +118,7 @@ if(count($providers)>0) {
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
//workaround for untrusted security certificates
- if($f_not_verify_ssl) {
+ if ($f_not_verify_ssl) {
curl_setopt ($curl, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt ($curl, CURLOPT_SSL_VERIFYPEER, 0);
setcookie('NOT_VERIFY_SSL', 1, 0, '', '', false, true);
@@ -126,14 +126,14 @@ if(count($providers)>0) {
$request_token_string = curl_exec ($curl);
- if($request_token_string === false) {
+ if ($request_token_string === false) {
trigger_error(_('Error in curl: ').curl_error($curl),
E_USER_WARNING);
}
curl_close ($curl);
//print_r($request_token_string);
parse_str($request_token_string, $request_token);
- if(array_key_exists('oauth_token',
$request_token)&&array_key_exists('oauth_token_secret', $request_token)) {
+ if (array_key_exists('oauth_token',
$request_token)&&array_key_exists('oauth_token_secret', $request_token)) {
echo _("New request token received!") . "<br />";
echo _("Request Token Key") . _(": ") .
$request_token['oauth_token'] . "<br />";
echo _("Request Token Secret") . _(": ") .
$request_token['oauth_token_secret'] . "<br /><br />";
@@ -144,8 +144,9 @@ if(count($providers)>0) {
$oauth_request_token = new
OAuthToken($request_token['oauth_token'], $request_token['oauth_token_secret']);
$separator = "?";
- if (strpos($f_authorize_url,"?")!=false) $separator =
"&";
-
+ if (strpos($f_authorize_url,"?")!=false) {
+ $separator = "&";
+ }
$new_user_authorization_url = $f_authorize_url .
$separator .
"oauth_token=".$request_token['oauth_token']."&oauth_callback=".$callback_url;
//print_r($new_user_authorization_url);
@@ -174,7 +175,7 @@ if(count($providers)>0) {
if($f_authorization_url) {
header("Location:".$f_authorization_url);
}
-}else {
+} else {
echo '<p>'. _('There are no OAuth Providers registered in the database
currently. Please ask your forge administer to create one.').'</p>';
}
diff --git a/src/plugins/oauthconsumer/www/providers.php
b/src/plugins/oauthconsumer/www/providers.php
index 8db92b3..8b6ec5d 100644
--- a/src/plugins/oauthconsumer/www/providers.php
+++ b/src/plugins/oauthconsumer/www/providers.php
@@ -7,9 +7,10 @@ oauthconsumer_CheckUser();
$providers = OAuthProvider::get_all_oauthproviders();
$admin_access = false;
-if(forge_check_global_perm ('forge_admin')) $admin_access = true;
-
-if(count($providers)>0) {
+if (forge_check_global_perm ('forge_admin')) {
+ $admin_access = true;
+}
+if (count($providers)>0) {
echo $HTML->boxTop(_('OAuth Providers'));
echo $HTML->listTableTop(array(_('Name'), _('Description'), _('Consumer
Key'), _('Consumer Secret'), _('Request Token URL'), _('Authorization URL'),
_('Access Token URL')));
$i = 0;
@@ -44,8 +45,7 @@ if(count($providers)>0) {
echo $HTML->listTableBottom();
echo $HTML->boxBottom();
-}
-else {
+} else {
echo '<p>'. _('There are currently no OAuth Providers registered in the
database').'</p>';
}
diff --git a/src/plugins/oauthconsumer/www/response.php
b/src/plugins/oauthconsumer/www/response.php
index 421ee4e..d29e26d 100644
--- a/src/plugins/oauthconsumer/www/response.php
+++ b/src/plugins/oauthconsumer/www/response.php
@@ -10,14 +10,16 @@ $f_resource_url = getStringFromPost('resource_url');
$f_http_method = getStringFromPost('http');
$f_post_data = getStringFromPost('post_data');
-if(!$f_post_data) $f_post_data = NULL;
-
+if (!$f_post_data) {
+ $f_post_data = NULL;
+}
$access_token = OAuthAccessToken::get_access_token($f_token_id);
$resource = new OAuthResource($f_resource_url,
$access_token->get_provider_id(), $f_http_method);
$provider = OAuthProvider::get_provider($access_token->get_provider_id());
-if(substr($f_resource_url, -5, 5)==".json") $f_post_data =
json_decode($f_post_data, TRUE);
-
+if (substr($f_resource_url, -5, 5)==".json" {
+ $f_post_data = json_decode($f_post_data, TRUE);
+}
$transaction = new OAuthTransaction($provider, $access_token, $resource,
$f_post_data);
$response = $transaction->send_request();
@@ -65,7 +67,7 @@ if(substr($f_resource_url, -5, 5)==".json") {
print_r($response_array);
}
}
-}else {
+} else {
var_dump($response);
}
diff --git a/src/plugins/scmcpold/common/CpoldPlugin.class.php
b/src/plugins/scmcpold/common/CpoldPlugin.class.php
index 1ebba171..4e14daf 100644
--- a/src/plugins/scmcpold/common/CpoldPlugin.class.php
+++ b/src/plugins/scmcpold/common/CpoldPlugin.class.php
@@ -25,7 +25,6 @@ forge_define_config_item ('repos_path', 'scmcpold',
forge_get_config('chroot').'
class CpoldPlugin extends SCMPlugin {
function __construct() {
- global $gfconfig;
parent::__construct();
$this->name = 'scmcpold';
$this->text = 'CPOLD';
@@ -118,10 +117,6 @@ class CpoldPlugin extends SCMPlugin {
return false ;
}
- if (! $project->usesPlugin ($this->name)) {
- return false;
- }
-
$repo = forge_get_config('repos_path', 'scmcpold') . '/' .
$project->getUnixName() ;
$unix_group = 'scm_' . $project->getUnixName() ;
@@ -147,12 +142,10 @@ class CpoldPlugin extends SCMPlugin {
$tarball =
forge_get_config('scm_tarballs_path').'/'.$group_name.'-scmroot.tar.gz';
- if (! $project->usesPlugin ($this->name)) {
- return false;
- }
-
if (! $project->enableAnonSCM()) {
- if (file_exists ($tarball)) unlink ($tarball) ;
+ if (file_exists ($tarball)) {
+ unlink ($tarball) ;
+ }
return false;
}
diff --git a/src/plugins/scmsvn/common/SVNPlugin.class.php
b/src/plugins/scmsvn/common/SVNPlugin.class.php
index 4aca55c..5ed5d3b 100644
--- a/src/plugins/scmsvn/common/SVNPlugin.class.php
+++ b/src/plugins/scmsvn/common/SVNPlugin.class.php
@@ -347,8 +347,6 @@ some control over it to the project's administrator.");
if ($params['scm_plugin'] != $this->name) {
return;
}
- global $HTML;
- $useautoheight = 0;
$project = $this->checkParams($params);
if (!$project) {
return;
@@ -1175,8 +1173,9 @@ function SVNPluginCharData($parser, $chars) {
} else {
$time_ok = false;
if (!isset($notimecheck)) {
- if ($last_user !== '') // empty in e.g.
tags from cvs2svn
+ if ($last_user !== '') { // empty in
e.g. tags from cvs2svn
$usr_commits[$last_user]--;
+ }
$commits--;
}
}
@@ -1245,11 +1244,12 @@ function SVNPluginEndElement($parser, $name) {
function curl2xml($ch, $data) {
global $xml_parser;
- if (!xml_parse($xml_parser, $data, false))
+ if (!xml_parse($xml_parser, $data, false)) {
exit_error('Unable to parse XML with error '
.
xml_error_string(xml_get_error_code($xml_parser))
. ' on line ' .
xml_get_current_line_number($xml_parser),
'activity');
+ }
return strlen($data);
}
// Local Variables:
diff --git a/src/plugins/scmsvn/libexec/svnlog.php
b/src/plugins/scmsvn/libexec/svnlog.php
index aecf6e5..87759d9 100644
--- a/src/plugins/scmsvn/libexec/svnlog.php
+++ b/src/plugins/scmsvn/libexec/svnlog.php
@@ -51,31 +51,37 @@ if (!preg_match(',^/anonscm/,', $_SERVER['REQUEST_URI'])) {
$unix_group_name = $_GET['unix_group_name'];
$mode = $_GET['mode'];
-if (!preg_match('/^(date_range|latest|latest_user)$/', $mode))
+if (!preg_match('/^(date_range|latest|latest_user)$/', $mode)) {
die('Invalid mode');
-if (!preg_match('/^[a-z0-9][-a-z0-9_\.]+\z/', $unix_group_name))
+}
+if (!preg_match('/^[a-z0-9][-a-z0-9_\.]+\z/', $unix_group_name)) {
die('Invalid group name');
+}
if ($mode == 'date_range') {
$start_time = $_GET['begin'];
$end_time = $_GET['end'];
- if (!ctype_digit($start_time))
+ if (!ctype_digit($start_time)) {
die('Invalid start time');
- if (!ctype_digit($end_time))
+ }
+ if (!ctype_digit($end_time)) {
die('Invalid end time');
+ }
$d1 = date('Y-m-d', $start_time - 80000);
$d2 = date('Y-m-d', $end_time + 80000);
$options = "-r '{".$d2."}:{".$d1."}'";
} elseif ($mode == 'latest' or $mode == 'latest_user') {
$limit = $_GET['limit'];
- if (!ctype_digit($limit))
+ if (!ctype_digit($limit)) {
die('Invalid limit');
+ }
$options = "--limit $limit";
if ($mode == 'latest_user') {
$user_name = $_GET['user_name'];
- if (!preg_match('/^[a-z0-9][-a-z0-9_\.]+\z/', $user_name))
+ if (!preg_match('/^[a-z0-9][-a-z0-9_\.]+\z/', $user_name)) {
die('Invalid user name');
+ }
$options .= " --search '$user_name'";
}
}
diff --git a/src/plugins/sysauthldap/common/SysAuthLDAPPlugin.class.php
b/src/plugins/sysauthldap/common/SysAuthLDAPPlugin.class.php
index 7ffad4e..2bd9de0 100644
--- a/src/plugins/sysauthldap/common/SysAuthLDAPPlugin.class.php
+++ b/src/plugins/sysauthldap/common/SysAuthLDAPPlugin.class.php
@@ -99,8 +99,12 @@ for other uses).");
}
function user_update($params) {
- if (!forge_get_config('enabled',$this->name)) return true;
- if (!$this->_connect()) { exit_error("Error connecting to
LDAP"); }
+ if (!forge_get_config('enabled',$this->name)) {
+ return true;
+ }
+ if (!$this->_connect()) {
+ exit_error("Error connecting to LDAP");
+ }
$user = $params['user'];
@@ -149,11 +153,13 @@ for other uses).");
}
function user_delete($params) {
- if (!forge_get_config('enabled',$this->name)) return true;
- if (!$this->_connect()) { exit_error("Error connecting to
LDAP"); }
-
+ if (!forge_get_config('enabled',$this->name)) {
+ return true;
+ }
+ if (!$this->_connect()) {
+ exit_error("Error connecting to LDAP");
+ }
$user = $params['user'];
-
return $this->_user_delete($user);
}
diff --git a/src/plugins/taskboard/common/TaskBoardPlugin.class.php
b/src/plugins/taskboard/common/TaskBoardPlugin.class.php
index 5f30bc8..537b430 100644
--- a/src/plugins/taskboard/common/TaskBoardPlugin.class.php
+++ b/src/plugins/taskboard/common/TaskBoardPlugin.class.php
@@ -45,10 +45,12 @@ class TaskBoardPlugin extends Plugin {
} elseif ($hookname == 'groupmenu') {
$group_id = $params['group'];
$group = group_get_object($group_id);
- if (!$group || !is_object($group))
+ if (!$group || !is_object($group)) {
return;
- if ($group->isError())
+ }
+ if ($group->isError()) {
return;
+ }
if($group->usesPlugin($this->name)) {
$params['TITLES'][] = $this->text;
diff --git a/src/plugins/taskboard/common/views/admin/trackers.php
b/src/plugins/taskboard/common/views/admin/trackers.php
index c16956a..b6d0fe3 100644
--- a/src/plugins/taskboard/common/views/admin/trackers.php
+++ b/src/plugins/taskboard/common/views/admin/trackers.php
@@ -46,9 +46,7 @@ if (!$atf || !is_object($atf) || $atf->isError()) {
$trackers = array();
//select trackers, having resolution field
for ($j = 0; $j < count($at_arr); $j++) {
- if (is_object($at_arr[$j])) {
- if( $at_arr[$j]->getID() )
-
+ if (is_object($at_arr[$j]) && $at_arr[$j]->getID()) {
$fields = $at_arr[$j]->getExtraFields();
foreach( $fields as $field) {
if( $field['alias'] == 'resolution' ) {
diff --git a/src/plugins/trackermonitor/common/trackermonitor-init.php
b/src/plugins/trackermonitor/common/trackermonitor-init.php
index fa2984d..7481739 100644
--- a/src/plugins/trackermonitor/common/trackermonitor-init.php
+++ b/src/plugins/trackermonitor/common/trackermonitor-init.php
@@ -1,5 +1,4 @@
<?php
-
/**
*
* This file is part of FusionForge.
@@ -25,8 +24,3 @@ require_once
$gfplugins.'trackermonitor/include/TrackerMonitorPlugin.class.php'
$trackermonitorPluginObject = new TrackerMonitorPlugin ;
register_plugin ($trackermonitorPluginObject) ;
-
-// Local Variables:
-// mode: php
-// c-file-style: "bsd"
-// End:
diff --git a/src/plugins/trackermonitor/include/TrackerMonitorPlugin.class.php
b/src/plugins/trackermonitor/include/TrackerMonitorPlugin.class.php
index c245061..5617c79 100644
--- a/src/plugins/trackermonitor/include/TrackerMonitorPlugin.class.php
+++ b/src/plugins/trackermonitor/include/TrackerMonitorPlugin.class.php
@@ -47,8 +47,3 @@ class TrackerMonitorPlugin extends Plugin {
}
}
}
-
-// Local Variables:
-// mode: php
-// c-file-style: "bsd"
-// End:
diff --git
a/src/plugins/trackermonitor/include/TrackerMonitorPluginDescriptor.class.php
b/src/plugins/trackermonitor/include/TrackerMonitorPluginDescriptor.class.php
index 8a12733..76475d7 100644
---
a/src/plugins/trackermonitor/include/TrackerMonitorPluginDescriptor.class.php
+++
b/src/plugins/trackermonitor/include/TrackerMonitorPluginDescriptor.class.php
@@ -20,8 +20,7 @@
require_once 'common/plugin/PluginDescriptor.class.php';
class TrackerMonitorPluginDescriptor extends PluginDescriptor {
-
- function __construct() {
- parent::__construct(_('TrackerMonitor'), 'v1.0', _("Project
administrators can view and edit tracker monitoring status for users"));
- }
+ function __construct() {
+ parent::__construct(_('TrackerMonitor'), 'v1.0', _("Project
administrators can view and edit tracker monitoring status for users"));
+ }
}
diff --git
a/src/plugins/trackermonitor/include/TrackerMonitorPluginInfo.class.php
b/src/plugins/trackermonitor/include/TrackerMonitorPluginInfo.class.php
index c26ff3c..aea1777 100644
--- a/src/plugins/trackermonitor/include/TrackerMonitorPluginInfo.class.php
+++ b/src/plugins/trackermonitor/include/TrackerMonitorPluginInfo.class.php
@@ -22,10 +22,8 @@ require_once 'common/plugin/PluginInfo.class.php';
require_once 'TrackerMonitorPluginDescriptor.class.php';
class TrackerMonitorPluginInfo extends PluginInfo {
-
- function __construct(&$plugin) {
- parent::__construct($plugin);
- $this->setPluginDescriptor(new TrackerMonitorPluginDescriptor());
- }
-
+ function __construct(&$plugin) {
+ parent::__construct($plugin);
+ $this->setPluginDescriptor(new
TrackerMonitorPluginDescriptor());
+ }
}
diff --git
a/src/plugins/trackermonitor/include/tracker/views/form-showmonitor.php
b/src/plugins/trackermonitor/include/tracker/views/form-showmonitor.php
index 5a1e00f..f82da7c 100644
--- a/src/plugins/trackermonitor/include/tracker/views/form-showmonitor.php
+++ b/src/plugins/trackermonitor/include/tracker/views/form-showmonitor.php
@@ -1,8 +1,25 @@
<?php
-//
-//show which user has activated monitoring on this tracker.
+/**
+ * show which user has activated monitoring on this tracker.
+ *
+ * This file is part of FusionForge.
+ *
+ * FusionForge is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
-$title = sprintf(_('Show which user has activated monitoring on the tracker
%s'),$ath->getName());
+$title = _('Show which user has activated monitoring on the tracker').'
'.$ath->getName();
$ath->adminHeader(array ('title'=>$title, 'modal'=>1));
switch (getStringFromRequest('func')) {
@@ -13,14 +30,15 @@ switch (getStringFromRequest('func')) {
$groupMemberIds = array_map(function($user) {
return $user->getID();
}, $group->getMembers());
- if (in_array($user_id,$groupMemberIds)) {
+
+ if (in_array($user_id,$groupMemberIds)) {
// Fix to prevent collision with the start variable
used in browse.
$_GET['start'] = 0;
- if ($start && $ath->isMonitoring($user_id))
+ if ($start && $ath->isMonitoring($user_id)) {
$feedback = _('Monitoring Started');
- elseif ($stop && !$ath->isMonitoring($user_id))
+ } elseif ($stop && !$ath->isMonitoring($user_id)) {
$feedback = _('Monitoring Deactivated');
- else {
+ } else {
$ath->setMonitor($user_id);
$feedback=$ath->getErrorMessage();
$ath->clearError();
@@ -41,8 +59,7 @@ $headers = array(
echo $GLOBALS['HTML']->listTableTop($headers);
$users = $ath->Group->getUsers();
-foreach ($users as &$user)
-{
+foreach ($users as &$user) {
$link =
'/tracker/admin/?group_id='.$group_id.'&atid='.$atid.'&show_monitor=1&func=monitor&user_id='.$user->getID();
if ($ath->isMonitoring($user->getID())) {
$label = _('Stop Monitor');
@@ -59,8 +76,3 @@ foreach ($users as &$user)
}
echo $GLOBALS['HTML']->listTableBottom();
$ath->footer(array());
-
-// Local Variables:
-// mode: php
-// c-file-style: "bsd"
-// End:
diff --git a/src/plugins/webanalytics/common/webanalyticsPlugin.class.php
b/src/plugins/webanalytics/common/webanalyticsPlugin.class.php
index 2f3104c..411e3ed 100644
--- a/src/plugins/webanalytics/common/webanalyticsPlugin.class.php
+++ b/src/plugins/webanalytics/common/webanalyticsPlugin.class.php
@@ -100,9 +100,9 @@ such as Piwik or Google Analytics.");
$url,
1,
));
- if (!$res)
+ if (!$res) {
return false;
-
+ }
return true;
}
return false;
@@ -154,7 +154,6 @@ such as Piwik or Google Analytics.");
* @return bool success or not
*/
function getHeader($type) {
- global $gfplugins;
$returned = false;
switch ($type) {
case 'globaladmin': {
diff --git a/src/www/admin/grouplist.php b/src/www/admin/grouplist.php
index 48d6ff6..1946ee3 100644
--- a/src/www/admin/grouplist.php
+++ b/src/www/admin/grouplist.php
@@ -41,9 +41,9 @@ if (getStringFromRequest('setpaging')) {
$paging = $LUSER->getPreference('paging');
}
-if (!$paging)
+if (!$paging) {
$paging = 25;
-
+}
$start = getIntFromRequest('start');
if ($start < 0) {
$start = 0;
@@ -204,8 +204,3 @@ if (count($rows)) {
}
site_admin_footer();
-
-// Local Variables:
-// mode: php
-// c-file-style: "bsd"
-// End:
diff --git a/src/www/admin/trove/trove_cat_edit.php
b/src/www/admin/trove/trove_cat_edit.php
index b98a445..6019e9c 100644
--- a/src/www/admin/trove/trove_cat_edit.php
+++ b/src/www/admin/trove/trove_cat_edit.php
@@ -128,7 +128,9 @@ if ($row_cat["parent"] == 0) {
print('>root</option>');
while ($row_parent = db_fetch_array($res_parent)) {
print ('<option value="'.$row_parent["trove_cat_id"].'"');
- if ($row_cat["parent"] == $row_parent["trove_cat_id"]) print '
selected="selected"';
+ if ($row_cat["parent"] == $row_parent["trove_cat_id"]) {
+ print ' selected="selected"';
+ }
print ('>'.$row_parent["fullname"]."</option>\n");
}
@@ -151,8 +153,3 @@ while ($row_parent = db_fetch_array($res_parent)) {
<?php
echo $HTML->closeForm();
site_admin_footer();
-
-// Local Variables:
-// mode: php
-// c-file-style: "bsd"
-// End:
diff --git a/src/www/admin/trove/trove_cat_list.php
b/src/www/admin/trove/trove_cat_list.php
index e80a18d..ac91f2f 100644
--- a/src/www/admin/trove/trove_cat_list.php
+++ b/src/www/admin/trove/trove_cat_list.php
@@ -32,9 +32,9 @@ function printnode ($nodeid,$text) {
global $HTML;
print ('<br />');
- if (!isset($GLOBALS['depth']))
+ if (!isset($GLOBALS['depth'])) {
$GLOBALS['depth'] = 0;
-
+ }
for ($i=0;$i<$GLOBALS['depth'];$i++) {
print " ";
}
@@ -74,8 +74,3 @@ site_admin_header(array('title'=>_('Browse Trove Tree')));
printnode(0,'root');
site_admin_footer();
-
-// Local Variables:
-// mode: php
-// c-file-style: "bsd"
-// End:
diff --git a/src/www/admin/useredit.php b/src/www/admin/useredit.php
index e178ed3..6390e23 100644
--- a/src/www/admin/useredit.php
+++ b/src/www/admin/useredit.php
@@ -106,12 +106,14 @@ if (getStringFromRequest('delete_user') != '') {
if ($u->isError()) {
$error_msg = $u->getErrorMessage();
- if (isset($error_msgMembership) && sizeof($error_msgMembership))
+ if (isset($error_msgMembership) &&
sizeof($error_msgMembership)) {
$error_msg .= '<br/>'.$error_msgMembership;
+ }
} else {
$feedback = _('Updated');
- if (isset($feedbackMembership) && sizeof($feedbackMembership))
+ if (isset($feedbackMembership) && sizeof($feedbackMembership)) {
$feedback .= '<br/>'.$feedbackMembership;
+ }
}
}
diff --git a/src/www/admin/userlist.php b/src/www/admin/userlist.php
index a4e97a1..ce14dce 100644
--- a/src/www/admin/userlist.php
+++ b/src/www/admin/userlist.php
@@ -175,9 +175,9 @@ if (getStringFromRequest('setpaging')) {
$paging = $LUSER->getPreference('paging');
}
-if (!$paging)
+if (!$paging) {
$paging = 25;
-
+}
// Administrative functions
$group_id = getIntFromRequest('group_id');
diff --git a/src/www/developer/index.php b/src/www/developer/index.php
index 9165860..98a6df7 100644
--- a/src/www/developer/index.php
+++ b/src/www/developer/index.php
@@ -36,13 +36,13 @@ if (!forge_get_config('use_diary')) {
$diary_user = getIntFromRequest('diary_user');
/* validate user */
-if (!$diary_user)
+if (!$diary_user) {
exit_no_user();
-
+}
$user = user_get_object($diary_user);
-if (!$user || !is_object($user) || !$user->isActive())
+if (!$user || !is_object($user) || !$user->isActive()) {
exit_no_user();
-
+}
$diaryNoteFactoryObject = new diaryNoteFactory(user_get_object($diary_user));
if (!$diaryNoteFactoryObject) {
diff --git a/src/www/docman/index.php b/src/www/docman/index.php
index f58a4c4..1ee9a95 100644
--- a/src/www/docman/index.php
+++ b/src/www/docman/index.php
@@ -47,29 +47,29 @@ require_once $gfcommon.'include/html.php';
require_once
$gfwww.'search/include/renderers/DocsHtmlSearchRenderer.class.php';
/* are we using docman ? */
-if (!forge_get_config('use_docman'))
+if (!forge_get_config('use_docman')) {
exit_disabled('home');
-
+}
/* get informations from request or $_POST */
$group_id = getIntFromRequest('group_id');
/* validate group */
-if (!$group_id)
+if (!$group_id) {
exit_no_group();
-
+}
$g = group_get_object($group_id);
-if (!$g || !is_object($g))
+if (!$g || !is_object($g)) {
exit_no_group();
-
+}
session_require_perm('docman', $group_id, 'read');
/* is this group using docman ? */
-if (!$g->usesDocman())
+if (!$g->usesDocman()) {
exit_disabled();
-
-if ($g->isError())
+}
+if ($g->isError()) {
exit_error($g->getErrorMessage(), 'docman');
-
+}
$childgroup_id = getIntFromRequest('childgroup_id', 0);
$dirid = getIntFromRequest('dirid', 0);
if ($dirid) {
@@ -90,9 +90,9 @@ if
(file_exists(forge_get_config('source_path').'/common/docman/actions/'.$actio
}
$start = getIntFromRequest('start', 0);
-if ($start < 0)
+if ($start < 0) {
$start = 0;
-
+}
html_use_storage();
html_use_simplemenu();
html_use_jqueryui();
diff --git a/src/www/docman/view.php b/src/www/docman/view.php
index 7be2026..3e3db6a 100644
--- a/src/www/docman/view.php
+++ b/src/www/docman/view.php
@@ -142,13 +142,13 @@ if (is_numeric($docid)) {
session_require_perm('docman', $group_id, 'admin');
$df = new DocumentFactory($g);
- if ($df->isError())
+ if ($df->isError()) {
exit_error($df->getErrorMessage(), 'docman');
-
+ }
$dgf = new DocumentGroupFactory($g);
- if ($dgf->isError())
+ if ($dgf->isError()) {
exit_error($dgf->getErrorMessage(), 'docman');
-
+ }
$nested_groups = $dgf->getNested(array(1, 5));
if ( $nested_groups != NULL ) {
@@ -219,17 +219,17 @@ if (is_numeric($docid)) {
$dirid = $arr[6];
$dg = new DocumentGroup($g, $dirid);
- if ($dg->isError())
+ if ($dg->isError()) {
exit_error($dg->getErrorMessage(), 'docman');
-
+ }
$df = new DocumentFactory($g);
- if ($df->isError())
+ if ($df->isError()) {
exit_error($df->getErrorMessage(), 'docman');
-
+ }
$dgf = new DocumentGroupFactory($g);
- if ($dgf->isError())
+ if ($dgf->isError()) {
exit_error($dgf->getErrorMessage(), 'docman');
-
+ }
$stateidArr = array(1);
if (forge_check_perm('docman', $g->getID(), 'approve'))
{
$stateidArr = array(1, 4, 5);
@@ -263,8 +263,9 @@ if (is_numeric($docid)) {
if ($doc->isURL()) {
continue;
}
- if
(!$zip->addFromString(iconv("UTF-8", "ASCII//TRANSLIT", $doc->getFileName()),
$doc->getFileData()))
+ if
(!$zip->addFromString(iconv("UTF-8", "ASCII//TRANSLIT", $doc->getFileName()),
$doc->getFileData())) {
exit_error(_('Unable to
fill ZIP file.'), 'docman');
+ }
}
}
if ( !docman_fill_zip($zip, $nested_groups,
$df, $dg->getID())) {
diff --git a/src/www/export/rss20_activity.php
b/src/www/export/rss20_activity.php
index fc9fcf4..a2903f7 100644
--- a/src/www/export/rss20_activity.php
+++ b/src/www/export/rss20_activity.php
@@ -32,8 +32,9 @@ global $HTML;
$group_id = getIntFromRequest('group_id');
$limit = getIntFromRequest('limit', 10);
-if ($limit > 100) $limit = 100;
-
+if ($limit > 100) {
+ $limit = 100;
+}
if ($group_id) {
session_require_perm('project_read', $group_id);
diff --git a/src/www/export/rss20_docman.php b/src/www/export/rss20_docman.php
index 586205e..fd4a776 100644
--- a/src/www/export/rss20_docman.php
+++ b/src/www/export/rss20_docman.php
@@ -33,8 +33,9 @@ $sysdebug_enable = false;
$group_id = getIntFromRequest('group_id');
$limit = getIntFromRequest('limit', 10);
-if ($limit > 100) $limit = 100;
-
+if ($limit > 100) {
+ $limit = 100;
+}
if (isset($group_id) && !empty($group_id) && is_numeric($group_id)) {
session_require_perm('project_read', $group_id);
$group = group_get_object($group_id);
@@ -144,7 +145,9 @@ function writeFeed($d_arr, $limit) {
}//else (everything ok)
print " </item>\n";
- if ($j >= $limit) break;
+ if ($j >= $limit) {
+ break;
+ }
}//for loop
}//else (there are documents)
}
diff --git a/src/www/export/rss20_forum.php b/src/www/export/rss20_forum.php
index d74e30e..60d7195 100644
--- a/src/www/export/rss20_forum.php
+++ b/src/www/export/rss20_forum.php
@@ -111,41 +111,44 @@ if
(isset($_GET['group_ids'])&&!empty($_GET['group_ids'])) {
// ----------- add forums called by forum_ids param, if any ------------
if (isset($_GET['forum_ids']) && !empty($_GET['forum_ids'])) {
- //explode: http changes "+" to " "
- $forum_ids = array_unique(explode(' ',$_GET['forum_ids']));
-
- foreach ($forum_ids as $fid){
- //we got strings from explode(), cast them to int (if possible)
- $fid= (int) $fid;
-
- if (is_numeric($fid)) {
- //based on code from forum/forum.php: Get the group_id based on
this forum_id
- $result=db_query_params('SELECT group_id FROM forum_group_list
- WHERE group_forum_id=$1',
- array ($fid));
- if ($result && db_numrows($result) >= 1) {
- $forum_group_id=db_result($result,0,'group_id');
-
- $g = group_get_object($forum_group_id);
- if ($g && is_object($g) && !$g->isError() && $g->isPublic() &&
$g->usesForum()) {
- $f=new Forum($g,$fid);
-
- if ($f && is_object($f) && !$f->isError() &&
$f->isPublic()) {
- //add group to group array, forum to forum array
- $groups[] = $g;
- $farr[] = $f;
- //valid forums from forum_ids param (needed for feed
title)
- $n_forum_ids++;
- }
- else error_log("Forum RSS: forum object error",0);
- }
- else error_log("Forum RSS: forum group oject error",0);
- }//there is a db result
- else error_log("Forum RSS: no forum group in DB",0);
- }//url param is valid (numeric)
- else error_log("Forum RSS: invalid forum_ids param",0);
- }//for loop
-
+ //explode: http changes "+" to " "
+ $forum_ids = array_unique(explode(' ',$_GET['forum_ids']));
+
+ foreach ($forum_ids as $fid){
+ //we got strings from explode(), cast them to int (if possible)
+ $fid= (int) $fid;
+
+ if (is_numeric($fid)) {
+ //based on code from forum/forum.php: Get the group_id based on
this forum_id
+ $result=db_query_params('SELECT group_id FROM
forum_group_list
+ WHERE group_forum_id=$1',
+ array ($fid));
+ if ($result && db_numrows($result) >= 1) {
+ $forum_group_id=db_result($result,0,'group_id');
+
+ $g = group_get_object($forum_group_id);
+ if ($g && is_object($g) && !$g->isError() &&
$g->isPublic() && $g->usesForum()) {
+ $f=new Forum($g,$fid);
+
+ if ($f && is_object($f) &&
!$f->isError() && $f->isPublic()) {
+ //add group to group array,
forum to forum array
+ $groups[] = $g;
+ $farr[] = $f;
+ //valid forums from forum_ids
param (needed for feed title)
+ $n_forum_ids++;
+ } else {
+ error_log("Forum RSS: forum
object error",0);
+ }
+ } else {
+ error_log("Forum RSS: forum group oject
error",0);
+ }
+ } else { //there is a db result
+ error_log("Forum RSS: no forum group in DB",0);
+ }
+ } else { //url param is valid (numeric)
+ error_log("Forum RSS: invalid forum_ids param",0);
+ }
+ } //for loop
}
//if forum_ids specifies forums contained also in group_ids: drop duplicates
@@ -167,7 +170,7 @@ $error_no_messages = false;
if (($n_groups == 0 && isset($_GET['group_ids']) &&
count($_GET['group_ids'])>0) ||
($n_forums == 0 && isset($_GET['forum_ids']) &&
count($_GET['forum_ids'])>0) ||
- ($n_groups > 0 && $n_forums == 0)){
+ ($n_groups > 0 && $n_forums == 0)) {
$error_no_messages = "No forum messages found. Please check for invalid
parameters and if the project(s) contain public forums.";
}
@@ -175,17 +178,19 @@ if (($n_groups == 0 && isset($_GET['group_ids']) &&
count($_GET['group_ids'])>0)
//-------------------- other parameters --------------------
//number
-if (isset($_GET['number']) && !empty($_GET['number']) &&
- is_numeric($_GET['number']) && $_GET['number']>0) {
- $number_items = $_GET['number'];
- if ($number_items > $max_number_items) $number_items = $max_number_items;
+if (isset($_GET['number']) && !empty($_GET['number']) &&
is_numeric($_GET['number']) && $_GET['number']>0) {
+ $number_items = $_GET['number'];
+ if ($number_items > $max_number_items) {
+ $number_items = $max_number_items;
+ }
}
//item
if (isset($_GET['item']) && !empty($_GET['item']) && ($_GET['item'] ==
"posting")) {
- $show_threads = false;
+ $show_threads = false;
+} else {
+ $where_threads = " AND is_followup_to=0";
}
-else $where_threads = " AND is_followup_to=0";
// ------------- general settings and defaults for filtered and non-filtered
feeds -------------
@@ -198,24 +203,25 @@ $feed_desc = forge_get_config('forge_name')." Forums";
//more than one group and/or multiple forums -> title is "Selected Evolvis
Forums..."; link is default
if ($n_groups>1 || $n_forums>0) {
- $feed_title = "Selected ".$feed_title;
- if ($debug) error_log ("Forum RSS: g: ".$n_groups." f: ".$n_forums,0);
+ $feed_title = "Selected ".$feed_title;
+ if ($debug) {
+ error_log ("Forum RSS: g: ".$n_groups." f: ".$n_forums,0);
+ }
}
//one group and no forum param -> Groupname in feed title; link to group
-if ($n_groups == 1 && $n_forum_ids == 0){
- $feed_title = $groups[0]->getPublicName()." Forums: ".$feed_title_desc;
- $feed_link = $feed_link . "/forum/?group_id=".$groups[0]->getID();
- $feed_desc = $groups[0]->getDescription(); //Feed desc = project desc
+if ($n_groups == 1 && $n_forum_ids == 0) {
+ $feed_title = $groups[0]->getPublicName()." Forums: ".$feed_title_desc;
+ $feed_link = $feed_link . "/forum/?group_id=".$groups[0]->getID();
+ $feed_desc = $groups[0]->getDescription(); //Feed desc = project desc
}
//one forum and no (valid) group param
//-> forum's group name and forum name in feed title; link to forum
-if ($n_forum_ids == 1 && $n_group_ids == 0){
- $forum_group = $forums[0]->getGroup();
+if ($n_forum_ids == 1 && $n_group_ids == 0) {
+ $forum_group = $forums[0]->getGroup();
- $feed_title = $forum_group->getPublicName().' - "'
.$forums[0]->getName().'" forum: '.
- $feed_title_desc;
- $feed_link = $feed_link . "/forum/forum.php?forum_id=".$forums[0]->getID();
- $feed_desc = $forums[0]->getDescription();
+ $feed_title = $forum_group->getPublicName().' - "'
.$forums[0]->getName().'" forum: '.$feed_title_desc;
+ $feed_link = $feed_link .
"/forum/forum.php?forum_id=".$forums[0]->getID();
+ $feed_desc = $forums[0]->getDescription();
}
// --------------------------- build the feed -------------------------------
@@ -225,69 +231,66 @@ beginForumFeed($feed_title, $feed_link, $feed_desc);
// ----------------- collect the messages -----------
//only if no $error_no_messages
-if (!$error_no_messages){
- //messages to be displayed
- $rss_messages = array();
-
- //get forum messages
- $qpa = db_construct_qpa() ;
- $qpa = db_construct_qpa($qpa, 'SELECT f.group_forum_id AS group_forum_id,
- f.msg_id AS msg_id, f.subject AS subject, f.most_recent_date
AS most_recent_date,
- f.has_followups, f.thread_id,
- u.realname AS user_realname,
- g.group_id AS group_id, g.group_name as group_name,
- fg.forum_name as forum_name, fg.description AS forum_desc
- FROM forum f,users u, groups g,forum_group_list fg
- WHERE f.posted_by=u.user_id
- AND g.group_id = fg.group_id
- AND f.group_forum_id = fg.group_forum_id
- AND g.status=$1
- AND g.use_forum=1 ',
- array ('A')) ;
- $cnt = 0;
- if ($n_forums > 0) {
- $qpa = db_construct_qpa($qpa, 'AND (') ;
- foreach ($forums as $f){
- $qpa = db_construct_qpa($qpa, 'f.group_forum_id = $1',
- array ($f->getID())) ;
- $cnt++ ;
- if ($cnt < $n_forums) {
- $qpa = db_construct_qpa($qpa, ' OR ') ;
- }
- }
- $qpa = db_construct_qpa($qpa, ') ') ;
- }
-
- $qpa = db_construct_qpa($qpa, 'ORDER BY f.most_recent_date DESC LIMIT $1',
- array ($number_items)) ;
-
- $res_msg = db_query_qpa($qpa);
- if (!$res_msg) {
- error_log(_("Forum RSS: Forum not found: ").' '.db_error(),0);
- }
-
- while ($row_msg = db_fetch_array($res_msg)) {
- if (!forge_check_perm('forum',$row_msg['group_forum_id'],'read')) {
- continue;
- }
- //get thread name for posting
- $res_thread = db_query_params('SELECT subject FROM forum WHERE
is_followup_to=0 AND thread_id = $1',
- array ($row_msg['thread_id']));
- $row_thread = db_fetch_array($res_thread);
- if (!$res_thread || db_numrows($res_thread) != 1) {
- error_log("Forum RSS: Could not get thread subject to
thread-ID ".$row_msg['thread_id'],0);
- }
- //category: Project name - Forum Name - Thread Name
- $item_cat = $row_msg['group_name']." - ".$row_msg['forum_name']." --
".$row_thread['subject'];
- writeForumFeed($row_msg, $item_cat);
- }
-}//end no $error_no_messages
-else {
- displayError($error_no_messages);
-}
-endFeed();
+if (!$error_no_messages) {
+ //messages to be displayed
+ $rss_messages = array();
+
+ //get forum messages
+ $qpa = db_construct_qpa() ;
+ $qpa = db_construct_qpa($qpa, 'SELECT f.group_forum_id AS
group_forum_id,
+ f.msg_id AS msg_id, f.subject AS
subject, f.most_recent_date AS most_recent_date,
+ f.has_followups, f.thread_id,
+ u.realname AS user_realname,
+ g.group_id AS group_id, g.group_name as
group_name,
+ fg.forum_name as forum_name,
fg.description AS forum_desc
+ FROM forum f,users u, groups
g,forum_group_list fg
+ WHERE f.posted_by=u.user_id
+ AND g.group_id = fg.group_id
+ AND f.group_forum_id = fg.group_forum_id
+ AND g.status=$1
+ AND g.use_forum=1 ',
+ array ('A')) ;
+ $cnt = 0;
+ if ($n_forums > 0) {
+ $qpa = db_construct_qpa($qpa, 'AND (') ;
+ foreach ($forums as $f) {
+ $qpa = db_construct_qpa($qpa, 'f.group_forum_id = $1',
+ array ($f->getID())) ;
+ $cnt++ ;
+ if ($cnt < $n_forums) {
+ $qpa = db_construct_qpa($qpa, ' OR ') ;
+ }
+ }
+ $qpa = db_construct_qpa($qpa, ') ') ;
+ }
+
+ $qpa = db_construct_qpa($qpa, 'ORDER BY f.most_recent_date DESC LIMIT
$1',
+ array ($number_items)) ;
+ $res_msg = db_query_qpa($qpa);
+ if (!$res_msg) {
+ error_log(_("Forum RSS: Forum not found: ").' '.db_error(),0);
+ }
+ while ($row_msg = db_fetch_array($res_msg)) {
+ if
(!forge_check_perm('forum',$row_msg['group_forum_id'],'read')) {
+ continue;
+ }
+ //get thread name for posting
+ $res_thread = db_query_params('SELECT subject FROM forum WHERE
is_followup_to=0 AND thread_id = $1',
+ array ($row_msg['thread_id']));
+ $row_thread = db_fetch_array($res_thread);
+ if (!$res_thread || db_numrows($res_thread) != 1) {
+ error_log("Forum RSS: Could not get thread subject to
thread-ID ".$row_msg['thread_id'],0);
+ }
+ //category: Project name - Forum Name - Thread Name
+ $item_cat = $row_msg['group_name']." -
".$row_msg['forum_name']." -- ".$row_thread['subject'];
+ writeForumFeed($row_msg, $item_cat);
+ }
+} else { //end no $error_no_messages
+ displayError($error_no_messages);
+}
+endFeed();
//*********************** HELPER FUNCTIONS
***************************************
function beginForumFeed($feed_title, $feed_link, $feed_desc) {
@@ -315,23 +318,20 @@ function beginForumFeed($feed_title, $feed_link,
$feed_desc) {
print " </image>\n";
}
-function writeForumFeed($msg, $item_cat){
- global $show_threads;
-
- $link = "forum/message.php?msg_id=".$msg['msg_id'];
-
- //------------ build one feed item ------------
- print " <item>\n";
- print " <title>".$msg['subject']."</title>\n";
- print "
<link>http://".forge_get_config('web_host')."/".$link."</link>\n";
- print " <category>".$item_cat."</category>\n";
- //print "
<description>".rss_description($item_desc)."</description>\n";
- print " <author>".$msg['user_realname']."</author>\n";
- //print " <comment></comment>\n";
- print " <pubDate>".gmdate('D, d M Y
G:i:s',$msg['most_recent_date'])." GMT</pubDate>\n";
- //print " <guid></guid>\n";
- print " </item>\n";
-
+function writeForumFeed($msg, $item_cat) {
+ $link = "forum/message.php?msg_id=".$msg['msg_id'];
+
+ //------------ build one feed item ------------
+ print " <item>\n";
+ print " <title>".$msg['subject']."</title>\n";
+ print "
<link>http://".forge_get_config('web_host')."/".$link."</link>\n";
+ print " <category>".$item_cat."</category>\n";
+ //print "
<description>".rss_description($item_desc)."</description>\n";
+ print " <author>".$msg['user_realname']."</author>\n";
+ //print " <comment></comment>\n";
+ print " <pubDate>".gmdate('D, d M Y
G:i:s',$msg['most_recent_date'])." GMT</pubDate>\n";
+ //print " <guid></guid>\n";
+ print " </item>\n";
}
@@ -341,8 +341,8 @@ function displayError($errorMessage) {
}
function endFeed() {
- print '</channel></rss>';
- exit();
+ print '</channel></rss>';
+ exit();
}
function endOnError($errorMessage) {
@@ -351,25 +351,25 @@ function endOnError($errorMessage) {
}
//function taken from here
http://de3.php.net/manual/de/function.array-unique.php#75307
-function object_array_unique($array, $keep_key_assoc = false)
-{
- $duplicate_keys = array();
- $tmp = array();
-
- foreach ($array as $key=>$val)
- {
- // convert objects to arrays, in_array() does not support objects
- if (is_object($val))
- $val = (array)$val;
-
- if (!in_array($val, $tmp))
- $tmp[] = $val;
- else
- $duplicate_keys[] = $key;
- }
-
- foreach ($duplicate_keys as $key)
- unset($array[$key]);
-
- return $keep_key_assoc ? $array : array_values($array);
+function object_array_unique($array, $keep_key_assoc = false) {
+ $duplicate_keys = array();
+ $tmp = array();
+
+ foreach ($array as $key=>$val) {
+ // convert objects to arrays, in_array() does not support
objects
+ if (is_object($val)) {
+ $val = (array)$val;
+ }
+ if (!in_array($val, $tmp)) {
+ $tmp[] = $val;
+ } else {
+ $duplicate_keys[] = $key;
+ }
+ }
+
+ foreach ($duplicate_keys as $key) {
+ unset($array[$key]);
+ }
+
+ return $keep_key_assoc ? $array : array_values($array);
}
diff --git a/src/www/export/rss20_newreleases.php
b/src/www/export/rss20_newreleases.php
index f0bdd07..20586bd 100644
--- a/src/www/export/rss20_newreleases.php
+++ b/src/www/export/rss20_newreleases.php
@@ -36,7 +36,9 @@ print '<?xml version="1.0" encoding="UTF-8"?>
$group_id = getIntFromRequest('group_id');
$limit = getIntFromRequest('limit', 10);
-if ($limit > 100) $limit = 100;
+if ($limit > 100) {
+ $limit = 100;
+}
if ($group_id) {
session_require_perm('project_read', $group_id);
@@ -48,7 +50,7 @@ if ($group_id) {
$link = "/frs/?group_id=$group_id";
$description = " of ".$row['group_name'];
$admins = RBACEngine::getInstance()->getUsersByAllowedAction
('project_admin', $group_id) ;
- if (count ($admins)) {
+ if (!empty($admins)) {
$webmaster =
$admins[0]->getUnixName()."@".forge_get_config('users_host')."
(".$admins[0]->getRealName().")";
} else {
$webmaster = forge_get_config('admin_email');
@@ -127,7 +129,9 @@ while ($row = db_fetch_array($res)) {
}
// eliminate dupes, only do $limit of these
$seen[$row['filerelease_id']] = 1;
- if ($outputtotal >= $limit) break;
+ if ($outputtotal >= $limit) {
+ break;
+ }
}
// ## end output
print " </channel>\n";
diff --git a/src/www/export/rss20_news.php b/src/www/export/rss20_news.php
index d7950a2..ba7a3b3 100644
--- a/src/www/export/rss20_news.php
+++ b/src/www/export/rss20_news.php
@@ -36,7 +36,9 @@ print '<?xml version="1.0" encoding="UTF-8"?>
';
$group_id = getIntFromRequest('group_id');
$limit = getIntFromRequest('limit', 10);
-if ($limit > 100) $limit = 100;
+if ($limit > 100) {
+ $limit = 100;
+}
if ($group_id) {
session_require_perm('project_read', $group_id);
diff --git a/src/www/export/rssAboTask.php b/src/www/export/rssAboTask.php
index efb5287..180ea5c 100644
--- a/src/www/export/rssAboTask.php
+++ b/src/www/export/rssAboTask.php
@@ -33,11 +33,10 @@ require_once $gfcommon.'pm/ProjectGroup.class.php';
require_once $gfcommon.'include/Group.class.php';
require_once $gfcommon.'pm/ProjectTaskSqlQueries.php';
-global $gfwww, $gfcommon;
-
$tid = getIntFromRequest('tid');
-if (!$tid)
+if (!$tid) {
$tid = util_path_info_last_numeric_component();
+}
if (!$tid) {
header("HTTP/1.0 404 Not Found");
echo "You forgot to pass the tid.\n";
diff --git a/src/www/export/rss_sfnewreleases.php
b/src/www/export/rss_sfnewreleases.php
index cc67102..af20d90 100644
--- a/src/www/export/rss_sfnewreleases.php
+++ b/src/www/export/rss_sfnewreleases.php
@@ -26,7 +26,9 @@ require_once $gfcommon.'include/pre.php';
require_once $gfwww.'export/rss_utils.inc';
$limit = getIntFromRequest('limit', 10);
-if ($limit > 100) $limit = 100;
+if ($limit > 100) {
+ $limit = 100;
+}
header("Content-Type: text/xml; charset=utf-8");
print '<?xml version="1.0" encoding="UTF-8"?>
@@ -80,7 +82,9 @@ while ($row = db_fetch_array($res)) {
}
// eliminate dupes, only do $limit of these
$seen[$row['group_id']] = 1;
- if ($outputtotal >= $limit) break;
+ if ($outputtotal >= $limit) {
+ break;
+ }
}
// ## end output
print " </channel>\n";
diff --git a/src/www/export/rss_sfprojects.php
b/src/www/export/rss_sfprojects.php
index 22f16df..7655fb0 100644
--- a/src/www/export/rss_sfprojects.php
+++ b/src/www/export/rss_sfprojects.php
@@ -19,7 +19,9 @@ if ($showall) {
$limit = 0 ;
} else {
$limit = getIntFromRequest('limit', 10);
- if ($limit > 100) $limit = 100;
+ if ($limit > 100) {
+ $limit = 100;
+ }
}
header("Content-Type: text/xml; charset=utf-8");
diff --git a/src/www/export/rss_utils.inc b/src/www/export/rss_utils.inc
index d082f02..24daede 100644
--- a/src/www/export/rss_utils.inc
+++ b/src/www/export/rss_utils.inc
@@ -53,7 +53,9 @@ function rss_description($in) {
// callback is optional function name which should be called for each project
// row and which result will be appended to description element
function rss_dump_project_result_set($res, $title, $desription = '', $callback
= 0) {
- if (!$desription) $desription = $title;
+ if (!$desription) {
+ $desription = $title;
+ }
// one time output
print " <channel>\n";
print " <copyright>Copyright ".date("Y")."
".forge_get_config('forge_name')."</copyright>\n";
@@ -87,7 +89,9 @@ function rss_dump_project_result_set($res, $title,
$desription = '', $callback =
}
function rss_dump_project_result_array($result, $title, $desription = '',
$callback = 0) {
- if (!$desription) $desription = $title;
+ if (!$desription) {
+ $desription = $title;
+ }
// one time output
print " <channel>\n";
print " <copyright>Copyright ".date("Y")." ".forge_get_config
('forge_name')."</copyright>\n";
diff --git a/src/www/forum/admin/index.php b/src/www/forum/admin/index.php
index 3d9c4cc..6919d65 100644
--- a/src/www/forum/admin/index.php
+++ b/src/www/forum/admin/index.php
@@ -423,12 +423,8 @@ if (getStringFromRequest('add_forum')) {
// Add new forum
//
$fa = new ForumAdmin($g->getID());
-
$fa->PrintAdminOptions();
- if ($f)
- plugin_hook ("blocks", "forum index");
-
//
// Get existing forums
//
@@ -463,8 +459,3 @@ if (getStringFromRequest('add_forum')) {
forum_footer();
}
-
-// Local Variables:
-// mode: php
-// c-file-style: "bsd"
-// End:
diff --git a/src/www/frs/index.php b/src/www/frs/index.php
index 120efd5..2bc5545 100644
--- a/src/www/frs/index.php
+++ b/src/www/frs/index.php
@@ -38,25 +38,25 @@ require_once $gfcommon.'docman/DocumentManager.class.php';
global $HTML;
/* are we using frs ? */
-if (!forge_get_config('use_frs'))
+if (!forge_get_config('use_frs')) {
exit_disabled('home');
-
+}
$group_id = getIntFromRequest('group_id');
/* validate group */
-if (!$group_id)
+if (!$group_id) {
exit_no_group();
-
+}
$g = group_get_object($group_id);
-if (!$g || !is_object($g))
+if (!$g || !is_object($g)) {
exit_no_group();
-
+}
/* is this group using FRS ? */
-if (!$g->usesFRS())
+if (!$g->usesFRS()) {
exit_disabled();
-
-if ($g->isError())
+}
+if ($g->isError()) {
exit_error($g->getErrorMessage(), 'frs');
-
+}
session_require_perm('frs_admin', $group_id, 'read');
$release_id = getIntFromRequest('release_id');
diff --git a/src/www/include/expression.php b/src/www/include/expression.php
index 0674ea9..fd38234 100644
--- a/src/www/include/expression.php
+++ b/src/www/include/expression.php
@@ -8,7 +8,7 @@
* Copyright 2015 Colin Kiegel <http://colin-kiegel.github.io/>
* Copyright 2016 Jakub Jankiewicz <http://jcubic.pl/>
* Copyright 2016 Константин <https://github.com/optimistex>
- * Copyright 2016 Stéphane-Eymeric Breddthauer - TrivaDev
+ * Copyright 2016 Stéphane-Eymeric Bredthauer - TrivaDev
*
* NAME
* Expression - safely evaluate math and boolean expressions
@@ -418,8 +418,9 @@ class Expression {
$stack->push ( $op1 * $op2 );
break;
case '/' :
- if ($op2 == 0)
+ if ($op2 == 0) {
return $this->trigger (
"division by zero" );
+ }
$stack->push ( $op1 / $op2 );
break;
case '%' :
@@ -493,11 +494,13 @@ class Expression {
} elseif (preg_match ( "/^([a-z]\w*)\($/", $token,
$matches )) { // it's a function!
$fnn = $matches [1];
if (in_array ( $fnn, $this->fb )) { // built-in
function:
- if (is_null ( $op1 = $stack->pop () ))
+ if (is_null ( $op1 = $stack->pop () )) {
return $this->trigger (
"internal error" );
+ }
$fnn = preg_replace ( "/^arc/", "a",
$fnn ); // for the 'arc' trig synonyms
- if ($fnn == 'ln')
+ if ($fnn == 'ln') {
$fnn = 'log';
+ }
$stack->push ( $fnn ( $op1 ) ); //
perfectly safe variable function call
} elseif (array_key_exists ( $fnn, $this->f ))
{ // user function
// get args
@@ -556,16 +559,18 @@ class Expression {
}
}
// when we're out of tokens, the stack should have a single
element, the final result
- if ($stack->count != 1)
+ if ($stack->count != 1) {
return $this->trigger ( "internal error" );
+ }
return $stack->pop ();
}
// trigger an error, but nicely, if need be
function trigger($msg) {
$this->last_error = $msg;
- if (! $this->suppress_errors)
+ if (! $this->suppress_errors) {
trigger_error ( $msg, E_USER_WARNING );
+ }
return false;
}
}
diff --git a/src/www/include/project_summary.php
b/src/www/include/project_summary.php
index 0388f13..75fd618 100644
--- a/src/www/include/project_summary.php
+++ b/src/www/include/project_summary.php
@@ -138,8 +138,9 @@ function project_summary($group_id, $mode, $no_table) {
} else {
for ($j = 0; $j < $rows; $j++) {
$artifact_id = db_result($result, $j,
'group_artifact_id');
- if (!forge_check_perm('tracker',
$artifact_id, 'read'))
+ if (!forge_check_perm('tracker',
$artifact_id, 'read')) {
continue;
+ }
$return .= '<p>
- '.util_make_link('/tracker/?atid='. $artifact_id .
'&group_id='.$group_id.'&func=browse',db_result($result, $j, 'name'));
$return .=
sprintf(ngettext('(<strong>%1$s</strong> open / <strong>%2$s</strong> total)',
'(<strong>%1$s</strong> open / <strong>%2$s</strong> total)', (int)
db_result($result, $j, 'open_count')), (int) db_result($result, $j,
'open_count'), (int) db_result($result, $j, 'count')) ;
@@ -221,8 +222,9 @@ function project_summary($group_id, $mode, $no_table) {
} else {
for ($j = 0; $j < $rows; $j++) {
$subproject_id = db_result($result, $j,
'group_project_id');
- if (!forge_check_perm('pm',
$subproject_id, 'read'))
+ if (!forge_check_perm('pm',
$subproject_id, 'read')) {
continue;
+ }
$return .= '<br /> -
'.util_make_link('/pm/task.php?group_project_id='.$subproject_id.'&group_id='.$group_id.'&func=browse',db_result($result,
$j, 'project_name'));
}
db_free_result($result);
diff --git a/src/www/include/tool_reports.php b/src/www/include/tool_reports.php
index e739bc7..f35141e 100644
--- a/src/www/include/tool_reports.php
+++ b/src/www/include/tool_reports.php
@@ -89,7 +89,9 @@ function reports_header($group_id, $vals, $titles, $html='') {
_('Last year(s)'),
_('Project lifespan'));
- if (!$period) $period="lifespan";
+ if (!$period) {
+ $period="lifespan";
+ }
print _('for');
print html_build_select_box_from_arrays (
diff --git a/src/www/include/trove.php b/src/www/include/trove.php
index c761fbc..9027ec4 100644
--- a/src/www/include/trove.php
+++ b/src/www/include/trove.php
@@ -41,18 +41,17 @@ $TROVE_HARDQUERYLIMIT = -1;
function trove_genfullpaths($mynode, $myfullpath, $myfullpathids) {
// first generate own path
db_query_params('UPDATE trove_cat SET fullpath=$1,fullpath_ids=$2 WHERE
trove_cat_id=$3',
- array ($myfullpath,
- $myfullpathids,
- $mynode));
+ array ($myfullpath,
+ $myfullpathids,
+ $mynode));
// now generate paths for all children by recursive call
- if($mynode!=0)
- {
+ if ($mynode !=0) {
$res_child = db_query_params('
SELECT trove_cat_id,fullname
FROM trove_cat
WHERE parent=$1
AND trove_cat_id != 0',
- array ($mynode));
+ array ($mynode));
while ($row_child = db_fetch_array($res_child)) {
trove_genfullpaths($row_child['trove_cat_id'],
@@ -74,10 +73,10 @@ function trove_updaterootparent($mynode, $rootnode) {
// first generate own path
if($mynode!=$rootnode) {
db_query_params('UPDATE trove_cat SET root_parent=$1 WHERE
trove_cat_id=$2',
- array ($rootnode, $mynode));
+ array ($rootnode, $mynode));
} else {
db_query_params('UPDATE trove_cat SET root_parent=0 WHERE
trove_cat_id=$1',
- array ($mynode));
+ array ($mynode));
}
// now generate paths for all children by recursive call
if($mynode!=0) {
@@ -86,7 +85,7 @@ function trove_updaterootparent($mynode, $rootnode) {
FROM trove_cat
WHERE parent=$1
AND trove_cat_id!=0',
- array($mynode));
+ array($mynode));
while ($row_child = db_fetch_array($res_child)) {
trove_updaterootparent($row_child['trove_cat_id'],$rootnode);
@@ -106,16 +105,18 @@ function trove_updaterootparent($mynode, $rootnode) {
*/
function trove_setnode($group_id, $trove_cat_id, $rootnode=0) {
// verify we were passed information
- if ((!$group_id) || (!$trove_cat_id)) return 1;
-
+ if ((!$group_id) || (!$trove_cat_id)) {
+ return 1;
+ }
// verify trove category exists
- $res_verifycat = db_query_params('
- SELECT trove_cat_id,fullpath_ids
- FROM trove_cat
- WHERE trove_cat_id=$1',
- array ($trove_cat_id));
+ $res_verifycat = db_query_params('SELECT trove_cat_id,fullpath_ids
+ FROM trove_cat
+ WHERE trove_cat_id=$1',
+ array ($trove_cat_id));
- if (db_numrows($res_verifycat) != 1) return 1;
+ if (db_numrows($res_verifycat) != 1) {
+ return 1;
+ }
$row_verifycat = db_fetch_array($res_verifycat);
// if we didnt get a rootnode, find it
@@ -124,13 +125,12 @@ function trove_setnode($group_id, $trove_cat_id,
$rootnode=0) {
}
// must first make sure that this is not a subnode of anything current
- $res_topnodes = db_query_params('
- SELECT trove_cat.trove_cat_id AS trove_cat_id,
- trove_cat.fullpath_ids AS fullpath_ids
- FROM trove_cat,trove_group_link
- WHERE trove_cat.trove_cat_id=trove_group_link.trove_cat_id
- AND trove_group_link.group_id=$1
- AND trove_cat.root_parent=$2',
+ $res_topnodes = db_query_params('SELECT trove_cat.trove_cat_id AS
trove_cat_id,
+ trove_cat.fullpath_ids AS
fullpath_ids
+ FROM trove_cat,trove_group_link
+ WHERE
trove_cat.trove_cat_id=trove_group_link.trove_cat_id
+ AND trove_group_link.group_id=$1
+ AND trove_cat.root_parent=$2',
array ($group_id,
$rootnode));
@@ -147,11 +147,10 @@ function trove_setnode($group_id, $trove_cat_id,
$rootnode=0) {
// need to see if this one is more specific than another
// if so, delete the other and proceed with this insertion
$subnodeids = explode(' :: ',$row_verifycat['fullpath_ids']);
- $res_checksubs = db_query_params('
- SELECT trove_cat_id
- FROM trove_group_link
- WHERE group_id=$1
- AND trove_cat_root=$2',
+ $res_checksubs = db_query_params('SELECT trove_cat_id
+ FROM trove_group_link
+ WHERE group_id=$1
+ AND trove_cat_root=$2',
array($group_id,
$rootnode));
@@ -195,7 +194,9 @@ function trove_getrootcat($trove_cat_id) {
$row_par = db_fetch_array($res_par);
$parent = $row_par["parent"];
- if ($parent == 0) return $current_cat;
+ if ($parent == 0) {
+ return $current_cat;
+ }
$current_cat = $parent;
}
@@ -240,7 +241,9 @@ function trove_catselectfull($node, $selected, $name,
$title='') {
while ($row_cat = db_fetch_array($res_cat)) {
print ' <option value="'.$row_cat['trove_cat_id'].'"';
- if ($selected == $row_cat['trove_cat_id']) print ('
selected="selected"');
+ if ($selected == $row_cat['trove_cat_id']) {
+ print (' selected="selected"');
+ }
print '>'.$row_cat['fullpath']."</option>\n";
}
print "</select>\n";
-----------------------------------------------------------------------
Summary of changes:
src/plugins/oauthconsumer/include/resource_api.php | 39 +--
src/plugins/oauthconsumer/www/get_access_token.php | 29 +-
src/plugins/oauthconsumer/www/providers.php | 10 +-
src/plugins/oauthconsumer/www/response.php | 12 +-
src/plugins/scmcpold/common/CpoldPlugin.class.php | 13 +-
src/plugins/scmsvn/common/SVNPlugin.class.php | 8 +-
src/plugins/scmsvn/libexec/svnlog.php | 18 +-
.../sysauthldap/common/SysAuthLDAPPlugin.class.php | 18 +-
.../taskboard/common/TaskBoardPlugin.class.php | 6 +-
.../taskboard/common/views/admin/trackers.php | 4 +-
.../trackermonitor/common/trackermonitor-init.php | 6 -
.../include/TrackerMonitorPlugin.class.php | 5 -
.../TrackerMonitorPluginDescriptor.class.php | 7 +-
.../include/TrackerMonitorPluginInfo.class.php | 10 +-
.../include/tracker/views/form-showmonitor.php | 40 ++-
.../common/webanalyticsPlugin.class.php | 5 +-
src/www/admin/grouplist.php | 9 +-
src/www/admin/trove/trove_cat_edit.php | 9 +-
src/www/admin/trove/trove_cat_list.php | 9 +-
src/www/admin/useredit.php | 6 +-
src/www/admin/userlist.php | 4 +-
src/www/developer/index.php | 8 +-
src/www/docman/index.php | 24 +-
src/www/docman/view.php | 23 +-
src/www/export/rss20_activity.php | 5 +-
src/www/export/rss20_docman.php | 9 +-
src/www/export/rss20_forum.php | 310 ++++++++++-----------
src/www/export/rss20_newreleases.php | 10 +-
src/www/export/rss20_news.php | 4 +-
src/www/export/rssAboTask.php | 5 +-
src/www/export/rss_sfnewreleases.php | 8 +-
src/www/export/rss_sfprojects.php | 4 +-
src/www/export/rss_utils.inc | 8 +-
src/www/forum/admin/index.php | 9 -
src/www/frs/index.php | 20 +-
src/www/include/expression.php | 17 +-
src/www/include/project_summary.php | 6 +-
src/www/include/tool_reports.php | 4 +-
src/www/include/trove.php | 65 ++---
39 files changed, 412 insertions(+), 394 deletions(-)
hooks/post-receive
--
FusionForge
_______________________________________________
Fusionforge-commits mailing list
[email protected]
http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-commits