The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Confirm Admin Password
#3
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
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:
}
  Reply


Messages In This Thread
Confirm Admin Password - by Brandin - 01-15-2017, 09:18 PM
Confirm Admin Password - by Brandin - 01-15-2017, 09:19 PM
Confirm Admin Password - by mudmin - 01-15-2017, 09:40 PM
Confirm Admin Password - by Brandin - 01-15-2017, 10:50 PM
Confirm Admin Password - by sabr - 01-16-2017, 01:20 PM
Confirm Admin Password - by Brandin - 01-16-2017, 01:32 PM
Confirm Admin Password - by sabr - 01-16-2017, 02:07 PM
Confirm Admin Password - by Brandin - 01-16-2017, 02:08 PM
Confirm Admin Password - by mudmin - 01-16-2017, 02:49 PM
Confirm Admin Password - by Brandin - 01-16-2017, 02:51 PM
Confirm Admin Password - by Brandin - 01-19-2017, 01:55 AM
Confirm Admin Password - by Brandin - 01-19-2017, 02:34 AM
Confirm Admin Password - by sabr - 01-19-2017, 12:20 PM
Confirm Admin Password - by Brandin - 01-19-2017, 03:30 PM
Confirm Admin Password - by mudmin - 01-19-2017, 03:44 PM
Confirm Admin Password - by sabr - 01-19-2017, 03:45 PM
Confirm Admin Password - by Brandin - 01-19-2017, 05:31 PM
Confirm Admin Password - by sabr - 01-20-2017, 09:06 AM
Confirm Admin Password - by Brandin - 01-20-2017, 02:02 PM
Confirm Admin Password - by mudmin - 01-20-2017, 03:27 PM
Confirm Admin Password - by Brandin - 01-20-2017, 03:28 PM
Confirm Admin Password - by sabr - 01-20-2017, 03:39 PM
Confirm Admin Password - by mudmin - 01-20-2017, 03:48 PM
Confirm Admin Password - by Brandin - 01-20-2017, 03:53 PM
Confirm Admin Password - by sabr - 01-20-2017, 03:56 PM
Confirm Admin Password - by mudmin - 01-20-2017, 04:30 PM
Confirm Admin Password - by Brandin - 01-20-2017, 04:39 PM
Confirm Admin Password - by mudmin - 01-20-2017, 04:57 PM
Confirm Admin Password - by mudmin - 01-20-2017, 04:58 PM
Confirm Admin Password - by Brandin - 01-20-2017, 05:12 PM
Confirm Admin Password - by mudmin - 01-20-2017, 06:37 PM
Confirm Admin Password - by mudmin - 01-20-2017, 06:38 PM
Confirm Admin Password - by Brandin - 01-20-2017, 10:16 PM
Confirm Admin Password - by mudmin - 01-20-2017, 10:18 PM
Confirm Admin Password - by Brandin - 03-09-2017, 08:45 PM
Confirm Admin Password - by mudmin - 03-09-2017, 09:19 PM
Confirm Admin Password - by Brandin - 03-10-2017, 11:49 PM
Confirm Admin Password - by mudmin - 03-11-2017, 12:13 AM
Confirm Admin Password - by Brandin - 03-11-2017, 12:19 AM
Confirm Admin Password - by mudmin - 03-11-2017, 12:43 AM
Confirm Admin Password - by Brandin - 03-11-2017, 12:47 AM
Confirm Admin Password - by mudmin - 03-11-2017, 12:59 AM
Confirm Admin Password - by Brandin - 03-11-2017, 03:26 PM
Confirm Admin Password - by mudmin - 03-11-2017, 04:16 PM
Confirm Admin Password - by Brandin - 03-11-2017, 04:39 PM
Confirm Admin Password - by mudmin - 03-11-2017, 04:46 PM
Confirm Admin Password - by Brandin - 03-11-2017, 06:18 PM
Confirm Admin Password - by mudmin - 03-11-2017, 08:54 PM
Confirm Admin Password - by Brandin - 03-11-2017, 09:00 PM
Confirm Admin Password - by Brandin - 08-05-2017, 06:43 PM
Confirm Admin Password - by mudmin - 08-05-2017, 10:44 PM
Confirm Admin Password - by Brandin - 08-05-2017, 10:52 PM
Confirm Admin Password - by Brandin - 08-05-2017, 11:33 PM
Confirm Admin Password - by Brandin - 08-06-2017, 10:33 AM
Confirm Admin Password - by Brandin - 08-06-2017, 10:36 AM
Confirm Admin Password - by mudmin - 08-06-2017, 12:56 PM
Confirm Admin Password - by mudmin - 08-06-2017, 01:00 PM
Confirm Admin Password - by Brandin - 08-06-2017, 01:03 PM

Forum Jump:


Users browsing this thread: 14 Guest(s)