![]() |
|
Password Protect - Printable Version +- ZenphotoCMS Forum (https://forum.zenphoto.org) +-- Forum: Support (https://forum.zenphoto.org/forum-1.html) +--- Forum: General support (https://forum.zenphoto.org/forum-4.html) +--- Thread: Password Protect (/thread-1119.html) |
Password Protect - ethoslight - 2007-02-02 It would be great to implement some form of Password Protect for albums or entire directory, not using .htaccess. A guy just released something of interest for Wordpress that is similar to what I am thinking of. http://broome.us/archives/2007/01/31/the-wordpress-password-plugin/ Regards... Password Protect - pennylessz28 - 2007-02-05 I was just thinking about starting my own thread for this. I second this idea. I would like to have albums I can share with say family members only who have a password. Password Protect - ethoslight - 2007-02-13 pennylessz28- I have the same situation as you, there are albums I would only like family to view. Password Protect - miriam - 2007-02-13 If you don't need a 100% safe way of keeping others away from your family pics, it's rather easy to add a password to your theme. Simply use cookies in your album.php. If a cookies isn't set, show a form where you ask for the password. If the visitor has provided the correct password, you can set the cookie and send the code for generating the thumbnails. This is an album without a password: http://www.newwws.be/zenphoto/mieren And this is an album with a password: http://www.newwws.be/zenphoto/test (the password is [b]zen[/b]) I work with a theme that uses a configuration file for each album. In that configuration file I can select whether to use a password or not. The cookie is valid for 30 minutes. After that time people will have to re-enter the password again. If you want to see the form in action again and don't want to wait 30 minutes, you can change the toplevel domain of the links into .org / .net / .tv / .us / .co.uk / .be groeten, Miriam Password Protect - thinkdreams - 2007-02-13 Miriam- If it's not too much trouble, you should share your work with the forum here? It might benefit others, if it's something you can package up easily. I'd be happy to write up the wiki article and place it in the ZenphotoHacks portion of the wiki. There have been a number of people (especially in this thread) asking about something like this. I know that this is planned for eventual release in the core zenphoto code, but this might help "hold" people over until that feature is integrated in the code. Password Protect - miriam - 2007-02-13 I'll give it a try. I had to change the code a bit because I don't think that I have the time to explain here how the newwws-theme works with its own configuration files. I also made the way the cookies are written a bit easier to understand for those people who have never used cookies before. FIRST... Place this PHP code BEFORE the line with in album.php ` ` SECOND... Place this code in a new PHP-file called newwws_password.php in the same folder as album.php ` Password Protect - thinkdreams - 2007-02-13 Excellent Miriam- Thanks! Maybe those who had the request out there for this can give it a try and see how it works for them. Meantime, as I get a chance I'll post it to the wiki. Password Protect - thinkdreams - 2007-02-13 seems to work just fine miriam on my dev site. here: http://www.thinkdreams.com/devzen/index.php?album=_cayman1996 password is defaulted to "zen". i'll put this up on the wiki for reference. Password Protect - jayray999 - 2007-02-13 Thanks @miriam and @thinkdreams. This has been a long standing request of Zenphoto users including me. One question though: Does this mean all albums will have the same password? Password Protect - thinkdreams - 2007-02-13 @Jayray999 Based on what I see in the code: yes. Might be able to be tweaked a little, but I think that's what Miriam meant by Item #4: "Enhance this - I'm not a programmer" Password Protect - jayray999 - 2007-02-13 @thinkdreams. Thanks for the reply. @miriam. Is the newwws-theme that you use publicly available. You say that, "I work with a theme that uses a configuration file for each album." Maybe that enables you to set a unique password for each album. If so, please do add the theme to @thinkdreams growing collection of ZP themes. Thanks again and incidentally, you have a wonderful site. Password Protect - ethoslight - 2007-02-13 Cool. I just came to check out the support forums and saw these [i]excellent[/i] replies. Will be interesting to see if I can get this to work along with Zenpress plugin to link photo in a post to an album. Password Protect - miriam - 2007-02-13 jayray999w wrote: "One question though: Does this mean all albums will have the same password?" No, but you'll have to find yourself a way to set the variable $newwws_password to a unique value for every album. If $newwws_password is not empty, the user will be asked to enter the password stored in $newwws_password. I adapted the code a bit so a default password will be asked for every album with a name that starts with an underscore. The newwws theme is highly configurable. Without a configuration file it will show 18 thumbnails in 3 rows of 6 thumbnails and on a default background. With the configuration file you can change the number of thumbnails on each row, let's say 6-4-2 or 5-4-3. It's also possible to use a different background for every page in an album and by selecting another css and/or another script it is possible to change the way the thumbnails look. Despite it is easy to work with the configuration files, it is also possible to work without. In that case the theme will use the default settings. The newwws theme is far from ready and it will take some time before I will make it available to other people. Groeten, Miriam Password Protect - jayray999 - 2007-02-14 @miriam. Thanks. Look forward to your eventual release. Password Protect - tdevlin - 2007-02-17 I am working on a zenphoto plugin that will allow you to create a password protected album from within the admin section. You'll be able to select whether an album is password protected and if so set a password. I can't promise that it will be future compatible, but I will try my best to abstract as much of the code as possible which should help to make it compatible for future versions. As soon as I have it done (I am working on it for a customer), I will share it here. Just wanted to give everyone a heads up. Password Protect - jayray999 - 2007-02-17 @tdevlin: This is excellent news. Thank you for doing this. I have a few suggestions for your consideration. Please ignore them if you already thought of these points.
Password Protect - trisweb - 2007-02-18 tdevlin - Please consider submitting patches, as this is a feature we'd like to integrate into the core zenphoto (if it's useful and well-designed ;-). I'd love to see your progress so keep us updated! Password Protect - pluto459 - 2007-02-23 I need something secure to protect the admin file. If someone knows please advise. Can this be done with htaccess? Thanks Password Protect - tdevlin - 2007-02-24 Update: My key goal was to create an album password protection mechanism that works with zenphoto without altering the core code, in fact I didn't want to touch the database either. The reason for this was to help prevent future releases from breaking functionality. What I have accomplished so far: Just wanted to send out an update on the progress. Also, many thanks to miriam for the initial code posted, it helped give me the idea for not integrating it totally into zenphoto, but instead abstract much of it. Also, I ripped the login form from the example, I hate typing mundane HTML code out. Password Protect - gilou - 2007-04-01 Hello, first, sorry for my english, i'm french so i'll probably do some mistakes in my message...
|