Skip to content

Commit 722b4a5

Browse files
committed
Merge branch '2.4.1-develop' of https://github.com/magento/magento2ce into 2.4-develop-pr37
2 parents edc2152 + d8a5df9 commit 722b4a5

File tree

82 files changed

+10547
-2874
lines changed

Some content is hidden

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

82 files changed

+10547
-2874
lines changed

app/code/Magento/Authorization/Model/ResourceModel/Role.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ protected function _afterDelete(\Magento\Framework\Model\AbstractModel $role)
119119

120120
$connection->delete($this->_ruleTable, ['role_id = ?' => (int)$role->getId()]);
121121

122+
$this->_cache->clean(\Zend_Cache::CLEANING_MODE_MATCHING_TAG, [\Magento\Backend\Block\Menu::CACHE_TAGS]);
123+
122124
return $this;
123125
}
124126

app/code/Magento/Authorization/Model/Role.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ class Role extends \Magento\Framework\Model\AbstractModel
3333
*/
3434
protected $_eventPrefix = 'authorization_roles';
3535

36+
/**
37+
* @var string
38+
*/
39+
protected $_cacheTag = 'user_assigned_role';
40+
3641
/**
3742
* @param \Magento\Framework\Model\Context $context
3843
* @param \Magento\Framework\Registry $registry

app/code/Magento/Backend/Model/Auth/Session.php

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55
*/
66
namespace Magento\Backend\Model\Auth;
77

8+
use Magento\Framework\App\ObjectManager;
89
use Magento\Framework\Stdlib\Cookie\CookieMetadataFactory;
910
use Magento\Framework\Stdlib\CookieManagerInterface;
11+
use Magento\Framework\Message\ManagerInterface;
1012

1113
/**
1214
* Backend Auth session model
@@ -56,6 +58,11 @@ class Session extends \Magento\Framework\Session\SessionManager implements \Mage
5658
*/
5759
protected $_config;
5860

