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 d46655044336a8f9c91c7d53be10745c87cb75a7 (commit)
from 7ef71557288604ecd004a70928b1c2a50bf642a7 (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=d46655044336a8f9c91c7d53be10745c87cb75a7
commit d46655044336a8f9c91c7d53be10745c87cb75a7
Author: Franck Villaume <[email protected]>
Date: Wed Aug 31 19:51:39 2016 +0200
second fix for getActivityLogGroups
diff --git a/src/common/include/User.class.php
b/src/common/include/User.class.php
index 6dccd95..4424bb8 100644
--- a/src/common/include/User.class.php
+++ b/src/common/include/User.class.php
@@ -1177,13 +1177,14 @@ Use one below, but make sure it is entered as the
single line.)
return $this->data_array['title'];
}
+
/**
- * getGroups - get an array of groups this user is a member of.
+ * getGroupIds - get an array of group ids this user is a member of.
*
* @param bool $onlylocal
* @return array Array of groups.
*/
- function &getGroups($onlylocal = true) {
+ function getGroupIds($onlylocal = true) {
$ids = array();
foreach ($this->getRoles() as $r) {
if ($onlylocal) {
@@ -1197,7 +1198,16 @@ Use one below, but make sure it is entered as the single
line.)
}
}
}
- return group_get_objects(array_values(array_unique($ids))) ;
+ return array_values(array_unique($ids));
+ }
+ /**
+ * getGroups - get an array of groups this user is a member of.
+ *
+ * @param bool $onlylocal
+ * @return array Array of groups.
+ */
+ function &getGroups($onlylocal = true) {
+ return group_get_objects($this->getGroupIds($onlylocal));
}
/**
@@ -1807,8 +1817,8 @@ Email: %3$s
}
function getActivityLogGroups() {
- $res = db_query_params('select activity_log.group_id from
activity_log, groups where activity_log.group_id != 0 and user_id = $1 and
groups.status = $2 group by activity_log.group_id order by
count(activity_log.group_id) desc',
- array($this->getID()), 'A', 5);
+ $res = db_query_params('select group_id from activity_log where
user_id = $1 and group_id = ANY ($2) group by group_id order by count(group_id)
desc',
+ array($this->getID(),
db_int_array_to_any_clause($this->getGroupIds())), 5);
if (!$res) {
return array();
-----------------------------------------------------------------------
Summary of changes:
src/common/include/User.class.php | 20 +++++++++++++++-----
1 file changed, 15 insertions(+), 5 deletions(-)
hooks/post-receive
--
FusionForge
_______________________________________________
Fusionforge-commits mailing list
[email protected]
http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-commits