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
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'));
?>
"/" . ZENFOLDER . "/setup.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?
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.