61+
/**
62+
* @var ManagerInterface
63+
*/
64+
private $messageManager;
65+
5966
/**
6067
* @param \Magento\Framework\App\Request\Http $request
6168
* @param \Magento\Framework\Session\SidResolverInterface $sidResolver
@@ -69,6 +76,7 @@ class Session extends \Magento\Framework\Session\SessionManager implements \Mage
6976
* @param \Magento\Framework\Acl\Builder $aclBuilder
7077
* @param \Magento\Backend\Model\UrlInterface $backendUrl
7178
* @param \Magento\Backend\App\ConfigInterface $config
79+
* @param ManagerInterface $messageManager
7280
* @throws \Magento\Framework\Exception\SessionException
7381
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
7482
*/
@@ -84,11 +92,13 @@ public function __construct(
8492
\Magento\Framework\App\State $appState,
8593
\Magento\Framework\Acl\Builder $aclBuilder,
8694
\Magento\Backend\Model\UrlInterface $backendUrl,
87-
\Magento\Backend\App\ConfigInterface $config
95+
\Magento\Backend\App\ConfigInterface $config,
96+
ManagerInterface $messageManager = null
8897
) {
8998
$this->_config = $config;
9099
$this->_aclBuilder = $aclBuilder;
91100
$this->_backendUrl = $backendUrl;
101+
$this->messageManager = $messageManager ?? ObjectManager::getInstance()->get(ManagerInterface::class);
92102
parent::__construct(
93103
$request,
94104
$sidResolver,
@@ -171,6 +181,25 @@ public function isLoggedIn()
171181
*/
172182
public function prolong()
173183
{
184+
$sessionUser = $this->getUser();
185+
$errorMessage = '';
186+
if ($sessionUser !== null) {
187+
if ((int)$sessionUser->getIsActive() !== 1) {
188+
$errorMessage = 'The account sign-in was incorrect or your account is disabled temporarily. '
189+
. 'Please wait and try again later.';
190+
}
191+
if (!$sessionUser->hasAssigned2Role($sessionUser->getId())) {
192+
$errorMessage = 'More permissions are needed to access this.';
193+
}
194+
195+
if (!empty($errorMessage)) {
196+
$this->destroy();
197+
$this->messageManager->addErrorMessage(__($errorMessage));
198+
199+
return;
200+
}
201+
}
202+
174203
$lifetime = $this->_config->getValue(self::XML_PATH_SESSION_LIFETIME);
175204
$cookieValue = $this->cookieManager->getCookie($this->getName());
176205

app/code/Magento/Backend/view/adminhtml/web/js/media-uploader.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@ define([
3737
progressTmpl = mageTemplate('[data-template="uploader"]'),
3838
isResizeEnabled = this.options.isResizeEnabled,
3939
resizeConfiguration = {
40-
action: 'resize',
40+
action: 'resizeImage',
4141
maxWidth: this.options.maxWidth,
4242
maxHeight: this.options.maxHeight
4343
};
4444

4545
if (!isResizeEnabled) {
4646
resizeConfiguration = {
47-
action: 'resize'
47+
action: 'resizeImage'
4848
};
4949
}
5050

@@ -131,13 +131,13 @@ define([
131131
});
132132

133133
this.element.find('input[type=file]').fileupload('option', {
134-
process: [{
135-
action: 'load',
134+
processQueue: [{
135+
action: 'loadImage',
136136
fileTypes: /^image\/(gif|jpeg|png)$/
137137
},
138138
resizeConfiguration,
139139
{
140-
action: 'save'
140+
action: 'saveImage'
141141
}]
142142
});
143143
}

app/code/Magento/Catalog/Ui/Component/Listing/Columns/AttributeSetId.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
namespace Magento\Catalog\Ui\Component\Listing\Columns;
99

1010
/**
11-
* Attribute set listing column component
11+
* AttributeSetId listing column component.
1212
*/
1313
class AttributeSetId extends \Magento\Ui\Component\Listing\Columns\Column
1414
{
@@ -23,6 +23,7 @@ protected function applySorting()
2323
&& !empty($sorting['field'])
2424
&& !empty($sorting['direction'])
2525
&& $sorting['field'] === $this->getName()
26+
&& in_array(strtoupper($sorting['direction']), ['ASC', 'DESC'], true)
2627
) {
2728
$collection = $this->getContext()->getDataProvider()->getCollection();
2829
$collection->joinField(

app/code/Magento/Catalog/Ui/Component/Listing/Columns/Websites.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ protected function applySorting()
119119
&& !empty($sorting['field'])
120120
&& !empty($sorting['direction'])
121121
&& $sorting['field'] === $this->getName()
122+
&& in_array(strtoupper($sorting['direction']), ['ASC', 'DESC'], true)
122123
) {
123124
/** @var \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection $collection */
124125
$collection = $this->getContext()->getDataProvider()->getCollection();

app/code/Magento/Cms/etc/webapi.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,19 @@
2323
<route url="/V1/cmsPage" method="POST">
2424
<service class="Magento\Cms\Api\PageRepositoryInterface" method="save"/>
2525
<resources>
26-
<resource ref="Magento_Cms::page"/>
26+
<resource ref="Magento_Cms::save"/>
2727
</resources>
2828
</route>
2929
<route url="/V1/cmsPage/:id" method="PUT">
3030
<service class="Magento\Cms\Api\PageRepositoryInterface" method="save"/>
3131
<resources>
32-
<resource ref="Magento_Cms::page"/>
32+
<resource ref="Magento_Cms::save"/>
3333
</resources>
3434
</route>
3535
<route url="/V1/cmsPage/:pageId" method="DELETE">
3636
<service class="Magento\Cms\Api\PageRepositoryInterface" method="deleteById"/>
3737
<resources>
38-
<resource ref="Magento_Cms::page"/>
38+
<resource ref="Magento_Cms::page_delete"/>
3939
</resources>
4040
</route>
4141
<!-- Cms Block -->

app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerShoppingCartSection/AdminCustomerShoppingCartProductItemSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@
1414
<element name="firstProductCheckbox" type="checkbox" selector="//*[@id='source_products_table']/tbody/tr[1]//*[@name='source_products']"/>
1515
<element name="addSelectionsToMyCartButton" type="button" selector="//*[@id='products_search']/div[1]//*[text()='Add selections to my cart']"/>
1616
<element name="addedProductName" type="text" selector="//*[@id='order-items_grid']//*[text()='{{var}}']" parameterized="true"/>
17+
<element name="addedProductQty" type="input" selector="//*[@id='order-items_grid']//*[text()='{{var}}']//..//..//*[@class='col-qty']//input" parameterized="true"/>
1718
</section>
1819
</sections>

app/code/Magento/Customer/etc/webapi.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@
227227
<route url="/V1/customers/:customerId" method="DELETE">
228228
<service class="Magento\Customer\Api\CustomerRepositoryInterface" method="deleteById"/>
229229
<resources>
230-
<resource ref="Magento_Customer::manage"/>
230+
<resource ref="Magento_Customer::delete"/>
231231
</resources>
232232
</route>
233233
<route url="/V1/customers/isEmailAvailable" method="POST">

app/code/Magento/ImportExport/Block/Adminhtml/Import/Frame/Result.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public function addError($message)
102102
$this->addError($row);
103103
}
104104
} else {
105-
$this->_messages['error'][] = $message;
105+
$this->_messages['error'][] = $this->escapeHtml($message);
106106
}
107107
return $this;
108108
}
@@ -140,7 +140,8 @@ public function addSuccess($message, $appendImportButton = false)
140140
$this->addSuccess($row);
141141
}
142142
} else {
143-
$this->_messages['success'][] = $message . ($appendImportButton ? $this->getImportButtonHtml() : '');
143+
$escapedMessage = $this->escapeHtml($message);
144+
$this->_messages['success'][] = $escapedMessage . ($appendImportButton ? $this->getImportButtonHtml() : '');
144145
}
145146
return $this;
146147
}

0 commit comments

Comments
 (0)