single_login not working as it should

Hey guys,

i'm trying to implement the single_login.php hack into my 1.2.8_RC1 [4837].
this is my code:
`
<?php
/**
* This script provides a single login to your zenphoto
* gallery from somewhere else in your website. Place
* the script in the zenphoto root folder. create an
* index.php file at the URL where your users will visit
* to login. This index.php script should be simply
* (assumes your zenphoto root is 'zenphoto'):
*
* <?php header("Location: zenphoto/single_login.php" ); ?>
*
* Of course, modify the style of this script to fit your needs.
*/

if (!defined('ZENFOLDER')) { define('ZENFOLDER', 'zp-core'); }
/*if (!file_exists("http://". $_SERVER['HTTP_HOST'].dirname($_SERVER['SCRIPT_NAME']) . "zp-data/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_login-out.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'));
?>


Zenphoto Single_login


<?php
printUserLogin_out('<br />', '', true);
?>


`
if i log in with any user, i'm redirected to "/index.php?userlog=1&p=" and if i reload the page with the integrated script (now the cookie is set), it redirects to the right album. the script is in the root folder an the index.php with the include function is in root/1/index.php
i want the script to redirect directly to the album after the login. How can i do this?

Comments

  • You will need to call the `printPasswordForm()` function directly. `printUserLogin_out()` was intended to be used from within the zenphoto structure.
Sign In or Register to comment.