R0.24 No Longer Supported

404 'Not Found Error' after login

More
15 years 10 months ago #21 by Antonio Durán
Replied by Antonio Durán on topic Re: 404 'Not Found Error' after login
Ok. No more ideas for now :( ... so let me know how it goes and tell me if you need a hand.
The topic has been locked.
More
15 years 10 months ago - 15 years 10 months ago #22 by Howard
Replied by Howard on topic Re: 404 'Not Found Error' after login
Hi I setup a new test site.

Installed Joomla/Virtuemart/Moodle -
Joomla installed on subdomain ie - www.joomla.mywebsite.co.uk
Moodle installed on subdomain ie - www.moodle.mywebsite.co.uk

using the same MYSQL base

When I login into Joomla the next view I see in the same window is moodle "MY courses " at that point it halts

It should be going back to joomla home page.

At one point I thought it was okay but it was not to be.
Anyway before I give in. I thought I would repost the echo log when logging in just incase it gives you more insight with what I should try next.....
Code:
http://www.moodle.mywebsite.co.uk/auth/joomdle/land.php?username=myname&token=8dcce991ff5172953c79634501349d96&use_wrapper=0&create_user=0& wantsurl=%2F

Thanks so far for all your help.
Last edit: 15 years 10 months ago by Howard.
The topic has been locked.
More
15 years 10 months ago #23 by Antonio Durán
Replied by Antonio Durán on topic Re: 404 'Not Found Error' after login
Hi,

it seems it is redirecting to '/' (%2F), and so getting you to your moodle site root.
This could be a bug, as I have not tested with different domains....

You could try modifying the code a bit to see if it helps.

In moodle/auth/joomdle/land.php there is this code:
default:
if ($wantsurl)
$redirect_url = urldecode ($wantsurl) ;
else
$redirect_url = get_config (NULL, 'joomla_url');

This code appears twice, for use with wrapper or without. I see you are not using the wrapper option, so you should modify the second occurrence.
Just comment the 3 first lines out.

default:
// if ($wantsurl)
// $redirect_url = urldecode ($wantsurl) ;
// else
$redirect_url = get_config (NULL, 'joomla_url');

This should redirect you to Joomla main page.
The topic has been locked.
More
15 years 10 months ago #24 by Howard
Replied by Howard on topic Re: 404 'Not Found Error' after login
Before I try amending code.

I have selected in joomdle > configuration > links behaviour > Open Moodle Links in Wrapper.

Have I missed something out?
The topic has been locked.
More
15 years 10 months ago #25 by Antonio Durán
Replied by Antonio Durán on topic Re: 404 'Not Found Error' after login
I thought you had not, since the link you gave me includes the "use_wrapper=0".
There is no other place to set this configuration option.
The topic has been locked.
More
15 years 10 months ago #26 by Howard
Replied by Howard on topic Re: 404 'Not Found Error' after login
I have switched the wrapper off and switched to new window and get the same link "use_wrapper=0"

????
The topic has been locked.
More
15 years 10 months ago - 15 years 10 months ago #27 by Antonio Durán
Replied by Antonio Durán on topic Re: 404 'Not Found Error' after login
It should be use_wrapper=1 when you have wrapper active....

Or maybe I am wrong, now that I re-think it, and it always put use_wrapper=0 when doing the joomdlehooks action, as it does not really matter there.

EDIT: I looked and the code and it is like I said. It is always 0 in the joomdlehooks plugin. Sorry for the confussion.

You should then try to modify the land.php file as I said....
Last edit: 15 years 10 months ago by Antonio Durán.
The topic has been locked.
More
15 years 10 months ago #28 by Howard
Replied by Howard on topic Re: 404 'Not Found Error' after login
okay no problem I'll change the code thanks although I have tried it and seems to work but I'll try it out a few times and let you know how I get on.

By the way I also had to turn SEF of, so after this is sorted Ill try out the update you put out...
The topic has been locked.
More
15 years 10 months ago #29 by Howard
Replied by Howard on topic Re: 404 'Not Found Error' after login
Hi..

Your update works for me fantastic thanks.

I am now redirected back to the Joomla page without any shown errors

However I don't think SSO is working when logging out!

So login is okay but logout is not logging out on both nearly there.....
The topic has been locked.
More
15 years 10 months ago #30 by Antonio Durán
Replied by Antonio Durán on topic Re: 404 'Not Found Error' after login
I thought of this some time ago but I forgot to put it into the docs and to further investigate, will do right away.

As of how Moodle sessions work, single log out from Joomla to Moodle (ie, logging out of Moodle when doing so of Joomla) is not going to work between 2 different domains :(

Moodle sessions are just PHP sessions, and because http security restrictions, a domain can not mess with another domain's sessions/cookies, so Joomdle plugin in Joomla cannot delete the moodle session.

I will try to find out if it is possible to overcome this restriction, but I don't think so. Will update you as soon as possible.

Sorry for the inconvenience :(

If you don't want to wait, you could always install moodle in the same domain as joomla. I don't know why it was not working before, but if it works across domains, it should work in the same one.
The topic has been locked.