From 9c3aa0080b277a7e0d005dfe1601adf861dd5da1 Mon Sep 17 00:00:00 2001 From: rWatcher Date: Sun, 7 Nov 2010 01:43:09 -0400 Subject: [PATCH] Modify access to actually use the admin setting. --- 3.0/modules/albumpassword/helpers/MY_access.php | 4 ++-- 3.1/modules/albumpassword/helpers/MY_access.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/3.0/modules/albumpassword/helpers/MY_access.php b/3.0/modules/albumpassword/helpers/MY_access.php index 65052c8a..55f85f33 100644 --- a/3.0/modules/albumpassword/helpers/MY_access.php +++ b/3.0/modules/albumpassword/helpers/MY_access.php @@ -31,7 +31,7 @@ class access extends access_Core { // Begin rWatcher modifications. // This section adds an additional condition onto the view permission that throws a 404 // error if the album has a password assigned. - } elseif ($perm_name == "view") { + } elseif (($perm_name == "view") && (module::get_var("albumpassword", "hideonly") == false)) { $album_item = ""; do { if ($album_item == "") { @@ -43,7 +43,7 @@ class access extends access_Core { } 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) && diff --git a/3.1/modules/albumpassword/helpers/MY_access.php b/3.1/modules/albumpassword/helpers/MY_access.php index 65052c8a..55f85f33 100644 --- a/3.1/modules/albumpassword/helpers/MY_access.php +++ b/3.1/modules/albumpassword/helpers/MY_access.php @@ -31,7 +31,7 @@ class access extends access_Core { // Begin rWatcher modifications. // This section adds an additional condition onto the view permission that throws a 404 // error if the album has a password assigned. - } elseif ($perm_name == "view") { + } elseif (($perm_name == "view") && (module::get_var("albumpassword", "hideonly") == false)) { $album_item = ""; do { if ($album_item == "") { @@ -43,7 +43,7 @@ class access extends access_Core { } 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) &&