From 71d9a324d569060848f07e582e5aadf6de468a97 Mon Sep 17 00:00:00 2001 From: brettp Date: Mon, 24 May 2010 16:10:24 +0000 Subject: Added access controls to the activity stream update count. git-svn-id: http://code.elgg.org/elgg/trunk@6174 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/riverdashboard/endpoint/ping.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'mod') 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; -- cgit v1.2.3