aboutsummaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
authormarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-06-18 17:57:40 +0000
committermarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-06-18 17:57:40 +0000
commit9d4db97e2750a4fb0fecb839f5d1939433654c3f (patch)
tree2fbfe541967848f80dcfc28a17916a384ad0bf41 /engine
parentc759754bfa7cdc83d843489a14580c61a72de370 (diff)
downloadelgg-9d4db97e2750a4fb0fecb839f5d1939433654c3f.tar.gz
elgg-9d4db97e2750a4fb0fecb839f5d1939433654c3f.tar.bz2
Fixes #12: Active variable on entities table. Update db schema.
git-svn-id: https://code.elgg.org/elgg/trunk@980 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine')
-rw-r--r--engine/lib/access.php9
-rw-r--r--engine/schema/mysql.sql4
2 files changed, 9 insertions, 4 deletions
diff --git a/engine/lib/access.php b/engine/lib/access.php
index 5e08f2f9c..e696f89d8 100644
--- a/engine/lib/access.php
+++ b/engine/lib/access.php
@@ -101,17 +101,20 @@
{
$sql = "";
+ if ($table_prefix)
+ $table_prefix = sanitise_string($table_prefix) . ".";
+
if (!is_privileged())
{
$access = get_access_list();
- if ($table_prefix)
- $table_prefix = sanitise_string($table_prefix) . ".";
-
$sql = " ({$table_prefix}access_id in {$access} or ({$table_prefix}access_id = 0 and {$table_prefix}owner_guid = {$_SESSION['id']}))";
}
else
$sql = " 1 ";
+
+ // Only return 'active' objects
+ $sql .= " and {$table_prefix}enabled='yes'";
return $sql;
}
diff --git a/engine/schema/mysql.sql b/engine/schema/mysql.sql
index 749ee5bcf..491c1e4c6 100644
--- a/engine/schema/mysql.sql
+++ b/engine/schema/mysql.sql
@@ -34,7 +34,9 @@ CREATE TABLE `prefix_entities` (
`access_id` int(11) NOT NULL,
`time_created` int(11) NOT NULL,
- `time_updated` int(11) NOT NULL,
+ `time_updated` int(11) NOT NULL,
+
+ `enabled` enum ('yes', 'no') NOT NULL default 'yes',
primary key (`guid`),
KEY `site_guid` (`site_guid`)