frumbert / wp2moodle-moodle

Moodle end of a Wordpress to Moodle Single Sign On auth plugin
28 stars 29 forks source link

Integration question #1

Closed halburgiss closed 9 years ago

halburgiss commented 11 years ago

Tim,

I am new to Moodle and have a question on how the integration works. Its seems the user registers on the WP site, and then is automatically logged in to both the WP site and Moodle site. Is that correct? Can the user then login to either site with the same credentials, or must the login happen only on the WP site?

Secondly, if a user returns and registers for other courses, can the same account be used on the WP end, and the moodle end is automatically updated? (Or do I remember a cron job that sync these?)

My needs are really just to create a user from WP that can access Moodle without having to re-login.

Thanks.

frumbert commented 11 years ago

Hi Hal,

In this plugin, login always happens at the Wordpress end, and then when the user clicks some sort of link the Moodle end is opened and authenticates the user, creating them if necessary. The same user account is used for subsequent courses. I've assumed that a course has cohort-based enrolment, so you can either use a cohort as a membership provider for multiple courses or a single course. The cohort is part of the link that the user clicks wordpress-end, and so the user is enrolled to that cohort moodle-side when the link is clicked. There's no other background method synching accounts.

The password is salted and md5'd at the Wordpress end, so at no time do we know it; this is how Moodle does it too, so the plugin doesn't "know" the password and just stores the same value itself in the moodle password field.

I wrote the plugin pretty much exactly as your scenario requires, with the assumption that you must use cohorts as the membership provider moodle side. If you've got a wordpress end store for selling courses or arranging them in a catalogue etc, this should work for you.

LMK how you go!

Cheers, Tim

On 01/11/2012, at 3:07 AM, Hal Burgiss notifications@github.com wrote:

Tim,

I am new to Moodle and have a question on how the integration works. Its seems the user registers on the WP site, and then is automatically logged in to both the WP site and Moodle site. Is that correct? Can the user then login to either site with the same credentials, or must the login happen only on the WP site?

Secondly, if a user returns and registers for other courses, can the same account be used on the WP end, and the moodle end is automatically updated? (Or do I remember a cron job that sync these?)

My needs are really just to create a user from WP that can access Moodle without having to re-login.

Thanks.

— Reply to this email directly or view it on GitHub.

halburgiss commented 11 years ago

Hey thanks Tim!

Right now we are quoting this to a client with an existing Moodle setup. Thanks for the tip on cohorts. I don't know enough Moodle to fully understand cohorts, but would have missed that totally. If we get the green light from the client, the target launch date is March, so nothing likely to happen soon.

Thanks for the follow up, and posting this good information!

On Wed, Oct 31, 2012 at 6:46 PM, TIm St.Clair notifications@github.comwrote:

Hi Hal,

In this plugin, login always happens at the Wordpress end, and then when the user clicks some sort of link the Moodle end is opened and authenticates the user, creating them if necessary. The same user account is used for subsequent courses. I've assumed that a course has cohort-based enrolment, so you can either use a cohort as a membership provider for multiple courses or a single course. The cohort is part of the link that the user clicks wordpress-end, and so the user is enrolled to that cohort moodle-side when the link is clicked. There's no other background method synching accounts.

The password is salted and md5'd at the Wordpress end, so at no time do we know it; this is how Moodle does it too, so the plugin doesn't "know" the password and just stores the same value itself in the moodle password field.

I wrote the plugin pretty much exactly as your scenario requires, with the assumption that you must use cohorts as the membership provider moodle side. If you've got a wordpress end store for selling courses or arranging them in a catalogue etc, this should work for you.

LMK how you go!

Cheers, Tim

On 01/11/2012, at 3:07 AM, Hal Burgiss notifications@github.com wrote:

Tim,

I am new to Moodle and have a question on how the integration works. Its seems the user registers on the WP site, and then is automatically logged in to both the WP site and Moodle site. Is that correct? Can the user then login to either site with the same credentials, or must the login happen only on the WP site?

Secondly, if a user returns and registers for other courses, can the same account be used on the WP end, and the moodle end is automatically updated? (Or do I remember a cron job that sync these?)

My needs are really just to create a user from WP that can access Moodle without having to re-login.

Thanks.

— Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHubhttps://github.com/frumbert/wp2moodle-moodle/issues/1#issuecomment-9965012.

Hal

applesns commented 11 years ago

I'm looking into integrating Wordpress and Moodle (both latest versions) where courses are offered in Moodle such that WordPress pages are displayed by Moodle via links to them. S2Member is used to control users access to Wordpress pages. Can you tell me if WP2moodle-moodle will help with this? As in for instance providing a single login for both WP and Moodle? Thanks for any suggestions.

frumbert commented 11 years ago

