ZenphotoCMS Forum
PW protected album login: Warning - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: PW protected album login: Warning (/thread-10756.html)



PW protected album login: Warning - michael42 - 2013-01-20

I have redirected gallery.my.domain to my.domain/zenphoto/. Everything works fine. But if you want to access a password protected album you get these warnings after you have entered the (right) password:

Warning: strpos() [function.strpos]: Empty delimiter in .../html/zenphoto/zp-core/functions.php on line 1598

Warning: Cannot modify header information - headers already sent by (output started at .../html/zenphoto/zp-core/functions.php:1598) in .../html/zenphoto/zp-core/functions.php on line 1697

If you press the browsers back button now, the gallery is shown. Is there a setting I can do to get rid of these warnings?

Thanks,
Michael




PW protected album login: Warning - acrylian - 2013-01-20

Zenphoto version? Theme used?




PW protected album login: Warning - sbillard - 2013-01-20

Did you re-run seup after redirecting your gallery?




PW protected album login: Warning - michael42 - 2013-01-20

It's Zenphoto 1.4.4 with gallery theme Default. The "Web path" is empty. I reran the setup but it didn't change.




PW protected album login: Warning - sbillard - 2013-01-20

If you ran setup from the web path mydomain/zenphoto it would have changed the webpath to "zenphoto" so you have not done this correctly. Things may work (but not mod-rewrite) with a wrong base, but certainly there will be issues.

You might want to install the support release. Your error line number does not correspond to any line in that release, which is all I have access to while I am traveling, so I cannot speculate on its cause.




PW protected album login: Warning - michael42 - 2013-01-20

I moved ZP to the root. Same problem. hence I do not think it's a redirect issue. I asked my provider to enable mod_rewrite.

Here are the according 1.4.4 code snippets:

function sanitizeRedirect($redirectTo, $forceHost=false) {
$redirect = NULL;
if ($redirectTo && $redir = parse_url($redirectTo)) {
if (isset($redir['scheme']) && isset($redir['host'])) {
$redirect .= $redir['scheme'].'://'.sanitize($redir['host']);
} else {
if ($forceHost) {
$redirect .= SERVER_PROTOCOL.'://'.$_SERVER['HTTP_HOST'];
if(strpos($redirectTo, WEBPATH) === false) {
$redirect .= WEBPATH;
}

function zp_handle_password($authType=NULL, $check_auth=NULL, $check_user=NULL) {
...
$success = zp_apply_filter('guest_login_attempt', $success, $post_user, $post_pass, $authType);;
if ($success) {
// Correct auth info. Set the cookie.
if (DEBUG_LOGIN) debugLog("zp_handle_password: valid credentials");
zp_setCookie($authType, $auth);
if (isset($_POST['redirect'])) {
$redirect_to = sanitizeRedirect($_POST['redirect'], true);
if (!empty($redirect_to)) {
header("Location: " . $redirect_to);
exitZP();
}
}




PW protected album login: Warning - acrylian - 2013-01-21

Again, after moving did you run setup? You also might need to set the webpath in your config file (in zp-data) manually.




PW protected album login: Warning - michael42 - 2013-01-21

Yes I re-ran the setup. Once approved to the gallery everything is ok. Also if you re-open the website at a later date (until the cookie is still valid of course). Hence I think the "webpath" is not the issue, isn't it?




PW protected album login: Warning - michael42 - 2013-01-22

For your info, enabling mod_rewrite fixed the issue.

Thanks for your investigation,
Michael