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, 6.1 has been updated
via 8494eeabdddc5e8f701e028fe910e29357958ade (commit)
from a522da06ed5597a3443b78db0eee0eab0e046b83 (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=8494eeabdddc5e8f701e028fe910e29357958ade
commit 8494eeabdddc5e8f701e028fe910e29357958ade
Author: Franck Villaume <[email protected]>
Date: Sat Dec 16 11:05:14 2017 +0100
fix getNumberOfUsersByStatusAndName function: missing parenthesis in AND.
return wrong number of users
diff --git a/src/common/include/FusionForge.class.php
b/src/common/include/FusionForge.class.php
index 443e47c..88cd8a3 100644
--- a/src/common/include/FusionForge.class.php
+++ b/src/common/include/FusionForge.class.php
@@ -193,14 +193,14 @@ class FusionForge extends FFError {
}
function getNumberOfUsersByStatusAndName($params = array()) {
- $qpa = db_construct_qpa(false, 'SELECT count(user_id) FROM
users WHERE users.user_id != 100');
- if (isset($params['user_name_search'])) {
- $qpa = db_construct_qpa($qpa, ' AND lower(user_name)
LIKE $1 OR lower(lastname) LIKE $1',
array(strtolower($params['user_name_search'].'%')));
- }
- if (isset($params['status']) && in_array($params['status'],
array('D', 'A', 'S', 'P'))) {
- $qpa = db_construct_qpa($qpa, ' AND status = $1',
array($params['status']));
- }
- $res = db_query_qpa($qpa);
+ $qpa = db_construct_qpa(false, 'SELECT count(user_id) FROM
users WHERE users.user_id != 100');
+ if (isset($params['user_name_search'])) {
+ $qpa = db_construct_qpa($qpa, ' AND (lower(user_name)
LIKE $1 OR lower(lastname) LIKE $1)',
array(strtolower($params['user_name_search'].'%')));
+ }
+ if (isset($params['status']) && in_array($params['status'],
array('D', 'A', 'S', 'P'))) {
+ $qpa = db_construct_qpa($qpa, ' AND status = $1',
array($params['status']));
+ }
+ $res = db_query_qpa($qpa);
if (!$res || db_numrows($res) < 1) {
$this->setError('Unable to get users count:
'.db_error());
return false;
-----------------------------------------------------------------------
Summary of changes:
src/common/include/FusionForge.class.php | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
hooks/post-receive
--
FusionForge
_______________________________________________
Fusionforge-commits mailing list
[email protected]
http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-commits