I've modified the newws password code to offer a password per album from the database. Also instead of using a cookie to persist a session, I'm a using PHP session variable.
/ Start of Private Password for Albums /
$albumtitle = getAlbumTitle();
$albumpwd=query_single_row("SELECT DISTINCT album_password FROM zen_albums where title = \"$albumtitle\"");
$pvt_password = $albumpwd['album_password'];
/ $pvt_password = "fstop"; /
$pvt_passwordfile = $themepath . "/" . $theme . "/" . "password.php";
$album_image_file = $themepath . "/" . $theme . "/" . "album-images.php";
$pvt_password_post = $_POST['pvt_pw'];
session_start();
if (!empty($pvt_password)){
if ($pvt_password == $pvt_password_post) {
$_SESSION['pvtsess'] = 1;
$pvt_authenticated = false;
}
if (!isset($_SESSION['pvtsess'])) {
$pvt_authenticated = true;
} else {
$pvt_authenticated = false;
}
} else {
$pvt_authenticated = false;
}
/ End of Password for Private Albums /
tdaugharty: with the nightly build (svn), album and galleries password protection is possibly using the admin options tab for gallery and the edit tab for albums. Image protection is possible and I believe there is an example in effervescence+'s image.php.
Nightly build: http://www.zenphoto.org/files/nightly/
Here is my final code if anyone wants it for their own use
$pvt_password_post = $_POST['pvt_pw'];
session_start();
if (!empty($pvt_password)){
if ($pvt_password == $pvt_password_post) {
$_SESSION['pvtsess'] = true; $_SESSION['pvtalbum'] = getAlbumTitle();
$pvt_auth_required = false;
}
if (!isset($_SESSION['pvtsess'])) {
$pvt_auth_required = true;
} else {
$pvt_auth_required = false;
}
} else {
$pvt_auth_required = false;
}
/ End of Password for Private Albums /