From 88d5e2560875ec72e7b37d895d950869b3f51181 Mon Sep 17 00:00:00 2001 From: marcus Date: Wed, 13 Aug 2008 11:42:44 +0000 Subject: Refs #237, #46 and #227: Added active only override to get_access_sql_suffix git-svn-id: https://code.elgg.org/elgg/trunk@1889 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/access.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'engine') diff --git a/engine/lib/access.php b/engine/lib/access.php index b38025c2c..d83683462 100644 --- a/engine/lib/access.php +++ b/engine/lib/access.php @@ -106,9 +106,10 @@ * * TODO: DELETE once Query classes are fully integrated * - * @param string $table_prefix Optional xxx. prefix for the access code. + * @param string $table_prefix Optional xxx. prefix for the access code. + * @param bool $active_only Option to select only active entities or include deactive ones. */ - function get_access_sql_suffix($table_prefix = "") + function get_access_sql_suffix($table_prefix = "", $active_only = true) { $sql = ""; @@ -129,7 +130,8 @@ if (empty($sql)) $sql = " ({$table_prefix}access_id in {$access} or ({$table_prefix}access_id = 0 and {$table_prefix}owner_guid = $owner))"; - $sql .= " and {$table_prefix}enabled='yes'"; + if ($active_only) + $sql .= " and {$table_prefix}enabled='yes'"; return $sql; } -- cgit v1.2.3