How To / General

Moodle Authentication - Only For Users With Virtuemart Order

  • michaelhermary
  • Topic Author
  • Offline
  • Banned
  • Banned
More
10 years 9 months ago #1 by michaelhermary
Is there a way to give moodle access only to users who have a 'Confirmed' Virtuemart order? I don't want just any person who registers in Joomla to have access to my moodle.

In the past I've done this with moodle's external database authentication pointing to a mysql view I'd created, and I'd be happy to use that again if there's a way to bypass Joomdle for authentication, but currently when I try that, I get the error: "XML-RPC Error (702): Unable to locate function, or function prohibited for RPC."

Or if there's a way to do it through Joomdle, that would be fine too.

Thanks!

Please Log in or Create an account to join the conversation.

More
10 years 9 months ago #2 by Antonio Durán
Hi.

You can do this with Joomdle. Set "auto create users on Moodle" to No, so new users are not added to Moodle by default.
When a user buys a course, and needs to be enroled, Joomdle will then create the Moodle account if it does not exist yet.

Please Log in or Create an account to join the conversation.

  • michaelhermary
  • Topic Author
  • Offline
  • Banned
  • Banned
More
10 years 9 months ago #3 by michaelhermary
Sorry for the trouble, but I'm still a little confused. If I have thousands of old users in Joomla, and I only want those with confirmed Virtuemart orders to have access to the moodle (i.e. I don't want them to even be able to see the moodle unless they have a confirmed order), and then the same for NEW confirmed VM orders going forward, can I accomplish this with Joomdle by simply setting 'auto create users on Moodle' to No? If I change a past VM order from confirmed to pending, will that stop the user from having access to moodle as I would hope? I suppose not, right?

Is there a way for me to go back to using my external database for authentication, and then only use Joomdle for single sign on?

Please Log in or Create an account to join the conversation.

More
10 years 9 months ago #4 by Antonio Durán
I thought you were talking about new users. What you describe cannot be done with Joomdle, as it does not block access to Moodle (nor does it unenrol from course) when setting order back to Pending.

I am not sure how would use an external db for auth, and use Joomdle SSO. If you have Joomdle SSO, user will be logged to Moodle when he logs to Joomla.
You say you used it in the past: can you explain how it worked?

Please Log in or Create an account to join the conversation.

  • michaelhermary
  • Topic Author
  • Offline
  • Banned
  • Banned
More
10 years 9 months ago #5 by michaelhermary
Back on Joomla 1.5 I was using Promoodle to bridge between Joomla and Moodle, and that allowed me to use Moodle's native functionality of looking to a database for user authentication.

I built a mysql view of all Joomla users who had a confirmed Virtuemart order, and that's what determined if they could access the moodle. So I guess Promoodle would pass their login credentials to moodle, but only if they were in my mysql view (I'm not sure of the order of events, but something like that).

So it seems like I might need to build my own extension for single sign on between Joomla and Moodle?

Please Log in or Create an account to join the conversation.

More
10 years 9 months ago #6 by Antonio Durán
Well, I think the best way would be to create something to block access to Moodle for users as per you requisites, as it is easier than creating your own SSO.

I would think of a plugin in Joomla, that would trigger like the Joomdle-VM one does (when order status changes).
This plugin would then check user orders, and if there are no confirmed ones, block access.

Please Log in or Create an account to join the conversation.

More
10 years 8 months ago #7 by Chris
A few different thoughts:
- It appears as though you have no problem with new users ie just purchase a course and get enrolled
- For past users who purchased, since they have a confirmed status, you should be able to write a once of SQL script to update Moodle as you need OR sync all and write a once off MYSQL script to remove those who did not confirm a VM order from Moodle.
- To remove users from Moodle. I am not sure why you would want to change the order status to pending. They have legally paid for a course and paid - I assume. When not just set an expiry date on their Moodle access?

Please Log in or Create an account to join the conversation.