summaryrefslogtreecommitdiff
path: root/modules/gallery/helpers/access.php
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gallery/helpers/access.php')
-rw-r--r--modules/gallery/helpers/access.php40
1 files changed, 20 insertions, 20 deletions
diff --git a/modules/gallery/helpers/access.php b/modules/gallery/helpers/access.php
index c84527f4..949aea84 100644
--- a/modules/gallery/helpers/access.php
+++ b/modules/gallery/helpers/access.php
@@ -166,8 +166,8 @@ class access_Core {
// For view permissions, if any parent is self::DENY, then those parents lock this one.
// Return
$lock = ORM::factory("item")
- ->where("`left` <= $item->left")
- ->where("`right` >= $item->right")
+ ->where("`left_ptr` <= $item->left_ptr")
+ ->where("`right_ptr` >= $item->right_ptr")
->where("items.id <> $item->id")
->join("access_intents", "items.id", "access_intents.item_id")
->where("access_intents.view_$group->id", self::DENY)
@@ -490,11 +490,11 @@ class access_Core {
// item, then its safe to propagate from here.
if ($access->$field !== self::DENY) {
$tmp_item = ORM::factory("item")
- ->where("left <", $item->left)
- ->where("right >", $item->right)
+ ->where("left_ptr <", $item->left_ptr)
+ ->where("right_ptr >", $item->right_ptr)
->join("access_intents", "access_intents.item_id", "items.id")
->where("access_intents.$field", self::DENY)
- ->orderby("left", "DESC")
+ ->orderby("left_ptr", "DESC")
->limit(1)
->find();
if ($tmp_item->loaded) {
@@ -507,13 +507,13 @@ class access_Core {
// them according the rule above. So mark every permission below this level as UNKNOWN so
// that we can tell which permissions have been changed, and which ones need to be updated.
$db->update("items", array($field => self::UNKNOWN),
- array("left >=" => $item->left, "right <=" => $item->right));
+ array("left_ptr >=" => $item->left_ptr, "right_ptr <=" => $item->right_ptr));
$query = ORM::factory("access_intent")
- ->select(array("access_intents.$field", "items.left", "items.right", "items.id"))
+ ->select(array("access_intents.$field", "items.left_ptr", "items.right_ptr", "items.id"))
->join("items", "items.id", "access_intents.item_id")
- ->where("left >=", $item->left)
- ->where("right <=", $item->right)
+ ->where("left_ptr >=", $item->left_ptr)
+ ->where("right_ptr <=", $item->right_ptr)
->where("type", "album")
->where("access_intents.$field IS NOT", self::INHERIT)
->orderby("level", "DESC")
@@ -522,11 +522,11 @@ class access_Core {
if ($row->$field == self::ALLOW) {
// Propagate ALLOW for any row that is still UNKNOWN.
$db->update("items", array($field => $row->$field),
- array($field => self::UNKNOWN, "left >=" => $row->left, "right <=" => $row->right));
+ array($field => self::UNKNOWN, "left_ptr >=" => $row->left_ptr, "right_ptr <=" => $row->right_ptr));
} else if ($row->$field == self::DENY) {
// DENY overwrites everything below it
$db->update("items", array($field => $row->$field),
- array("left >=" => $row->left, "right <=" => $row->right));
+ array("left_ptr >=" => $row->left_ptr, "right_ptr <=" => $row->right_ptr));
}
}
@@ -534,7 +534,7 @@ class access_Core {
// DENY parent in the hierarchy to propagate from. So we'll still have a UNKNOWN values in
// the hierarchy, and all of those are safe to change to ALLOW.
$db->update("items", array($field => self::ALLOW),
- array($field => self::UNKNOWN, "left >=" => $item->left, "right <=" => $item->right));
+ array($field => self::UNKNOWN, "left_ptr >=" => $item->left_ptr, "right_ptr <=" => $item->right_ptr));
}
/**
@@ -562,10 +562,10 @@ class access_Core {
if ($access->$field === self::INHERIT) {
$tmp_item = ORM::factory("item")
->join("access_intents", "items.id", "access_intents.item_id")
- ->where("left <", $item->left)
- ->where("right >", $item->right)
+ ->where("left_ptr <", $item->left_ptr)
+ ->where("right_ptr >", $item->right_ptr)
->where("$field IS NOT", self::UNKNOWN)
- ->orderby("left", "DESC")
+ ->orderby("left_ptr", "DESC")
->limit(1)
->find();
if ($tmp_item->loaded) {
@@ -576,10 +576,10 @@ class access_Core {
// With non-view permissions, each level can override any permissions that came above it
// so start at the top and work downwards, overlaying permissions as we go.
$query = ORM::factory("access_intent")
- ->select(array("access_intents.$field", "items.left", "items.right"))
+ ->select(array("access_intents.$field", "items.left_ptr", "items.right_ptr"))
->join("items", "items.id", "access_intents.item_id")
- ->where("left >=", $item->left)
- ->where("right <=", $item->right)
+ ->where("left_ptr >=", $item->left_ptr)
+ ->where("right_ptr <=", $item->right_ptr)
->where("$field IS NOT", self::INHERIT)
->orderby("level", "ASC")
->find_all();
@@ -589,8 +589,8 @@ class access_Core {
"UPDATE {access_caches} SET `$field` = $value " .
"WHERE `item_id` IN " .
" (SELECT `id` FROM {items} " .
- " WHERE `left` >= $row->left " .
- " AND `right` <= $row->right)");
+ " WHERE `left_ptr` >= $row->left_ptr " .
+ " AND `right_ptr` <= $row->right_ptr)");
}
}