Password-protect whole gallery

Hi there,

when searching this forum for the answer to my question, I found some ways to password-protect an album, but I'd like to password-protect my whole installation of zenphoto. All albums are private and should not be visible to everybody.

If the password is entered correctly, a cookie is set. My question is where to put the code that checks for that cookie (or prints a form in case the cookie is not found). Is it in the index.php found in the root of the installation after sending the header (line 9)?

`header ('Content-Type: text/html; charset=' . zp_conf('charset'));`

Thanks in advance for your help. :)
--Markus

//Wrong forum, sorry. Usage support would fit best, I think.

Comments

  • trisweb Administrator
    Someone is working on password protection right now, look for the bug on trac... I can add to it that we want an option to password-protect the whole gallery, that'd be a great idea.

    If you want to keep doing it yourself, I'd set the cookie before that header is sent, and I think you could do it in your theme files just fine. Make an include file, called "password.php" or something, and include it at the top of index.php, image.php, and album.php respectively. If the password cookie is valid, just do nothing, else display the login form and `exit();`, or set the cookie if it's being submitted and the password is correct.
  • MarS Member
    Thanks for your instructions.

    Yes, one password to protect the whole gallery would be a nice addition to ZenPhoto. It doesn't have to be super-secure (I think it actually is quite hard to block the direct access to the JPG, but I'm not an expert), it should just be a light protection of those who'd like to have a quick look and should not be able to.
Sign In or Register to comment.