File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
app/code/Magento/User/Observer/Backend Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -167,14 +167,17 @@ private function _updateLockingInformation($user)
167
167
$ failuresNum = (int )$ user ->getFailuresNum () + 1 ;
168
168
/** @noinspection PhpAssignmentInConditionInspection */
169
169
if ($ firstFailureDate = $ user ->getFirstFailure ()) {
170
- $ firstFailureDate = strtotime ( $ user -> getFirstFailure () );
170
+ $ firstFailureDate = new \ DateTime ( $ firstFailureDate );
171
171
}
172
172
173
173
$ newFirstFailureDate = false ;
174
174
$ updateLockExpires = false ;
175
175
$ lockThreshInterval = new \DateInterval ('PT ' . $ lockThreshold .'S ' );
176
176
// set first failure date when this is first failure or last first failure expired
177
- if (1 === $ failuresNum || !$ firstFailureDate || ($ now ->getTimestamp () - $ firstFailureDate ) > $ lockThreshold ) {
177
+ if (1 === $ failuresNum
178
+ || !$ firstFailureDate
179
+ || ($ now ->getTimestamp () - $ firstFailureDate ->getTimestamp ()) > $ lockThreshold
180
+ ) {
178
181
$ newFirstFailureDate = $ now ;
179
182
// otherwise lock user
180
183
} elseif ($ failuresNum >= $ maxFailures ) {
You can’t perform that action at this time.
0 commit comments