• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Login From External Page Needs Redirect To Original Page

LPH

Well-known member
#1
I currently have the following in a WordPress child theme:

PHP:
echo '<span id="member" class="logIn_menu_class"><a href="http://community.tuxreportsnetwork.com/login" class="OverlayTrigger inner">Log In or Sign Up</a></span>
What should I put in the href to get a redirect back to the current page? If I manually put something into the browser like the following ....

PHP:
http://community.tuxreportsnetwork.com/login?redirect=http://www.educlassics.com/wp-admin/[php]
 
I get the community login but the redirect never happens.
 
Any thoughts?
 

LPH

Well-known member
#4
OK. I'm stumped :(

This is probably going to be so obvious that I'm going to be embarrassed but ... OK. So be it !


PHP:
  <div id="xenlogin">
            <form action="http://community.tuxreportsnetwork.com/login/login" method="post" id="pageLogin">
           
              <div class="ctrlWrapper">
                <dl class="ctrlUnit">
                  <label for="LoginControl">Your name or email address:</label>
                  <input type="text" name="login" id="LoginControl" class="textCtrl" tabindex="101" />
           
                  <label for="ctrl_password">Password:</label></dt>
                  <input type="password" name="password" id="ctrl_password" class="textCtrl" tabindex="102" />
           
                  <input type="submit" class="button primary" value="log_in" tabindex="104" data-loginPhrase="log_in" data-signupPhrase="sign_up" />
                  <label for="ctrl_remember" class="rememberPassword"><input type="checkbox" name="remember" value="1" id="ctrl_remember" tabindex="103" /> stay_logged_in</label>
           
           
              </div>
           
              <input type="hidden" name="cookie_check" value="1" />
              <input type="hidden" name="redirect" value="$requestPaths.requestUri " />
              <input type="hidden" name="_xfToken" value="$visitor.csrf_token_page " />
             
            </form>
          </div>
 
 
  ');

This obviously fails with the message:

Code:
The requested page could not be found.
[URL]http://community.tuxreportsnetwork.com/$requestPaths.requestUri[/URL]

My understanding is that $requestPaths.requestUri and $visitor .... are from XenForo which I can call from the WordPress theme ... if I knew how :)

Any suggestions?

Update: Let me give a few more details as I'm trying things. This code causes the WordPress page not to load.

PHP:
              <input type="hidden" name="redirect" value=" ' . $XF->visitor->get( 'requestPaths.requestUri' ) . ' " />
               <input type="hidden" name="_xfToken" value=" ' . $XF->visitor->get( 'visitor.csrf_token_page' ) . ' " />
 
Last edited:

LPH

Well-known member
#5
OK.

Here is the code for the redirect to a current blog URL:

PHP:
<input type="hidden" name="redirect" value=" ' . get_permalink( $post->ID ) . ' " />
I still need to work on the cookie issues because this is a multisite / multidomain configuration ....
 
#6
Just wanted to add, that I had a plugin made by a XF dev and the redirection works perfectly for XenWord. My blog and forum are on different subdomains as well. If anyone is interested in the addon let me know.