aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-08-13 11:42:44 +0000
committermarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-08-13 11:42:44 +0000
commit88d5e2560875ec72e7b37d895d950869b3f51181 (patch)
tree4d7138cf43f182b840ab56b022879c46e5085417
parent1de4e318c1702293483e38285271398dc2cc4576 (diff)
downloadelgg-88d5e2560875ec72e7b37d895d950869b3f51181.tar.gz
elgg-88d5e2560875ec72e7b37d895d950869b3f51181.tar.bz2
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
-rw-r--r--engine/lib/access.php8
1 files changed, 5 insertions, 3 deletions
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;
}