summaryrefslogtreecommitdiff
path: root/core/helpers/access.php
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-02-28 06:37:28 +0000
committerTim Almdal <tnalmdal@shaw.ca>2009-02-28 06:37:28 +0000
commitc04ff8e02f01691dc2e325efc523e43f3aebaf95 (patch)
tree8fbdfe90c1bb04b9b8b74500904c09f126430e19 /core/helpers/access.php
parentad56995bafffeca89c44b07cb4f25da7b36a1a99 (diff)
Change the pattern to identify tables that need prefix substitution to
mirror the drupal pattern of using braces {}.
Diffstat (limited to 'core/helpers/access.php')
-rw-r--r--core/helpers/access.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/core/helpers/access.php b/core/helpers/access.php
index a9f48c20..a759fca1 100644
--- a/core/helpers/access.php
+++ b/core/helpers/access.php
@@ -404,8 +404,8 @@ class access_Core {
$db = Database::instance();
$field = "{$perm_name}_{$group->id}";
$cache_table = $perm_name == "view" ? "items" : "access_caches";
- $db->query("ALTER TABLE `[$cache_table]` DROP `$field`");
- $db->query("ALTER TABLE `[access_intents]` DROP `$field`");
+ $db->query("ALTER TABLE {{$cache_table}} DROP `$field`");
+ $db->query("ALTER TABLE {access_intents} DROP `$field`");
ORM::factory("access_intent")->clear_cache();
}
@@ -420,8 +420,8 @@ class access_Core {
$db = Database::instance();
$field = "{$perm_name}_{$group->id}";
$cache_table = $perm_name == "view" ? "items" : "access_caches";
- $db->query("ALTER TABLE `[$cache_table]` ADD `$field` TINYINT(2) NOT NULL DEFAULT 0");
- $db->query("ALTER TABLE `[access_intents]` ADD `$field` BOOLEAN DEFAULT NULL");
+ $db->query("ALTER TABLE {{$cache_table}} ADD `$field` TINYINT(2) NOT NULL DEFAULT 0");
+ $db->query("ALTER TABLE {access_intents} ADD `$field` BOOLEAN DEFAULT NULL");
$db->update("access_intents", array($field => 0), array("item_id" => 1));
ORM::factory("access_intent")->clear_cache();
}
@@ -547,9 +547,9 @@ class access_Core {
->find_all();
foreach ($query as $row) {
$db->query(
- "UPDATE `[access_caches]` SET `$field` = {$row->$field} " .
+ "UPDATE {access_caches} SET `$field` = {$row->$field} " .
"WHERE `item_id` IN " .
- " (SELECT `id` FROM `[items]` " .
+ " (SELECT `id` FROM {items} " .
" WHERE `left` >= $row->left " .
" AND `right` <= $row->right)");
}