Encrypted Moodle password in database

Encrypted Moodle password in database

by tlili ahmed -
Number of replies: 3

Dear all,

I'm developing a new system using PHP. To log in to my system, the learners should authenticate using the created Moodle login and password. The problem is when I try to find if the entered password using my system (from users) exists in the Moodle database (specifically mdl_user table) I face a problem which is the already stored Moodle password is encrypted. 

Could you please kindly help me solve this problem? My system will work only on the Moodle database and no other databases are needed (for the moment). Thank you in advance.

Kind regards.


Average of ratings: -
In reply to tlili ahmed

Re: Encrypted Moodle password in database

by Dave Perry -
Picture of Testers

I did something similar for a proof of concept years ago. What we did was:

1) put the code for our own system within a non-moodle folder (e.g. siteroot/mysystemname/)

2) include these lines in the top of each of your system pages (in place of your login check code):

require_once("/path/to/config.php");
require_login();

this pulls in the moodle config file, so you can call the require_login function that moodle uses - and users will be forced to use the moodle authentication, without you having to understand their database tables or any other functions

Average of ratings: Useful (3)
In reply to Dave Perry

Re: Encrypted Moodle password in database

by tlili ahmed -

Dear Dave,

Perfect! It worked. Thank you so much.

Kind regards,

      Ahmed

In reply to tlili ahmed

Re: Encrypted Moodle password in database

by Awais Akbar -
Hi,


Now I am facing the same problem. I want to give users access to my system who have the Moodle account. For this purpose, I want to either encrypt the password entered by the user or decrypt the user password stored in moodle database. So that I may check whether user is valid or not. 


Please guide me about that. I couldn't understand your previous replies.


Thanks in advance.