]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Added access controls to the activity stream update count.
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Mon, 24 May 2010 16:10:24 +0000 (16:10 +0000)
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Mon, 24 May 2010 16:10:24 +0000 (16:10 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@6174 36083f99-b078-4883-b0ff-0f9b5a30f544

mod/riverdashboard/endpoint/ping.php

index 93625e1b721a5a0e614faf8c440387e75a0132bf..5dd3bff5e63f2a0a7585dacc592043d16d5e80d7 100644 (file)
@@ -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;