Re: [Dave] Website Membership 1.06 Released!
Hi Dave,
I just upgraded a site to CMSB 2.13 (from 1.07) and its website membership plugin to 1.06 (from 1.03).
I've now got a strange problem that keeps users locked in a loop when they try to login. (Clicking on submit keeps returning them to the member login page, and the link continues to be member_login.php?loginRequired=1)
My client's site uses a flash masthead, and up to now I’ve been using this function to detect mobile browsers and swap out the flash for a .png.
<?php
function mobile_detection ()
{
if (isset($_SERVER['HTTP_X_WAP_PROFILE']) || isset($_SERVER['HTTP_PROFILE']))
return true;
if (isset ($_SERVER['HTTP_ACCEPT']))
{
$accept = strtolower($_SERVER['HTTP_ACCEPT']);
if (strpos($accept, 'wap') !== false)
return true;
}
if (isset ($_SERVER['HTTP_USER_AGENT']))
{
if (strpos ($_SERVER['HTTP_USER_AGENT'], 'Mobile') !== false)
return true;
if (strpos ($_SERVER['HTTP_USER_AGENT'], 'Opera Mini') !== false)
return true;
}
return false;
}
?>
It gets called with:
<?php $_SESSION['mobile'] = mobile_detection(); ?>
<?php if (!isset ($_SESSION['mobile']) OR $_SESSION['mobile'] == true) : ?>
<img src="images/masthead.png" width="800" height="183" />
<?PHP else: ?>
.... Code to display flash masthead...
<?PHP endif ?>
This approach worked with the website membership plugin 1.03, but in 1.04, 1.05 and 1.06, unless I take out the function call the looping occurs.
If I take out the function call, the user is logged in and redirected to the WEBSITE_LOGIN_POST_LOGIN_URL
Any idea why?
Thanks,
Jerry Kornbluth
The first CMS Builder reference book is now available on-line!
Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php