I need to to echo the logged in user password for some reason ...
when i use $USER->password it gives me long row of characters, it seems that these characters are encrypted, how can i echo the real password ?
thank you so much in advance ...
It would help if we knew why you needed to echo the password and then we can provide advice to an alternative sollution, you cannot echo the exact password as a user would type it for obvious security reasons.
The reason it's hashed is to prevent anyone from seeing the true typed password but the system hashes the user input and matches that against the stored value.
i have one Moodle installation over 50 different databases (oracle) - i.e. one moodle for 50 schools in the same geographical area (~24000 students)
one requirement: the customer wants some admin users (assigned an admin role over the system) to be able to browse other schools through some kind of graphical interface, we prapered a 3D map for the area, and the administrator must be able to choose which school he wants to log in, when he chooses the school I want him to be logged in automatically without entering the username and password again, giving that he has the same username and password added on all databases and assigned previously the admin role on all schools databases (of course with the same username and password), i.e. something like, let's say, a root admin.
we prepared the script with hardcoded password and it worked, but when I try something like this:
<input type = hidden name="password" value="$USER->password" /> it won't log that admin onto the school he chooses !!
that's why i need a way to grab the password and provide it (along with the username) as log on credentials to the target school moodle interface ..
anyhelp would be highly appreciated !!
If I understand this correctly then when the admin attempts to log in to the different install, the hashed password is being hashed again on the login check so failing to find a record.
It's not really secure but you could modify the login check to see if the refering url is in a list of trusted and then not hash the password again but they would need the account to already exist at that install. Just a thought.
Or for a more secure method look at creating an OAuth plugin
Has this been fixed in the export as that's where the real security issue lies as far as I can see. A teacher should not be able to export all users from the site only the courses that they teach on, or is it due to the admin being enrolled on a course which is always a bad idea?
But very alarming.
Nice point James, just because you can, doesn't mean that you should!
This hash seek in video does find "dougiamas" and can handle long passwords like 123456789012345678901234567890 but seems to fail with simple passwords like "teståäö" - we could actually use http://gdataonline.com/seekhash.php in good purpose to test our password MD5 hash strength with some non a-z and 0-9 characters
In a long run MD5 hashing should be replaced with some better hashing method...
Maybe moodle could have something similar like
http://www.microsoft.com/protect/fraud/passwords/checker.aspx
to test user password strength...
In addition to that, I'd like to remember that moodle currently has a password policy setting where you can impose some constraints on users passwords (minimum length, at least that many digits, at least that many symbols, that many lower case letters, etc.).
You can find it under Administration >> Security >> Site Policies.
Saludos, Iñaki.