Skip to content

Commit 40fa62a

Browse files
committed
Merge branch 'develop' of github.corp.magento.com:magento-extensibility/magento2ce into develop
2 parents f10c7c8 + 07aa35f commit 40fa62a

File tree

44 files changed

+505
-380
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+505
-380
lines changed

.htaccess.sample

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
############################################
2-
## overrides deployment configuration mode value
3-
## use command bin/magento deploy:mode:set to switch modes
4-
5-
# SetEnv MAGE_MODE developer
2+
## Optional override of deployment mode. We recommend you use the
3+
## command bin/magento deploy:mode:set to switch modes instead
4+
# SetEnv MAGE_MODE default # or production or developer
65

76
############################################
8-
## uncomment these lines for CGI mode
9-
## make sure to specify the correct cgi php binary file name
7+
## Uncomment these lines for CGI mode.
8+
## Make sure to specify the correct cgi php binary file name
109
## it might be /cgi-bin/php-cgi
1110

1211
# Action php5-cgi /cgi-bin/php5-cgi
@@ -17,42 +16,42 @@
1716

1817
# Options -MultiViews
1918

20-
## you might also need to add this line to php.ini
19+
## You might also need to add this line to php.ini
2120
## cgi.fix_pathinfo = 1
22-
## if it still doesn't work, rename php.ini to php5.ini
21+
## If it still doesn't work, rename php.ini to php5.ini
2322

2423
############################################
25-
## this line is specific for 1and1 hosting
24+
## This line is specific for 1and1 hosting
2625

2726
#AddType x-mapp-php5 .php
2827
#AddHandler x-mapp-php5 .php
2928

3029
############################################
31-
## default index file
30+
## Default index file
3231

3332
DirectoryIndex index.php
3433

3534
<IfModule mod_php5.c>
3635

3736
############################################
38-
## adjust memory limit
37+
## Adjust memory limit
3938

4039
php_value memory_limit 768M
4140
php_value max_execution_time 18000
4241

4342
############################################
44-
## disable automatic session start
43+
## Disable automatic session start
4544
## before autoload was initialized
4645

4746
php_flag session.auto_start off
4847

4948
############################################
50-
## enable resulting html compression
49+
## Enable resulting html compression
5150

5251
#php_flag zlib.output_compression on
5352

5453
###########################################
55-
## disable user agent verification to not break multiple image upload
54+
## Disable user agent verification to not break multiple image upload
5655

5756
php_flag suhosin.session.cryptua off
5857

@@ -61,32 +60,32 @@
6160
<IfModule mod_php7.c>
6261

6362
############################################
64-
## adjust memory limit
63+
## Adjust memory limit
6564

6665
php_value memory_limit 768M
6766
php_value max_execution_time 18000
6867

6968
############################################
70-
## disable automatic session start
69+
## Disable automatic session start
7170
## before autoload was initialized
7271

7372
php_flag session.auto_start off
7473

7574
############################################
76-
## enable resulting html compression
75+
## Enable resulting html compression
7776

7877
#php_flag zlib.output_compression on
7978

8079
###########################################
81-
## disable user agent verification to not break multiple image upload
80+
## Disable user agent verification to not break multiple image upload
8281

8382
php_flag suhosin.session.cryptua off
8483

8584
</IfModule>
8685

8786
<IfModule mod_security.c>
8887
###########################################
89-
## disable POST processing to not break multiple image upload
88+
## Disable POST processing to not break multiple image upload
9089

9190
SecFilterEngine Off
9291
SecFilterScanPOST Off
@@ -95,7 +94,7 @@
9594
<IfModule mod_deflate.c>
9695

9796
############################################
98-
## enable apache served files compression
97+
## Enable apache served files compression
9998
## http://developer.yahoo.com/performance/rules.html#gzip
10099

101100
# Insert filter on all content
@@ -123,14 +122,14 @@
123122
<IfModule mod_ssl.c>
124123

125124
############################################
126-
## make HTTPS env vars available for CGI mode
125+
## Make HTTPS env vars available for CGI mode
127126

128127
SSLOptions StdEnvVars
129128

130129
</IfModule>
131130

132131
############################################
133-
## workaround for Apache 2.4.6 CentOS build when working via ProxyPassMatch with HHVM (or any other)
132+
## Workaround for Apache 2.4.6 CentOS build when working via ProxyPassMatch with HHVM (or any other)
134133
## Please, set it on virtual host configuration level
135134

136135
## SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
@@ -139,19 +138,19 @@
139138
<IfModule mod_rewrite.c>
140139

141140
############################################
142-
## enable rewrites
141+
## Enable rewrites
143142

144143
Options +FollowSymLinks
145144
RewriteEngine on
146145

147146
############################################
148-
## you can put here your magento root folder
147+
## You can put here your magento root folder
149148
## path relative to web root
150149

151150
#RewriteBase /magento/
152151

153152
############################################
154-
## workaround for HTTP authorization
153+
## Workaround for HTTP authorization
155154
## in CGI environment
156155

157156
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
@@ -163,21 +162,21 @@
163162
RewriteRule .* - [L,R=405]
164163

165164
############################################
166-
## redirect for mobile user agents
165+
## Redirect for mobile user agents
167166

168167
#RewriteCond %{REQUEST_URI} !^/mobiledirectoryhere/.*$
169168
#RewriteCond %{HTTP_USER_AGENT} "android|blackberry|ipad|iphone|ipod|iemobile|opera mobile|palmos|webos|googlebot-mobile" [NC]
170169
#RewriteRule ^(.*)$ /mobiledirectoryhere/ [L,R=302]
171170

172171
############################################
173-
## never rewrite for existing files, directories and links
172+
## Never rewrite for existing files, directories and links
174173

175174
RewriteCond %{REQUEST_FILENAME} !-f
176175
RewriteCond %{REQUEST_FILENAME} !-d
177176
RewriteCond %{REQUEST_FILENAME} !-l
178177

179178
############################################
180-
## rewrite everything else to index.php
179+
## Rewrite everything else to index.php
181180

182181
RewriteRule .* index.php [L]
183182

app/code/Magento/Customer/Model/Authentication.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function processAuthenticationFailure($customerId)
8282
$customerSecure = $this->customerRegistry->retrieveSecureData($customerId);
8383

8484
if (!($lockThreshold && $maxFailures)) {
85-
return false;
85+
return;
8686
}
8787
$failuresNum = (int)$customerSecure->getFailuresNum() + 1;
8888

@@ -92,10 +92,13 @@ public function processAuthenticationFailure($customerId)
9292
}
9393

9494
$lockThreshInterval = new \DateInterval('PT' . $lockThreshold . 'S');
95-
// set first failure date when this is first failure or last first failure expired
96-
if (1 === $failuresNum || !$firstFailureDate || $now->diff($firstFailureDate) > $lockThreshInterval) {
95+
$lockExpires = $customerSecure->getLockExpires();
96+
$lockExpired = ($lockExpires !== null) && ($now > new \DateTime($lockExpires));
97+
// set first failure date when this is the first failure or the lock is expired
98+
if (1 === $failuresNum || !$firstFailureDate || $lockExpired) {
9799
$customerSecure->setFirstFailure($this->dateTime->formatDate($now));
98100
$failuresNum = 1;
101+
$customerSecure->setLockExpires(null);
99102
// otherwise lock customer
100103
} elseif ($failuresNum >= $maxFailures) {
101104
$customerSecure->setLockExpires($this->dateTime->formatDate($now->add($lockThreshInterval)));

0 commit comments

Comments
 (0)