1 |
efrain |
1 |
moodle-local_resetpassword
|
|
|
2 |
==========================
|
|
|
3 |
|
|
|
4 |
/**
|
|
|
5 |
* @package local
|
|
|
6 |
* @subpackage resetpassword
|
|
|
7 |
* @copyright 2014 Aaron Leggett
|
|
|
8 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
|
|
9 |
*/
|
|
|
10 |
|
|
|
11 |
This local plugin allows an external service to access moodles reset password functionality.
|
|
|
12 |
By posting a secure key, along with the user accounts email address, the local plugin will check against certain criteria before loggin, and sending the moodle password reset email.
|
|
|
13 |
|
|
|
14 |
The plugin checks a series of events before allowing the password reset email to be sent.
|
|
|
15 |
1 - Checks the plugin has been enabled (plugin setting disabled by default)
|
|
|
16 |
2 - Checks the encrypted key from the POST message matches the one stored in moodle (plugin setting)
|
|
|
17 |
3 - Checks the user exists in the moodle user table
|
|
|
18 |
4 - Checks the user is not an admin (admins have been restricted from using this plugin for security reasons)
|
|
|
19 |
|
|
|
20 |
The plugin works by an external service sendding a POST request to the following plugin file
|
|
|
21 |
[YOUR MOODLE URL] / local / resetpassword / reset.php
|
|
|
22 |
eg moodle.example.com/local/resetpassword/reset.php
|
|
|
23 |
|
|
|
24 |
The file requires two variables to be posted to it.
|
|
|
25 |
e - the email address of the account
|
|
|
26 |
k - the encrypted key
|
|
|
27 |
|
|
|
28 |
The encrypted key that is posted to the file is created by concatenation of the email address and the private key (set in moodle), this is then encrypted with MD5.
|
|
|
29 |
|
|
|
30 |
eg
|
|
|
31 |
e = test@test.com
|
|
|
32 |
k = MD5('test@test.com' . 'private key')
|
|
|
33 |
|
|
|
34 |
For any further information regarding this plugin, please see the GITHUB issues or email the developer with the details below
|
|
|
35 |
- https://github.com/SMERKY/moodle-local_resetpassword/issues
|
|
|
36 |
- aaron@aaronleggett.com
|
|
|
37 |
|
|
|
38 |
|