× R0.30 Support

[Solved] Registration at VM directed to h/page?

9 years 7 months ago 9 years 7 months ago by Antonio Durán.
Ruth Cheesley
Posts: 54
More
Topic Author
[Solved] Registration at VM directed to h/page? #1
Hi all,

Not sure if this is Joomdle, Joomla or Virtuemart problem but thought I'd pose it in case anyone might be able to point me in the right direction.

I've got Joomdle working lovely with Moodle (version 0.30) with one fairly annoying glitch.

When the user registers through the checkout process their data is being stored and synchronised but they are redirected to index.php rather than the next stage of the process. When I go back to the cart and click checkout it works just fine, and the user is logged in.

Does anyone have any ideas where to start? I'm fairly sure it's a VM problem but wanted to rule out anything to do with Moodle. I've posted on the VM forums but as per usual, little in the way of response.

Thanks in advance,

Ruth
The topic has been locked.
9 years 7 months ago
Antonio Durán
Posts: 7128
More
[Solved] Registration at VM directed to h/page? #2
Hi.

In fact, it is a Joomdle issue.

As Joomdle needs to redirect the user to log him in Moodle, this behaviour is expected :(

There are a couple of workarounds:
- If Joomla and Moodle are on the same domain, you could try to use the "redirect-less login". For that. edit joomdlehooks.php, and at the end of onLoginUser, comment:
$app->redirect($moodle_url."/auth/joomdle/land.php?username=$username&token=$token&use_wrapper=0&create_user=0&wantsurl=$login_url" );

And uncomment:
plgUserJoomdlehooks::log_into_moodle ($username, $token);

This method is not fully tested, so I don't know if it will work.

- Modify login form/joomdlehooks plugin to adapt to the VM checkout process.
The topic has been locked.
9 years 7 months ago
Ruth Cheesley
Posts: 54
More
Topic Author
[Solved] Registration at VM directed to h/page? #3
Hi Antonio,

Thanks for the response, I really appreciate it and it's saved me quite a lot of time although already spent many hours troubleshooting.

Can I just check a few things:

1. If I comment out
$app->redirect($moodle_url."/auth/joomdle/land.php?username=$username&token=$token&use_wrapper=0&create_user=0&wantsurl=$login_url" );

and uncomment

plgUserJoomdlehooks::log_into_moodle ($username, $token);

Will the user still be logged into Moodle?

2. Do I need to modify login form/joomdlehooks plugin to adapt to the VM checkout as well as the above commenting/uncommenting?

It might be useful to have this as a yes/no feature in Joomdle - do you want to use redirect to homepage or not - to make it a bit clearer?

Ruth
The topic has been locked.
9 years 7 months ago 9 years 7 months ago by Ruth Cheesley.
Ruth Cheesley
Posts: 54
More
Topic Author
[Solved] Registration at VM directed to h/page? #4
PS what a superstar, it works :) However when the user logs in they're not logged into Moodle, even after the checkout process. They are created in Moodle but when they navigate to the moodle wrapper, they are not getting logged in.

Ruth
The topic has been locked.
9 years 7 months ago
Antonio Durán
Posts: 7128
More
[Solved] Registration at VM directed to h/page? #5
1. Yes. That should make.

2. No, it is one thing OR the other.

1) is not included in Joomdle as an option, mainly because it only works if you have Joomla and Moodle on the same domain. Also, becasuse of this, I did not test it much.

It is not that easy as ask if you want redirect ot not, as the redirect is needed for SSO to work (unless the redirect-less method works for you).

So, first try option 1) and if it does not work for you, we can take a look at option 2).

2)
The topic has been locked.
9 years 7 months ago
Antonio Durán
Posts: 7128
More
[Solved] Registration at VM directed to h/page? #6
If you are not being logged to Moodle, SSO is not working correctly. The reason I don't know :(

This method uses cURl, which I don't know if you have enabled.

We would need to take a look.
The topic has been locked.
9 years 7 months ago
Ruth Cheesley
Posts: 54
More
Topic Author
[Solved] Registration at VM directed to h/page? #7
Antonio,

You already have access (you did the HSBC work for me) - it worked just fine until the changes above. Given that around that line there is stuff to do with cURL I guess something got broken by making that change?

Ruth
The topic has been locked.
9 years 7 months ago
Antonio Durán
Posts: 7128
More
[Solved] Registration at VM directed to h/page? #8
Solved using redirect-less SSO.

Planned to add redirect-less SSO option for next relase. Note that this will only work when using the same domain for both Joomla and Moodle.
The topic has been locked.