Embedded login repeats itself in vicious circle

kathyandmango

Joined: 2006-01-22
Posts: 8
Posted: Sun, 2006-01-22 07:38

I have embedded my Gallery 2 install into a php page in Zencart...not for the cart...in this case I use Zencart for the security. I call the embedded page from a php page in Zencart with this include:
<?php
include ("http://studio333.com/gallery2/gallery2embedded.php");
?>
The page requires the user to be logged in and is reached by:
https://www.studio333.com/secure/index.php?main_page=page_8

If the user is logged into Zencart, they see the first page of the gallery. However if they click on an album, it takes them to the sign-in page for Zencart. It seems to log them out. If they log in, it takes them back to the first page of the gallery, but if they click on an album it again takes them to the Zencart sign-in page.

My gallery is installed at: http://studio333.com/gallery2
My zencart is installed at http://studio333.com/secure

I had URL rewrites turned on, but I only got broken links so I turned it off.

Here is my gallery2embedded.php file. Thanks in advance for any help or advice:

<?php
$g2_Config['path'] = dirname(__FILE__) . '/gallery2';
$g2_Config['embedPath'] = '/';
$g2_Config['relativeG2Path'] = '/gallery2/';
$g2_Config['embedUri'] = '/secure/index.php?main_page=page_8';
//print_r($g2_Config);
require_once( $g2_Config['path'] = 'embed.php');
$ret = GalleryEmbed::init(array(
'embedPath' => $g2_Config['embedPath'],
'relativeG2Path' => $g2_Config['relativeG2Path'],
'embedUri' => $g2_Config['embedUri'],
));
if ($ret->isError())
{
// $ret->getAsHtml() has error details..
exit;
}
GalleryCapabilities::set('login',true);

// handle the G2 request
$g2moddata = GalleryEmbed::handleRequest();
// show error message if isDone is not defined
if (!isset($g2moddata['isDone']))
{
print 'isDone is not defined, something very bad must have happened.';
exit;
}
// die if it was a binary data (image) request
if ($g2moddata['isDone'])
{
exit; /* uploads module does this too */
}
if ($ret->isError())
{
print $ret->getAsHtml();
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<?php
$headHtml = $g2moddata['headHtml'];
//$headHtml = str_ireplace('</title>', ' -- ' . 'My Site' . '</title>', $headHtml);
echo $headHtml;
?>
<style type="text/css"> </style>
</head>
<body class="gallery">
<?php
echo $g2moddata['bodyHtml'];
?>
</body>
</html>