plugins/SpecialUserFuncs.php
changeset 182 c69730750be3
parent 179 36b287f1d85c
child 193 ebe99e82a59a
child 207 861807631f70
--- a/plugins/SpecialUserFuncs.php	Sun Oct 07 21:41:42 2007 -0400
+++ b/plugins/SpecialUserFuncs.php	Sun Oct 07 22:06:15 2007 -0400
@@ -128,7 +128,7 @@
           'lockout_fails' => $fails,
           'lockout_policy' => $policy,
           'lockout_last_time' => $row['timestamp'],
-          'server_time' => time(),
+          'time_rem' => ( $duration / 60 ) - round( ( time() - $row['timestamp'] ) / 60 ),
           'captcha' => ''
         );
       if ( $policy == 'captcha' )
@@ -214,8 +214,10 @@
         $attempts = intval($__login_status['lockout_fails']);
         if ( $attempts > $__login_status['lockout_threshold'])
           $attempts = $__login_status['lockout_threshold'];
-        $time_rem = ( $__login_status['lockout_last_time'] % ( $__login_status['lockout_duration'] * 60 ) );
-        $time_rem = $__login_status['lockout_duration'] - round($time_rem / 60);
+        
+        $server_time = time();
+        $time_rem = $__login_status['lockout_duration'] - round( ( $server_time - $__login_status['lockout_last_time'] ) / 60 );
+        
         $s = ( $time_rem == 1 ) ? '' : 's';
         $errstring = "You have used up all {$__login_status['lockout_threshold']} allowed login attempts. Please wait {$time_rem} minute$s before attempting to log in again";
         if ( $__login_status['lockout_policy'] == 'captcha' )