Single_login server issue

Hi, not sure if anyone can help but I have used the single_login hack on a number of zenphoto installations before with no problems.

I have just completed the current install on a new serer and added the single_login.php file to the zenphoto root folder. http://fotka.com.au/zenphoto/single_login.php

Any time I try to access the link above or through the index.php file (http://fotka.com.au/index.php) I get redirected to the setup page to upgrade. This same login file and installation works well on two other servers I use.

Not sure if this is something to do with zenphoto or the server settings?

It would be great if anyone has any ideas!

Comments

  • Hi, me again. Just had a quick update/bump and was hoping someone could help me out, as i don't know any php.

    In the single_login.php file (http://fotka.com.au/zenphoto/single_login.php) the code is redirecting the user to the /setup.php page instead of displaying the login form.

    Does anyone know if there is anything I can change in the php in the single_login file so that it doesn't re-direct but displays the login form instead?

    <?php
    if (!defined('ZENFOLDER')) { define('ZENFOLDER', 'zp-core'); }
    if (!file_exists(dirname(__FILE__) . '/' . ZENFOLDER . "/zp-config.php")) {
    $location = "http://". $_SERVER['HTTP_HOST'].dirname($_SERVER['SCRIPT_NAME']) .
    "/" . ZENFOLDER . "/setup.php";
    header("Location: $location" );
    }
    define('OFFSET_PATH', 0);
    require_once(ZENFOLDER . "/template-functions.php");
    require_once(SERVERPATH . "/" . ZENFOLDER . PLUGIN_FOLDER . 'user_logout.php');
    if (!is_null($_zp_current_admin)) {
    if ($_zp_loggedin & ADMIN_RIGHTS) {
    header("Location: " . WEBPATH . "/");
    } else {
    $albums = getManagedAlbumList();
    $album = array_shift($albums);
    header("Location: " . WEBPATH . "/".$album.'/');
    }
    }
    header ('Content-Type: text/html; charset=' . getOption('charset'));
    ?>
  • acrylian Administrator, Developer
    Try this. Here change `setup.php` to `admin.php`: `$location = "http://". $_SERVER['HTTP_HOST'].dirname($_SERVER['SCRIPT_NAME']) .
    "/" . ZENFOLDER . "/setup.php";`
  • Hey Acrylian - thanks for the reply! If I change setup.php to admin.php it re-directs to the admin page login. http://fotka.com.au/clients/single_login.php

    This is good for the main administrator but I was hoping to have the option for "clients" to login via the photo gallery interface with single_login so they don't see the admin area. I tried a clean install on another server and it seems to be having the same issue.

    http://paste.com.au/clients/PHOTO/zenphoto/single_login.php

    Does anyone know if single_login works with the latest version of zenphoto 1.2.6? or should I go back to version 1.2.1 which I have working well?
  • acrylian Administrator, Developer
    Well, loggin in always leads to the admin backend. You probably have to modify the `zp-core/lib-auth.php` file. Sorry, I can't really help with that script as I never tried it. You can of course use 1.2.1 if that works fine for you but we won't be able to support that, too.
  • `if (!file_exists(dirname(__FILE__) . '/' . ZENFOLDER . "/zp-config.php")) {`

    needs to be changed on the current Zenphoto to

    `if (!file_exists(dirname(__FILE__) . '/' . DATA_FOLDER. "/zp-config.php")) {`

    as the config file has been moved out of the core files.
  • Hey Sbillard thanks for the response! I changed the line above in the single_login.php file but it is still re-directing instead of displaying the login form.
Sign In or Register to comment.