AnotherAndrew Posted April 24, 2013 Share Posted April 24, 2013 I'm developing a site for a client in a private directory on my web host that is running wordpress. In the clients site, I have a members section that requires a login. I'm having trouble with the logout url which when called will go to the wordpress logout screen when called. This is what I have for code: <div class="login-message">Hello <?php echo $page->title; ?>. Welcome back. <a class="logout" href="?logout=1">Logout?</a></div> I know that it will be fine in a live site but I need to show this functioning as intended for the client. Does anyone have any experience or suggestions on how to resolve this? Link to comment Share on other sites More sharing options...
Luis Posted April 24, 2013 Share Posted April 24, 2013 Why dont you call a pw page with this get variable? Sth. like <?= $pages->get(1)->url ?>?logout=1 Link to comment Share on other sites More sharing options...
AnotherAndrew Posted April 24, 2013 Author Share Posted April 24, 2013 Thanks Luis. But that doesn't log the user out. Link to comment Share on other sites More sharing options...
Luis Posted April 24, 2013 Share Posted April 24, 2013 In which System do you want to perform the logout? Pw or Wp? Link to comment Share on other sites More sharing options...
AnotherAndrew Posted April 24, 2013 Author Share Posted April 24, 2013 Processwire I also have this right after my call to logout: <?php if($input->get->logout == 1) { $session->logout(); $session->redirect("/login/"); } ?> Link to comment Share on other sites More sharing options...
Luis Posted April 25, 2013 Share Posted April 25, 2013 Do you perform the redirect before any html markup? Make sure that the logout handler is called before <html> Link to comment Share on other sites More sharing options...
AnotherAndrew Posted April 25, 2013 Author Share Posted April 25, 2013 Luis, now I am calling the redirect before my html. The redirect works but it is still not logging the user out. Link to comment Share on other sites More sharing options...
Luis Posted April 25, 2013 Share Posted April 25, 2013 strange, for understanding, your use case: User is in a PW environment and clicks on a link which sets a get variable to logout=1. After logging the user out you want to perform an redirect to the login page. So, you set up the following: template file with the logout button. <? if($input->logout) logout and redirect ?> <html><head>etc.. <a href="?logout=1"> Did I understood right? Link to comment Share on other sites More sharing options...
AnotherAndrew Posted April 25, 2013 Author Share Posted April 25, 2013 Yes that is correct. There aren't any known issues installing PW inside WP, right? Link to comment Share on other sites More sharing options...
ryan Posted April 28, 2013 Share Posted April 28, 2013 There aren't any known issues installing PW inside WP, right? I don't think that many have done this, so we can't say for sure what the issues might be. One that I am aware of is a name conflict between WordPress's gettext() functions and our language functions. Though not sure if it still matters if you aren't using multi-language. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now