integrate zenphoto login to custom admin page

I host a bunch of zenphoto galleries for my friends and I am trying to be able to give them the option to change some of the settings like passwords or gallery title without giving them ftp access to edit the config.php
Not that I think my friends are dumb but they wouldnt know how to do it.

I have already written sort of a hack that can edit the config.php(actually rewrite a new one) and it pulls up the current values, saves the new values and what not. Actually works pretty well. I have tested it on my server and so far it works. The only thing left to do make it so john doe cant just browse to the path and start editing it. (and make it look pretty)(and a few other minor things)

What do I have to do to integrate zenphotos login to my page. I have tried a few different things but none seem to work(maybe cause I am on IIS instead of apache) but zen photo still works on IIS... what code do I need to put in my configurator page to require a zenphoto login?


  • You can use the zp_loggedin function, which is found in auth_zp.php. Require this file in yours, and then test to see if they are logged in with

    if (zp_loggedin) {

    // they can see the good stuff

    } else {

    die("Sorry, you are not logged in.");

    Or something similar. This will check for the zp cookie. If you want to show the login form, you may also want to look at the printLoginForm in admin-functions.php, but beware of path issues and what happens on submit.
  • Just incase anybody is interested, here is my progress with the configuration generator/updater I have been working on for my site.

    Having a world of problems with the login.. I just cant seem to integrate it.. really still learning php

    feel free to play with it.. it is not attached to any real album... just a demo

    What this is doing is rewriting the config.php, this way you can update your password, username, gallery title, or make image/thumbnail adjustments without having to edit the file.. it can all be done from the web.
  • trisweb Administrator
    Just FYI, I'm planning on making all those options updatable from the web, like most apps do it. They would be stored in the database, and config.php would contain only database connection info.

    Someday... ;-)
Sign In or Register to comment.