Problems, need help? Have a tip or advice? Post it here.
5 posts Page 1 of 1
Hello all!
Something interesting is happening with the logout link on my site.

Using this:

Code: Select all
  <li> <a href="<cms:show k_logout_link />" onclick="if( confirm('Are you sure you want to logout?') ) { return true; } return false;">Logout</a> </li>


After you hit 'ok', the url that it shows has an extra space in it:
...ehardball.com/%2Fdaily.php

that %2F causes a 404 error so whenever a person logs out from the comments or the menu bar, the next page they see is a 404.

Prettyurls are turned on
It doesn't happen when logging out of the couch admin section

any ideas?
Hi,

What does simple <a href="<cms:show k_logout_link />">Logout</a> fare? Does it exhibit the same problem?

If yes, then maybe you should take a look at the couch/addons/extentded/config.php file's '$t['login_tpl']' setting. Perhaps the name of the template has a space in it.

If no, then you should investigate the JS involved.
I can take out the javascript and nothing changes. My layout is like this...

page_A (index.php) - login form - this page has a redirect where once you log in, you get redirected to page_B

page_B (daily.php) - logout link - this page has an 'if' statement that if logged in, then you see the page, if not, you get redirected to page_A

pageA (index.php)
Code: Select all
 <!-- now the real work -->
                <cms:if k_logged_in >
                    <!-- this 'login' template also handles 'logout' requests. Check if this is so -->
                    <cms:set action="<cms:gpc 'act' method='get'/>" />
                    <cms:if action='logout' >
                        <cms:process_logout />
                    <cms:else /> 
                       <!-- directs to paid pages once logged in -->
                       <cms:redirect "<cms:link masterpage='daily.php' />" />
                    </cms:if>
                <cms:else />
                    <!-- show the login form -->



page_B (daily.php):
Code: Select all
<cms:if k_logged_in >
<!DOCTYPE html>
.
.
.
<cms:else />
<!-- if not logged in, redirects to public page -->
<cms:redirect k_site_link />
</cms:if>



But the funny thing is, when the logout processes, the url is page_b(daily.php), or at least it's trying to be, but there is that (what appears to be) urlencode getting in the mix:

http://...hardball.com/%2Fdaily.php

But, again, logging out from the couch admin panel, it works perfectly.

So, I'm wondering if this might be the issue:
The logout form IS the login form with an if statement to process.
The user cannot access index.php if logged in because if they are logged in, it redirects them to page_B(daily.php) . The redirect is AFTER the process_logout method but they are still within the same IF statement..... really, I don't know why the problem is happening....
HA, wow.. not sure what I did, besides reload my couch/config.php file, but everything is working fine now. logging out is fine... all good. :D :D
The more I look, the more I think maybe prettyurls weren't turned on. When I reloaded that must have set it for sure. I think I must've turned it off to troubleshoot something, then forgot about it... good job, brain :)
5 posts Page 1 of 1
cron