aboutsummaryrefslogtreecommitdiff
path: root/mod/riverdashboard
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-05-24 16:10:24 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-05-24 16:10:24 +0000
commit71d9a324d569060848f07e582e5aadf6de468a97 (patch)
tree4676f93b4c0a23dfcdd2e386fc48f2ccc75b11d3 /mod/riverdashboard
parent65c5ba06227db6c4847fbe17a1ac35a52ed40b02 (diff)
downloadelgg-71d9a324d569060848f07e582e5aadf6de468a97.tar.gz
elgg-71d9a324d569060848f07e582e5aadf6de468a97.tar.bz2
Added access controls to the activity stream update count.
git-svn-id: http://code.elgg.org/elgg/trunk@6174 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/riverdashboard')
-rw-r--r--mod/riverdashboard/endpoint/ping.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/mod/riverdashboard/endpoint/ping.php b/mod/riverdashboard/endpoint/ping.php
index 93625e1b7..5dd3bff5e 100644
--- a/mod/riverdashboard/endpoint/ping.php
+++ b/mod/riverdashboard/endpoint/ping.php
@@ -18,8 +18,13 @@ $last_reload = time() - $seconds_passed;
// This entire system is driven by the river table.
// There is no core interface to simply grab the number of entries in the table.
// In order for something to count as an update, you must put a call to add_river_item().
+// @todo Remove this when elgg_get_river_items() supports 1.7-style API and count => TRUE and not group by object_guid
+
+// river table does not have columns expected by get_access_sql_suffix so we modify its output
+$access = str_replace("and enabled='yes'", '', str_replace('owner_guid', 'subject_guid', get_access_sql_suffix_new('r', 'e')));
+
$q = "SELECT COUNT(id) as all_activity FROM {$CONFIG->dbprefix}river r, {$CONFIG->dbprefix}entities e
- WHERE r.posted > $last_reload AND r.object_guid = e.guid";
+ WHERE r.posted > $last_reload AND r.object_guid = e.guid AND ($access)";
if ($d = get_data($q)) {
$all_activity = $d[0]->all_activity;