Force Password Change at first logon

Force Password Change at first logon

by Vernon Williams -
Number of replies: 17

I have uploaded around 700 students into the database.  However, at the moment they all have the same password.  How can I force a password change the first time they logon?

Many thanks for any help.

KVW.

Average of ratings: -
In reply to Vernon Williams

Re: Force Password Change at first logon

by Marc Dastous -

I can't wait for the answer to this one, I realized after I uploaded 2300 users that this was the case surprise

Marc

In reply to Marc Dastous

Re: Force Password Change at first logon

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
In Moodle 1.5, if you set user passwords to "changeme", then they will be asked for a new password after the first time they log in.
In reply to Martin Dougiamas

Re: Force Password Change at first logon

by Marc Dastous -

Good morning Martin,

I am aware of this feature.  However, what can you do if you bulk upload users?What field would be used to toggle this to "active"?

And secondly, is there a way to change all users already in the database to force them to change/confirm their password on their next login?

Marc

In reply to Martin Dougiamas

Re: Force Password Change at first logon

by Barbaros Aslan -
Hi Martin,
Is there any parameter in the prepared upload user text file to force password change at first logon.  (such as ...Course1,Group1,changeme=yes)
In reply to Barbaros Aslan

Re: Force Password Change at first logon

by Res Hotz-Pohlmann -

If you like SQL you can do this job by running the following SQL statement directly in your moodle database:

insert into mdl_user_preferences

(userid, name, value)

select id as userid, 'auth_forcepasswordchange' as name, '1' as value

from mdl_user

where password = '201f00b5cd5d65a1c118e5c31431514c'

Just replace the red password code with the contents of the password field of the table mdl_user of the last imported useres.

In reply to Res Hotz-Pohlmann

Re: Force Password Change at first logon

by Edward Hewlett -
Thank-you, thank-you, thank-you! You have no idea how helpful this tip has been!

This really is a feature that should be implemented for bulk user uploads...
In reply to Martin Dougiamas

Re: Force Password Change at first logon

by warmac - -
why does force password change feature not redirect users back to main area instead it keeps them stuck in the change password mode is this a bug ?

I tried it myself and it doesn't redirect just keeps you locked in the change password page even after you changed it

In reply to Martin Dougiamas

Re: Force Password Change at first logon

by warmac - -
Hey Martin that changeme doesn't work at least on my end, all it does is consider changeme as the new password and if you enter changeme for the password then it directs you to changepassword page, strange no ?
In reply to warmac -

Re: Force Password Change at first logon

by Brent Lee -
What version of Moodle are you running? 
In reply to Martin Dougiamas

Re: Force Password Change at first logon

by Rui Boon Tan -
I had written a script that will force uploaded users to chage their password at their first login, instead of having the administrator to change it by hand. ( I used the auth_forcepasswordchange field. ) Hope it will solve someone's problem.
By the way, i had just started learning php, so if there is any bug, feel free to reply.
Average of ratings: Useful (1)
In reply to Rui Boon Tan

Re: Force Password Change at first logon

by Res Hotz-Pohlmann -

If you like SQL you can do this job by running the following SQL statement directly in your moodle database:

insert into mdl_user_preferences

(userid, name, value)

select id as userid, 'auth_forcepasswordchange' as name, '1' as value

from mdl_user

where password = '201f00b5cd5d65a1c118e5c31431514c'

Just replace the red password code with the contents of the password field of the table mdl_user of the last imported useres.

In reply to Martin Dougiamas

Re: Force Password Change at first logon

by Rui Boon Tan -
Sorry, slight mistake (extra ' at line 53). Updated one attached
In reply to Rui Boon Tan

Re: Force Password Change at first logon

by warmac - -
has anyone figured out the bug on force password change yet that keeps user stuck in the change password mode ?

In reply to Rui Boon Tan

Re: Force Password Change at first logon

by Chris Thompson -

Hello im having the same problem with bulk upload, i am new to this and i was wodering if you could tell me what to do with the file you have created above.

Thanks

In reply to Chris Thompson

Re: Force Password Change at first logon

by Rui Boon Tan -
You will have to upload the file to your moodle directory (something like "/home/www.example.com/htdocs/moodle") and then access the file by typing the location of the file (eg. "www.example.com/moodle/forcepasswordchange-updated.php").
By filling in the lowerlimit field with 3 and submit, the script will force all users except the default admin to change their password at the next login. If you only want to force password change for the latest batch upload, type in the lowest numeric id that moodle display
Hope that this will be useful
In reply to Martin Dougiamas

Re: Force Password Change at first logon

by wendy ng -

how do I disable forcepasswordchange upon first login then? And why do users prompted for password change upon first login?