plugins/SpecialUserFuncs.php
changeset 182 c69730750be3
parent 179 36b287f1d85c
child 193 ebe99e82a59a
child 207 861807631f70
equal deleted inserted replaced
181:06bdbdfec160 182:c69730750be3
   126           'lockout_threshold' => $threshold,
   126           'lockout_threshold' => $threshold,
   127           'lockout_duration' => ( $duration / 60 ),
   127           'lockout_duration' => ( $duration / 60 ),
   128           'lockout_fails' => $fails,
   128           'lockout_fails' => $fails,
   129           'lockout_policy' => $policy,
   129           'lockout_policy' => $policy,
   130           'lockout_last_time' => $row['timestamp'],
   130           'lockout_last_time' => $row['timestamp'],
   131           'server_time' => time(),
   131           'time_rem' => ( $duration / 60 ) - round( ( time() - $row['timestamp'] ) / 60 ),
   132           'captcha' => ''
   132           'captcha' => ''
   133         );
   133         );
   134       if ( $policy == 'captcha' )
   134       if ( $policy == 'captcha' )
   135       {
   135       {
   136         $lockdata['captcha'] = $session->make_captcha();
   136         $lockdata['captcha'] = $session->make_captcha();
   212         break;
   212         break;
   213       case 'locked_out':
   213       case 'locked_out':
   214         $attempts = intval($__login_status['lockout_fails']);
   214         $attempts = intval($__login_status['lockout_fails']);
   215         if ( $attempts > $__login_status['lockout_threshold'])
   215         if ( $attempts > $__login_status['lockout_threshold'])
   216           $attempts = $__login_status['lockout_threshold'];
   216           $attempts = $__login_status['lockout_threshold'];
   217         $time_rem = ( $__login_status['lockout_last_time'] % ( $__login_status['lockout_duration'] * 60 ) );
   217         
   218         $time_rem = $__login_status['lockout_duration'] - round($time_rem / 60);
   218         $server_time = time();
       
   219         $time_rem = $__login_status['lockout_duration'] - round( ( $server_time - $__login_status['lockout_last_time'] ) / 60 );
       
   220         
   219         $s = ( $time_rem == 1 ) ? '' : 's';
   221         $s = ( $time_rem == 1 ) ? '' : 's';
   220         $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";
   222         $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";
   221         if ( $__login_status['lockout_policy'] == 'captcha' )
   223         if ( $__login_status['lockout_policy'] == 'captcha' )
   222         $errstring .= ', or enter the visual confirmation code shown above in the appropriate box';
   224         $errstring .= ', or enter the visual confirmation code shown above in the appropriate box';
   223         $errstring .= '.';
   225         $errstring .= '.';