diff --git a/3.0/modules/albumpassword/helpers/MY_access.php b/3.0/modules/albumpassword/helpers/MY_access.php new file mode 100644 index 00000000..65052c8a --- /dev/null +++ b/3.0/modules/albumpassword/helpers/MY_access.php @@ -0,0 +1,57 @@ +is_album()) { + $album_item = $item; + } else { + $album_item = $item->parent(); + } + } else { + $album_item = $album_item->parent(); + } + + $existing_password = ORM::factory("items_albumpassword")->where("album_id", "=", $album_item->id)->find(); + if ($existing_password->loaded()) { + if ((cookie::get("g3_albumpassword") != $existing_password->password) && + (identity::active_user()->id != $album_item->owner_id)) { + throw new Kohana_404_Exception(); + } + } + } while ($album_item->parent_id > 0); + } + } +} diff --git a/3.1/modules/albumpassword/helpers/MY_access.php b/3.1/modules/albumpassword/helpers/MY_access.php new file mode 100644 index 00000000..65052c8a --- /dev/null +++ b/3.1/modules/albumpassword/helpers/MY_access.php @@ -0,0 +1,57 @@ +is_album()) { + $album_item = $item; + } else { + $album_item = $item->parent(); + } + } else { + $album_item = $album_item->parent(); + } + + $existing_password = ORM::factory("items_albumpassword")->where("album_id", "=", $album_item->id)->find(); + if ($existing_password->loaded()) { + if ((cookie::get("g3_albumpassword") != $existing_password->password) && + (identity::active_user()->id != $album_item->owner_id)) { + throw new Kohana_404_Exception(); + } + } + } while ($album_item->parent_id > 0); + } + } +}