01-15-2017, 09:40 PM
Below is some very rough guidance but it is a point in the right direction.
I think the simplest way to do this would be to add a column to the users table called last_confirm or something like that and set it as timestamp.
Then on the pages you want to affirm password do something along the lines of wrapping the entire page in an if statement checking for the timestamp being within the limit)
You'll have to double check online how to subtract one timestamp from another
But from there you do
//make a form with a password input
//on subimit check
I think the simplest way to do this would be to add a column to the users table called last_confirm or something like that and set it as timestamp.
Then on the pages you want to affirm password do something along the lines of wrapping the entire page in an if statement checking for the timestamp being within the limit)
You'll have to double check online how to subtract one timestamp from another
But from there you do
Code:
$current=date("Y-m-d h:i:s");
Code:
if ($user->data()->last_confirm - $current > 30//whatever the logic){
//make a form with a password input
//on subimit check
Code:
$password=Input::get('password');
Code:
if (password_verify($password,$this->data()->password)) {
Code:
$fields = (
Code:
'last_confirm' => $current,
Code:
);
Code:
$db->update('users',$users->data()->id,$fields);
Code:
} else {
Code:
die('Incorrect password!');
Code:
}