Wordpress to Moodle pass through authentication plugin (wordpress end)
wp2moodle--wordpress-
Wordpress to Moodle pass through authentication plugin (wordpress end). Takes the user that is logged onto wordpress and passes their details over to Moodle, enrols them and authenticates.
Note, you must to rename the zip to be just 'wp2moodle.zip' before you upload the plugin to wordpress.
Activating and configuring the plugin
- Upload this to your wordpress (should end up being called /wp-content/plugins/wp2moodle/)
- Activate the plugin
- Click wp2moodle on the wordpress menu
- Set your moodle url (e.g. http://your-site.com/moodle/)
- Set the shared secret. This is a salt that is used to encrypt data that is sent to Moodle. Using a guid (http://newguid.com) is a good idea. It must match the shared secret that you use on the Moodle plugin. (https://github.com/frumbert/wp2moodle-moodle)
- Other instructions are available on the settings page.
- Edit a post or a page
- Use the moodle button on the editor to insert shortcodes around the text you want linked
- When authenticated as subscriber, contributor, etc, click on the link.
Note: If the user is not yet authenticated, no hyperlink is rendered. The link does not function for Wordpress admins.
Shortcode example
[wp2moodle class='my-class' cohort='course1' target='_blank']
Open my course[/wpmoodle]
class: the css classname to apply to the link (default: wp2moodle) target: the hyperlink target name to apply to the link (defaut: _self) cohort: the name of the moodle cohort in which to enrol the user
Licence:
GPL2, as per Moodle.
Moodle end of a Wordpress to Moodle Single Sign On auth plugin
wp2moodle--moodle
Data is encrypted at the Wordpress end and handed over a standard http GET request. Only the minimum required information is sent in order to create a Moodle user record. The user is automatically created if not present at the Moodle end, and then authenticated, and (optionally) enrolled in a Cohort.
How to install this plugin
Note, this plugin must exist in a folder named "wp2moodle" - rename the zip file or folder before you upload it.
- Upload/extract this to your moodle/auth folder (should be called "/~/auth/wp2moodle/", where ~ is your Moodle root)
- Activate the plugin in the administration / authentication section
- Click settings and enter the same shared secret that you enter for the wp2moodle settings in Wordpress
- The logoff url will perform a Moodle logout, then redirect to this url. Typically this is your wordpress homepage.
- The link timeout is the number of minutes before the incoming link is thought to be invalid (to allow for variances in server times).
- Disable any other authentication methods as required. You can still use as many as you like.
Usage:
You can not use this plugin directly; it is launched by wp2moodle from within Wordpress.
Licence:
GPL2, as per Moodle.