Hi all,
I am trying to force all users to change thier password every week, but I only could force them to change it at their first loggin.
It is possible to force a password change periodically?
Thanks.
I think, out of Moodle 1.9's authentication modules, only the LDAP module has a setting for periodic password expiration (and that's mostly just support for a normal LDAP server's password expiration feature).
If you're using the Manual authentication plugin, you could write a cron job to do this. You'd need to do something like the following:
1. Update the Manual auth plugin's "user_update_password()" function so that it records the time when a user's password is updated (probably recorded either as a user preference using set_user_preference(), or as a custom profile field)
2. Create a local cron job by creating a file called local/cron.php. In this cron job, search the database for users whose last password change date is greater than 7 days. Mark them for a password reset by calling set_user_preference('auth_forcepasswordchange', 1, $userid).
3. Also in the local cron job, check for users who don't have a last password change date set, and fill in the present time as their last password change date.
Cheers,
Aaron
If you're using the Manual authentication plugin, you could write a cron job to do this. You'd need to do something like the following:
1. Update the Manual auth plugin's "user_update_password()" function so that it records the time when a user's password is updated (probably recorded either as a user preference using set_user_preference(), or as a custom profile field)
2. Create a local cron job by creating a file called local/cron.php. In this cron job, search the database for users whose last password change date is greater than 7 days. Mark them for a password reset by calling set_user_preference('auth_forcepasswordchange', 1, $userid).
3. Also in the local cron job, check for users who don't have a last password change date set, and fill in the present time as their last password change date.
Cheers,
Aaron