MySQL Password

This is a two part system for use with mod_auth_mysql.

You will need to have a three fields in your table called
username password and datestamp. These can all be changed in
the scripts...


The first part is the perl script that puts the username
and password into the database. It will also put a timestamp
in the database so that you can limit the time that the password
is useable. The lenght of time that you allow the password to
live is from one hour to infinity....

To use the script, you call it from a form action.

You will need to pass the username, password and timeincrease
from the form. 'timeincrease' is the amount of time in hours
that the password should live.

The script will genereate a timestamp and increment it by however many
hours are indicated in 'timeincrease'. It will handle changing days, months
and years, depending on how long the 'timeincrease' is. There is only one
problem that this script can not handle, LeapYear. I would imagine that
it would be fairly simple to take care of this, but it shouldn't be a problem,
util the next leap year at least...


expire.pl is even simpler. Run it from a cron job, and it will check
the database and delete any rows that have a timestamp older than the
current time.


The script also comes with a commandline [wwwuser] utility for adding
users into the database... I suggest that this only be used for either
adding admin users or testing.. Any accounts that you add with this
utility will not expire until Dec 31, 2999 at 11:59:59 PM.

I will gladly accept any input about this script and the expire script.