Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
1.1k views
in Q2A Core by
Have been trying for some time now to get my head around the integrated log in, but really am lost.

At the moment i can click 'log in' and it takes me to the other sites log in page, all well and good, but after logging in it does not re-direct back to Q2A.

I've tried two different locations for Q2A.

First: Both sites as sub domains so,www. profiles.mysite.com and www.q2a.mysite.com

If i use:

* Your QA site:        http://qa.mysite.com/
        * Your login page:     http://www.profiles.mysite.com/login
        * Your register page:  http://www.profiles.mysite.com/register
        * Your logout page:    http://www.profiles.mysite.com/logout

It does not redirect.

So then i tried a different location:

Main site www.profiles.mysite.com

And q2a in a subfolder, so: www.profiles.mysite.com/q2a

For this i used option 3 eg:

'login' => $relative_url_prefix.'../profiles/index.php?redirect='.urlencode('qa/'.$redirect_back_to_url),

But again it does not re-direct.

Not being so good with php, am i supposed to change anything in the above option 3? i.e. am i supposed to change 'relative_url' or .urlencode?

Your help would be most appreciated, sorry for not understanding code too well!

1 Answer

0 votes
by

Hi there. The redirect has to actually be done by your login page, i.e. by reading the redirect parameter, and using it in a Location: HTTP header after the user logs in. It doesn't happen automatically just because the parameter is there. See qa_redirect_raw(...) in qa-base.php for how to implement a redirect.

by
Aha! Thanks for that, i'm slowly getting the hang of this! No doubt i'll have more questions later....cheers!
by
could you explain what code you used I can't figure out the redirect.
I've got 'login' => '../index.php?title=Special:UserLogin?redirect=".urlencode("qa/".$redirect_back_to_url)',
what should I put instead of '$redirect_back_to_url'? thanks
by
You need to understand whether the MediaWiki software can redirect after the user logs in, and how this parameter should be supplied to its login page.
...