Simple Login With Redirect?

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?

Comments

  • Change line 29 of the hack. Leave out the `.$album.'/'`
  • great, that worked. does this hack work with the guest login that can be setup for each album?
  • 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.
  • 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.
  • 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.
  • 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?
  • 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?
  • 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.
  • 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?
  • 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.
  • 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.
  • 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:

    <?php header("Location: /clients.php" ); ?>
    <?php header("Location: ../clients.php" ); ?>
  • 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 `<?php header("Location: zenphoto/single_login.php" ); ?>` in that script.
Sign In or Register to comment.