frumbert / wp2moodle-moodle

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

From wp2moodle user records will be insert into wordpress database or both moodle and wordpress? #29

Closed gaurav12y closed 7 years ago

gaurav12y commented 7 years ago

From wp2moodle user records will be insert into wordpress database or both moodle and wordpress?

frumbert commented 7 years ago

You create users in Wordpress in your normal way, whatever that is. When the user clicks the link, it creates a user record in the Moodle database (if required) and then logs them on as that user. If the user has already been created in Moodle, their record gets updated if there are any differences (such as their name or email address changed).

gaurav12y commented 7 years ago

When the user clicks the link, it not create a user record in the Moodle database.

frumbert commented 7 years ago

ll right, now tell me about both your systems, all your setup, what the configuration settings are, how it was set up, what degree of investigation you've already tried (such as enabling debugging in moodle, or reading your servers php error logs) and I'll try to help out where I can.

gaurav12y commented 7 years ago

All time i show this error after click on the link,Currently, you are not enrolled in any courses. To enroll in a course, please click on the link shown below. in following screenshot there are wordpress plugin code where query not give any result. screenshot

frumbert commented 7 years ago

I'm not really clear on what you are trying to do here, or what relevance this code has. Perhaps you can start by telling me what you want to do.

gaurav12y commented 7 years ago

I have moodle (3.1.2) installed and wordpress (4.8.1) installed on the same server i want to sell moodle courses from wordpress using wp2moodle sso plugin , in wordpress section i have installed woocomerce to sell the courses after buy the courses there are a link to go to the moodle section with shortcode like [wp2moodle course=”GEN_CHM_ALL_Grade3″ ]Launch The Course[/wp2moodle] but all time i get "Currently, you are not enrolled in any courses. To enroll in a course, please click on the link shown below." message when ever i debug the wp2moodle sso plugin from wordpress section then show $muserdetail variable not giving any result from moodle user detail that's it's giving enrolement issue. Related screenshot attached in previous comment.

frumbert commented 7 years ago

Were you able to set up access to that course as a product in WooCommerce instead, as descibed here: http://wp2moodle.coursesuite.ninja/docs/wp2moodle/setting-up-2/setting-up/ ?

What enrolment method(s) do you have set up on the course with idnumber GEN_CHM_ALL_Grade3?

gaurav12y commented 7 years ago

Yes , Course idnumber = GEN_CHM_ALL_Grade3, Manual enrolments, I have checked this on cohort enrolements also.But SSL certificate is not installed on the server.

frumbert commented 7 years ago

SSL not required for this plugin.

Are there any users in your database already that have the idnumber column set?

Have you enabled developer debugging and display enabled? (site administration > development > debugging , then tick Display debug messages and set Debug messages to Developer) - I wonder if there's an error that is being skipped over during user creation and the user isn't being enrolled because of it.

gaurav12y commented 7 years ago

Yes, I have enable developer debugging message in moodle.but i cant find any result regarding this.

frumbert commented 7 years ago

Are there any users in your database already that have the idnumber column set?

gaurav12y commented 7 years ago

Yes

frumbert commented 7 years ago

Ok, well it might be a clash then. Can you try pulling the latest version of this plugin (updated a few hours ago) which introduces a setting which allows you to set a prefix on the ID number that is stored. Add a prefix, such as "wp2m" so that users who are created through the plugin don't accidentally clash with user ids of other existing users, then try signing them through again.

gaurav12y commented 7 years ago

When ever i have downloads plugin from github and installing in wordpress its show fatal error it's not enabling from wordpress admin section.

frumbert commented 7 years ago

I made a change in the Moodle plugin - this repo. There has been no change in the Wordpress plugin. I could help you with that if you tell me what the "fatal error" is, and the steps you took (e.g. https://github.com/frumbert/wp2moodle--wordpress-#activating-and-configuring-the-plugin)

gaurav12y commented 7 years ago

Sir the issue in WordPress Plugin when ever i install the plugin it give error message like

Parse error: syntax error, unexpected '.' in C:\xampp\htdocs\wordpress\wp-content\plugins\wp2moodle\wp2m.php on line 187 Please help me.

gaurav12y commented 7 years ago

I have fixed Plugin Issue. But i have a question if i want to sell multiple courses buy WooComerce then how to identified which course is user purchased and how to enroll in the particular course.

frumbert commented 7 years ago

Glad you got it sorted. The line you mentioned helped me identify the problem too. While I'm not an expert in how to run a WooCommerce shop, other people have used the 'ecommerce integration' guide on this documentation page. Basically for each course on Moodle, you add a virtual digital download product in WooCommerce. A user buys that product in Woo, then rather than downloading a file the user is redirected to the single sign on, which enrols them in that course and opens it. If you want to sell access to multiple courses, you can specify multiple course identifiers using commas, also as described in that documentation page.