The purpose of this pair of plugins was to allow a user to log in and manage their profile at the Wordpress end, and to be able to click links from a wordpress page/post that takes them through to a course inside Moodle. How users access the pages wordpress end is outside the scope of these plugins, so it should be compatible with whatever mechanism makes pages available wordpress-end.

There's no current facility in the plugin to go back the other way - so a user that enrols at the Moodle end (via a different enrolment mechanism, such as self-sign up) has no access to the Wordpress as such.

andytgeezer commented 11 years ago

So far so good Tim. Cohort sync is only so useful I've found, as my situation requires that students enrol only to a course when they click a link. So they may enrol for a course via a catalogue page in Wordpress, then get a certain time to complete the course. This means that cohort sync is of limited use as a cohort are all assumed to end at the same time.

Is there any way we can use this to enrol people just into courses and not into a cohort?

Thanks!

frumbert commented 11 years ago

Not in the current version, but i'll look into it now that you have mentioned it. I guess it would make sense to be able to either enrol as a manual or self enrolment as well, so that you could enrol as user as "self" to access duration, inactive-after and so on. However I may then have to look at which instance of self enrolment either as a settable value wordpress-side, or a setting for incoming enrolments moodle side - not hard to implement, just something more to think about. Do you think your situation would be as complicated as all that?

groovetemple commented 10 years ago

Hey there, does this plugin allow me to still use the external db enrollment plugin for actual enrollment into courses? I'd like to primarily use WP database to manage users and enrollments and pull the data from wp database into the moodle database. I'm using s2member for membership where we plan to add fields into the database that would match in moodle ultimately enrolling them into the specific course they paid for. Actually, come to think of it would be great if this plugin was able to read the custom capabilities and membership level provided by the s2member and write that to moodle database when they log into moodle. If not, at the very least, hoping my first question is yes... Thanks,

-L

frumbert commented 10 years ago

this plugins job is really to create a minimal user record in the moodle database and very little else. The user isn't created/updated moodle-end until the user clicks the link generated, whereas db integration generates users on a cron job. a Membership enrolment, and indeed other types of user enrolment aren't impacted at the Moodle end, so if you are using the Moodle database enrolment then users who are enrolled through that provider can still log on or interact. I chose cohorts as a membership provider to enrol users to courses since they are reusable across multiple courses and it's all managed in-moodle, rather than setting up another provider for memberships directly (which might be what you are looking for, I think). I've also been meaning to add the capability to directly enrol a user to a course without a cohort being specified, but haven't gotten around to it yet!

groovetemple commented 10 years ago

Hey Tim, thanks for the reply!! After giving it some thought, this method seems pretty logical and easy to implement. I have a couple of questions... Based on your demo it looks like I can enroll a user into multiple cohorts from one one link, is that correct? Also, once they are enrolled in moodle, how does one uneroll them, does your plugin do that? Additionally, the only way these users can access moodle is via the links provided by your plugin, is that correct? The user can't go to moodle and login directly.. A possible scenario on how we may use this is creating cohorts and using cohort sync to enroll users to the course while also enrolling them into different groups simultaneously. The user is is enrolled by clicking on a link from our WP site protected by membership software. One last question that just popped up is ... If I give access to a user as one Cohort and later they buy access that enrolls them into another cohort, the user will now be a apart of 2 Cohorts on the moodle side? It seems the question of unenroll still arises?

frumbert commented 10 years ago

There's really no permanent "connect" between the wordpress user and the moodle user; that is, unenrolling isn't supported by this plugin. This plugin doesn't make decisions about Moodle enrolments either (such as access period, user type / capabilities) since that's a Moodle administration thing.

The user shouldn't be able to get to moodle directly, since there's no way to know the password stored for the user in Moodle. I expect that you would set your logout url in Moodle to be your Wordpress site (or even its logout page, so you sign out of both), and use WP as your front-end.

The cohort enrolment is single per link. I felt that this distinction was better because you would probably would have a different sale option of the page/link if the user was enrolling for multiple courses at the same time.

You enrol a user in a cohort, and then [in Moodle] decide one ore more courses that cohort provides membership for. The same user can be in many cohorts, and cohorts can be membership providers for zero or more courses.

groovetemple commented 10 years ago

Thanks Tim! I was looking at other methods for enrollment and authentication and this far simpler than other methods at least good stepping stone to get things going quicker. What's your intention for the future development of this plugin? Are you planning on having this plugin around a for long while? Just curious .. We are going to use it on our site, so thank you for doing the work!

seankgalliher commented 10 years ago

hi I set it up correctly testing it for our needs however it does seem to auth we are running mooodle 2.6.1 and wp 3.8 thanks you for your time my setup 2-5-2014 9-53-39 pm 2-5-2014 9-53-10 pm