ZenphotoCMS Forum
Simple Login With Redirect? - 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: Simple Login With Redirect? (/thread-4848.html)



Simple Login With Redirect? - phil_geek - 2009-03-14

I'm new to zenphoto and I'm interested in using for the clients section of my website. I want to have a login page that simply asks for their username and password and then redirects them to the gallery their able to see. I found the "Zenphoto Single-Login" hack which seemed like exactly what I want, however when someone logs in through that page there's a 404 error because it's pointing to /zenphoto/albums/userdirectory and "userdirectory" doesn't exist. I tried reading the forum attached to the hack but didn't see anything related to my issue. Any suggestions to help me accomplish what I want with or without the hack?




Simple Login With Redirect? - sbillard - 2009-03-14

Change line 29 of the hack. Leave out the .$album.'/'




Simple Login With Redirect? - phil_geek - 2009-03-14

great, that worked. does this hack work with the guest login that can be setup for each album?




Simple Login With Redirect? - sbillard - 2009-03-14

This hack works only for defined "admin" users. I think someone has done a similar thing for guest users, not sure. Do a forum search and see what you find.




Simple Login With Redirect? - phil_geek - 2009-03-20

Is there a way to change the look of the login fields? For example, I'd like the username and password boxes to be shorter. I know how you do this with fields, but in the hack's code, I don't see a form anywhere. Also, I'd like to replace the normal index page with this login page, but when I do that, it seems to allow the user to login just fine, but then I get the following error:

Too many redirects occurred trying to open “URL”. This might occur if you open a page that is redirected to open another page which then is redirected to open the original page.




Simple Login With Redirect? - sbillard - 2009-03-21

The form is styled with a DIV, etc. so you can change the CSS. Alternatively you can reporduce the form contents with your own styling. There is not a separate file with just the form.




Simple Login With Redirect? - phil_geek - 2009-03-24

I searched the single-login.php file and found no DIV tags, and as I said before, I also don't see any form or text box tags in it as well. Can you tell me what line I should be looking at?

Also, how to fix the"too many redirects" error?




Simple Login With Redirect? - phil_geek - 2009-03-24

I searched the single-login.php file and found no DIV tags, and as I said before, I also don't see any form or text box tags in it as well. Can you tell me what line I should be looking at?

Also, how to fix the"too many redirects" error?




Simple Login With Redirect? - sbillard - 2009-03-24

The easiest way is to get a login form up in your browser and look at the HTML source. The actual form is basic zenphoto, not part of the plugin.

I really don't know what the too many redirects error is. The only redirect would be after the login back to the original page.




Simple Login With Redirect? - phil_geek - 2009-03-24

I know how to build a form. So I need to modify zenphotos default login form? Can you tell me where to find that?

I think I must not have done a good job explaining my goal. I'd like to single-login to be my index, so when someone isn't logged in, they are asked to login, then once they login they can see what they are allowed to. Is that possible?




Simple Login With Redirect? - sbillard - 2009-03-24

The form is generated by printPasswordForm()--called from the plugin. But maybe I was not so clear either. It is generally a bad idea to modify the zenphoto core functions. You will be forever having problems with new releases.

My suggestion was to use CSS styiling to make your changes. If that is not capable of doing what you want you should make your own version of the plugin and replace the printPasswordForm() call with your form. But understand, the login is handled in the very bowls of Zenphoto, so all the form fields in your version. must be as in the original.




Simple Login With Redirect? - phil_geek - 2009-04-21

Is there a way to make the Single Login page live one directory above the zenphoto directory? when I try it I get a 404 error because it's looking for the zen-core directory in the wrong place.




Simple Login With Redirect? - sbillard - 2009-04-21

http://www.zenphoto.org/2008/01/hacks/#zenphoto-single-login is the only thing I can think of.




Simple Login With Redirect? - phil_geek - 2009-04-21

Yeah I saw that, that's where I got the script from. However there's no documentation for changing the location outside of the zenphoto directory. I tried both of the following and either worked:




Simple Login With Redirect? - sbillard - 2009-04-21

Maybe you did not understand the text there. It says you must have this single_login.php script in the zenphoto folder root.

The script you create (that your users are pointed to) can go anywhere , it consists of just `` in that script.