thorpe, I agree with your answer. badgoat I think your looking for an implementation such as theirs or you could do it by assigning a random password based on the time of the exectution. You could then store the password linked to a user identification number or name ... then also set a field that has the time() value stored in it. Then run a quick little script such as :
function CheckTime($start_time)
{
// calculate elapsed time (in seconds!)
$diff = time()-$start_time;
$daysDiff = floor($diff/60/60/24);
$diff -= $daysDiff*60*60*24;
$hrsDiff = floor($diff/60/60);
$diff -= $hrsDiff*60*60;
$minsDiff = floor($diff/60);
$diff -= $minsDiff*60;
$secsDiff = $diff;
if($daysDiff > 0)
{
return 1;
}else{
return 0;
}
}
What this will do is check to see if the days difference. If it's over a day (24 hours) then it will notify you that you are to change the password. 1 = change ... 0 = no change.
It might cut out some work for you keeping track of the whole scheme yourself. Just do it when they login (assuming they are going to login with their given password). When they login just pull the timestamp that was used when the password was assigned. Run it through the function and if it comes up with one make them change their password or assign them a new one.
EDIT: Sorry, I had a typo.
Chad