Fixed all errors and got the password reset and expiration working. Implemented logout function.
Created this page to reset the password on expiration
The sql dump