Skip to content

Commit 1a4a9fe

Browse files
author
Dmytro Voskoboinikov
committed
Merge branch 'develop' into MAGETWO-39021
Conflicts: app/code/Magento/Catalog/Observer/AddCatalogToTopmenuItemsObserver.php app/code/Magento/Catalog/Test/Unit/Observer/AddCatalogToTopmenuItemsObserverTest.php
2 parents 83120cd + 02b9466 commit 1a4a9fe

File tree

1,354 files changed

+66723
-10556
lines changed

Some content is hidden

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

1,354 files changed

+66723
-10556
lines changed

.htaccess

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -243,10 +243,6 @@
243243
order allow,deny
244244
deny from all
245245
</Files>
246-
<Files CONTRIBUTOR_LICENSE_AGREEMENT.html>
247-
order allow,deny
248-
deny from all
249-
</Files>
250246
<Files COPYING.txt>
251247
order allow,deny
252248
deny from all

.htaccess.sample

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,10 +209,6 @@
209209
order allow,deny
210210
deny from all
211211
</Files>
212-
<Files CONTRIBUTOR_LICENSE_AGREEMENT.html>
213-
order allow,deny
214-
deny from all
215-
</Files>
216212
<Files COPYING.txt>
217213
order allow,deny
218214
deny from all

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ The Magento 2 development team will review all issues and contributions submitte
1010

1111
## Contribution requirements
1212

13-
1. Contributions must adhere to [Magento coding standards](http://devdocs.magento.com/guides/v1.0/coding-standards/bk-coding-standards.html).
13+
1. Contributions must adhere to [Magento coding standards](http://devdocs.magento.com/guides/v2.0/coding-standards/bk-coding-standards.html).
1414
2. Pull requests (PRs) must be accompanied by a meaningful description of their purpose. Comprehensive descriptions increase the chances of a pull request to be merged quickly and without additional clarification requests.
1515
3. Commits must be accompanied by meaningful commit messages.
1616
4. PRs which include bug fixing, must be accompanied with step-by-step description of how to reproduce the bug.
@@ -25,7 +25,7 @@ The Magento 2 development team will review all issues and contributions submitte
2525
If you are a new GitHub user, we recommend that you create your own [free github account](https://github.com/signup/free). By doing that, you will be able to collaborate with the Magento 2 development team, “fork” the Magento 2 project and be able to easily send “pull requests”.
2626

2727
1. Search current [listed issues](https://github.com/magento/magento2/issues) (open or closed) for similar proposals of intended contribution before starting work on a new contribution.
28-
2. Review the [Contributor License Agreement](https://github.com/magento/magento2/blob/master/CONTRIBUTOR_LICENSE_AGREEMENT.html) if this is your first time contributing.
28+
2. Review the [Contributor License Agreement](https://magento.com/legaldocuments/mca) if this is your first time contributing.
2929
3. Create and test your work.
30-
4. Fork the Magento 2 repository according to [Fork a repository instructions](http://devdocs.magento.com/guides/v1.0/contributor-guide/CONTRIBUTING.html#fork) and when you are ready to send us a pull request – follow [Create a pull request instructions](http://devdocs.magento.com/guides/v1.0/contributor-guide/CONTRIBUTING.html#pull_request).
30+
4. Fork the Magento 2 repository according to [Fork a repository instructions](http://devdocs.magento.com/guides/v2.0/contributor-guide/contributing.html#fork) and when you are ready to send us a pull request – follow [Create a pull request instructions](http://devdocs.magento.com/guides/v2.0/contributor-guide/contributing.html#pull_request).
3131
5. Once your contribution is received, Magento 2 development team will review the contribution and collaborate with you as needed to improve the quality of the contribution.

CONTRIBUTOR_LICENSE_AGREEMENT.html

Lines changed: 0 additions & 137 deletions
This file was deleted.

app/code/Magento/Authorizenet/view/adminhtml/web/js/direct-post.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ directPost.prototype = {
2020
var prepare = function (event, method) {
2121
if (method === 'authorizenet_directpost') {
2222
this.preparePayment();
23+
} else {
24+
jQuery('#edit_form')
25+
.off('submitOrder.authorizenet');
2326
}
2427
};
2528
this.iframeId = iframeId;
@@ -76,7 +79,7 @@ directPost.prototype = {
7679
this.changeInputOptions('autocomplete', 'off');
7780
jQuery('#edit_form')
7881
.off('submitOrder')
79-
.on('submitOrder', this.submitAdminOrder.bind(this));
82+
.on('submitOrder.authorizenet', this.submitAdminOrder.bind(this));
8083
if ($(this.iframeId)) {
8184
// Temporary solution will be removed after refactoring Authorize.Net (sales) functionality
8285
jQuery('.scalable.save:not(disabled)').removeAttr('onclick');

app/code/Magento/Backend/App/AbstractAction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public function __construct(Action\Context $context)
102102
*/
103103
protected function _isAllowed()
104104
{
105-
return $this->_authorization->isAllowed(self::ADMIN_RESOURCE);
105+
return $this->_authorization->isAllowed(static::ADMIN_RESOURCE);
106106
}
107107

108108
/**

app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Longtext.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function render(\Magento\Framework\DataObject $row)
3030
$truncateLength = $this->getColumn()->getTruncate();
3131
}
3232
$text = $this->filterManager->truncate(parent::_getValue($row), ['length' => $truncateLength]);
33-
if ($this->getColumn()->getEscape()) {
33+
if (!$this->getColumn()->hasEscape() || $this->getColumn()->getEscape()) {
3434
$text = $this->escapeHtml($text);
3535
}
3636
if ($this->getColumn()->getNl2br()) {

app/code/Magento/Backend/Controller/Adminhtml/System/Account/Save.php

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,27 @@
99
use Magento\Framework\Exception\AuthenticationException;
1010
use Magento\Framework\Exception\LocalizedException;
1111
use Magento\Framework\Controller\ResultFactory;
12+
use Magento\Framework\Exception\State\UserLockedException;
1213

1314
class Save extends \Magento\Backend\Controller\Adminhtml\System\Account
1415
{
16+
/**
17+
* @var \Magento\Security\Helper\SecurityCookie
18+
*/
19+
protected $securityCookieHelper;
20+
21+
/**
22+
* @param \Magento\Backend\App\Action\Context $context
23+
* @param \Magento\Security\Helper\SecurityCookie $securityCookieHelper
24+
*/
25+
public function __construct(
26+
\Magento\Backend\App\Action\Context $context,
27+
\Magento\Security\Helper\SecurityCookie $securityCookieHelper
28+
) {
29+
parent::__construct($context);
30+
$this->securityCookieHelper = $securityCookieHelper;
31+
}
32+
1533
/**
1634
* Saving edited user information
1735
*
@@ -43,21 +61,22 @@ public function execute()
4361
/** Before updating admin user data, ensure that password of current admin user is entered and is correct */
4462
$currentUserPasswordField = \Magento\User\Block\User\Edit\Tab\Main::CURRENT_USER_PASSWORD_FIELD;
4563
$currentUserPassword = $this->getRequest()->getParam($currentUserPasswordField);
46-
$isCurrentUserPasswordValid = !empty($currentUserPassword) && is_string($currentUserPassword);
4764
try {
48-
if (!($isCurrentUserPasswordValid && $user->verifyIdentity($currentUserPassword))) {
49-
throw new AuthenticationException(__('You have entered an invalid password for current user.'));
50-
}
65+
$user->performIdentityCheck($currentUserPassword);
5166
if ($password !== '') {
5267
$user->setPassword($password);
5368
$user->setPasswordConfirmation($passwordConfirmation);
5469
}
5570
$user->save();
56-
/** Send password reset email notification only when password was changed */
57-
if ($password !== '') {
58-
$user->sendPasswordResetNotificationEmail();
59-
}
71+
72+
$user->sendNotificationEmailsIfRequired();
73+
6074
$this->messageManager->addSuccess(__('You saved the account.'));
75+
} catch (UserLockedException $e) {
76+
$this->_auth->logout();
77+
$this->securityCookieHelper->setLogoutReasonCookie(
78+
\Magento\Security\Model\AdminSessionsManager::LOGOUT_REASON_USER_LOCKED
79+
);
6180
} catch (ValidatorException $e) {
6281
$this->messageManager->addMessages($e->getMessages());
6382
if ($e->getMessage()) {

app/code/Magento/Backend/Test/Unit/Controller/Adminhtml/System/Account/SaveTest.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ class SaveTest extends \PHPUnit_Framework_TestCase
4242
/** @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\TranslateInterface */
4343
protected $_translatorMock;
4444

45+
/** @var \PHPUnit_Framework_MockObject_MockObject |\Magento\Framework\Event\ManagerInterface */
46+
protected $eventManagerMock;
47+
4548
protected function setUp()
4649
{
4750
$this->_requestMock = $this->getMockBuilder('Magento\Framework\App\Request\Http')
@@ -76,7 +79,7 @@ protected function setUp()
7679
$this->_userMock = $this->getMockBuilder('Magento\User\Model\User')
7780
->disableOriginalConstructor()
7881
->setMethods(
79-
['load', 'save', 'sendPasswordResetNotificationEmail', 'verifyIdentity', '__sleep', '__wakeup']
82+
['load', 'save', 'sendNotificationEmailsIfRequired', 'performIdentityCheck', '__sleep', '__wakeup']
8083
)
8184
->getMock();
8285

@@ -190,10 +193,9 @@ public function testSaveAction()
190193
);
191194

192195
$this->_userMock->setUserId($userId);
193-
196+
$this->_userMock->expects($this->once())->method('performIdentityCheck')->will($this->returnValue(true));
194197
$this->_userMock->expects($this->once())->method('save');
195-
$this->_userMock->expects($this->once())->method('verifyIdentity')->will($this->returnValue(true));
196-
$this->_userMock->expects($this->once())->method('sendPasswordResetNotificationEmail');
198+
$this->_userMock->expects($this->once())->method('sendNotificationEmailsIfRequired');
197199

198200
$this->_requestMock->setParams($requestParams);
199201

app/code/Magento/Backend/composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"magento/module-quote": "100.0.*",
1414
"magento/module-catalog": "100.0.*",
1515
"magento/module-user": "100.0.*",
16+
"magento/module-security": "100.0.*",
1617
"magento/module-backup": "100.0.*",
1718
"magento/module-customer": "100.0.*",
1819
"magento/module-translation": "100.0.*",

0 commit comments

Comments
 (0)