Skip to content

Commit 93d0368

Browse files
committed
Merge remote-tracking branch 'mainline/develop' into PR_Branch
Conflicts: dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes.php
2 parents fd46e3a + 17728c9 commit 93d0368

File tree

638 files changed

+19405
-4469
lines changed

Some content is hidden

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

638 files changed

+19405
-4469
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ atlassian*
3838
!/pub/media/wysiwyg/.htaccess
3939
/pub/media/tmp/*
4040
!/pub/media/tmp/.htaccess
41+
/pub/media/captcha/*
4142
/pub/static/*
4243
!/pub/static/.htaccess
4344

app/code/Magento/AdminNotification/Model/Feed.php

+2
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,8 @@ public function getFeedData()
239239
}
240240

241241
/**
242+
* Retrieve feed as XML element
243+
*
242244
* @return \SimpleXMLElement
243245
*/
244246
public function getFeedXml()

app/code/Magento/AdminNotification/Model/Inbox.php

+5-11
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
use Magento\Framework\Notification\MessageInterface;
99
use Magento\Framework\Notification\NotifierInterface;
10+
use Magento\AdminNotification\Model\InboxInterface;
1011

1112
/**
1213
* AdminNotification Inbox model
@@ -30,7 +31,7 @@
3031
*
3132
* @author Magento Core Team <core@magentocommerce.com>
3233
*/
33-
class Inbox extends \Magento\Framework\Model\AbstractModel implements NotifierInterface
34+
class Inbox extends \Magento\Framework\Model\AbstractModel implements NotifierInterface, InboxInterface
3435
{
3536
/**
3637
* @return void
@@ -41,10 +42,7 @@ protected function _construct()
4142
}
4243

4344
/**
44-
* Retrieve Severity collection array
45-
*
46-
* @param int|null $severity
47-
* @return array|string|null
45+
* {@inheritdoc}
4846
*/
4947
public function getSeverities($severity = null)
5048
{
@@ -66,9 +64,7 @@ public function getSeverities($severity = null)
6664
}
6765

6866
/**
69-
* Retrieve Latest Notice
70-
*
71-
* @return $this
67+
* {@inheritdoc}
7268
*/
7369
public function loadLatestNotice()
7470
{
@@ -78,9 +74,7 @@ public function loadLatestNotice()
7874
}
7975

8076
/**
81-
* Retrieve notice statuses
82-
*
83-
* @return array
77+
* {@inheritdoc}
8478
*/
8579
public function getNoticeStatus()
8680
{
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?php
2+
/**
3+
* Copyright © 2015 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\AdminNotification\Model;
7+
8+
/**
9+
* AdminNotification Inbox interface
10+
*
11+
* @author Magento Core Team <core@magentocommerce.com>
12+
*/
13+
interface InboxInterface
14+
{
15+
/**
16+
* Retrieve Severity collection array
17+
*
18+
* @param int|null $severity
19+
* @return array|string|null
20+
* @api
21+
*/
22+
public function getSeverities($severity = null);
23+
24+
/**
25+
* Retrieve Latest Notice
26+
*
27+
* @return $this
28+
* @api
29+
*/
30+
public function loadLatestNotice();
31+
32+
/**
33+
* Retrieve notice statuses
34+
*
35+
* @return array
36+
* @api
37+
*/
38+
public function getNoticeStatus();
39+
}

app/code/Magento/AdminNotification/Model/System/Message/Baseurl.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
// @codingStandardsIgnoreFile
8-
97
namespace Magento\AdminNotification\Model\System\Message;
108

119
use Magento\Store\Model\Store;
@@ -121,7 +119,9 @@ public function isDisplayed()
121119
public function getText()
122120
{
123121
return __(
124-
'{{base_url}} is not recommended to use in a production environment to declare the Base Unsecure URL / Base Secure URL. It is highly recommended to change this value in your Magento <a href="%1">configuration</a>.',
122+
'{{base_url}} is not recommended to use in a production environment to declare the Base Unsecure '
123+
. 'URL / Base Secure URL. It is highly recommended to change this value in your Magento '
124+
. '<a href="%1">configuration</a>.',
125125
$this->_getConfigUrl()
126126
);
127127
}

app/code/Magento/AdminNotification/Model/System/Message/Media/Synchronization/Error.php

+2-3
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
// @codingStandardsIgnoreFile
8-
97
namespace Magento\AdminNotification\Model\System\Message\Media\Synchronization;
108

119
class Error extends \Magento\AdminNotification\Model\System\Message\Media\AbstractSynchronization
@@ -36,7 +34,8 @@ protected function _shouldBeDisplayed()
3634
public function getText()
3735
{
3836
return __(
39-
'One or more media files failed to be synchronized during the media storages synchronization process. Refer to the log file for details.'
37+
'One or more media files failed to be synchronized during the media storages synchronization process. '
38+
. 'Refer to the log file for details.'
4039
);
4140
}
4241
}

app/code/Magento/AdminNotification/Model/System/Message/Security.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
// @codingStandardsIgnoreFile
8-
97
namespace Magento\AdminNotification\Model\System\Message;
108

119
use Magento\Store\Model\Store;
@@ -26,6 +24,7 @@ class Security implements \Magento\Framework\Notification\MessageInterface
2624

2725
/**
2826
* Time out for HTTP verification request
27+
*
2928
* @var int
3029
*/
3130
private $_verificationTimeOut = 2;
@@ -136,7 +135,8 @@ public function isDisplayed()
136135
public function getText()
137136
{
138137
return __(
139-
'Your web server is configured incorrectly. As a result, configuration files with sensitive information are accessible from the outside. Please contact your hosting provider.'
138+
'Your web server is configured incorrectly. As a result, configuration files '
139+
. ' with sensitive information are accessible from the outside. Please contact your hosting provider.'
140140
);
141141
}
142142

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

+2
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,15 @@ interface UserContextInterface
2424
* Identify current user ID.
2525
*
2626
* @return int|null
27+
* @api
2728
*/
2829
public function getUserId();
2930

3031
/**
3132
* Retrieve current user type.
3233
*
3334
* @return int|null
35+
* @api
3436
*/
3537
public function getUserType();
3638
}

app/code/Magento/Backend/App/Action/Plugin/Authentication.php

+40-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77

88
use Magento\Framework\Exception\AuthenticationException;
99

10+
/**
11+
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
12+
*/
1013
class Authentication
1114
{
1215
/**
@@ -45,25 +48,49 @@ class Authentication
4548
*/
4649
protected $messageManager;
4750

51+
/**
52+
* @var \Magento\Backend\Model\UrlInterface
53+
*/
54+
protected $backendUrl;
55+
56+
/**
57+
* @var \Magento\Backend\App\BackendAppList
58+
*/
59+
protected $backendAppList;
60+
61+
/**
62+
* @var \Magento\Framework\Controller\Result\RedirectFactory
63+
*/
64+
protected $resultRedirectFactory;
65+
4866
/**
4967
* @param \Magento\Backend\Model\Auth $auth
5068
* @param \Magento\Backend\Model\UrlInterface $url
5169
* @param \Magento\Framework\App\ResponseInterface $response
5270
* @param \Magento\Framework\App\ActionFlag $actionFlag
5371
* @param \Magento\Framework\Message\ManagerInterface $messageManager
72+
* @param \Magento\Backend\Model\UrlInterface $backendUrl
73+
* @param \Magento\Framework\Controller\Result\RedirectFactory $resultRedirectFactory
74+
* @param \Magento\Backend\App\BackendAppList $backendAppList
5475
*/
5576
public function __construct(
5677
\Magento\Backend\Model\Auth $auth,
5778
\Magento\Backend\Model\UrlInterface $url,
5879
\Magento\Framework\App\ResponseInterface $response,
5980
\Magento\Framework\App\ActionFlag $actionFlag,
60-
\Magento\Framework\Message\ManagerInterface $messageManager
81+
\Magento\Framework\Message\ManagerInterface $messageManager,
82+
\Magento\Backend\Model\UrlInterface $backendUrl,
83+
\Magento\Framework\Controller\Result\RedirectFactory $resultRedirectFactory,
84+
\Magento\Backend\App\BackendAppList $backendAppList
6185
) {
6286
$this->_auth = $auth;
6387
$this->_url = $url;
6488
$this->_response = $response;
6589
$this->_actionFlag = $actionFlag;
6690
$this->messageManager = $messageManager;
91+
$this->backendUrl = $backendUrl;
92+
$this->resultRedirectFactory = $resultRedirectFactory;
93+
$this->backendAppList = $backendAppList;
6794
}
6895

6996
/**
@@ -90,6 +117,18 @@ public function aroundDispatch(
90117
$this->_processNotLoggedInUser($request);
91118
} else {
92119
$this->_auth->getAuthStorage()->prolong();
120+
121+
$backendApp = null;
122+
if ($request->getParam('app')) {
123+
$backendApp = $this->backendAppList->getCurrentApp();
124+
}
125+
126+
if ($backendApp) {
127+
$resultRedirect = $this->resultRedirectFactory->create();
128+
$baseUrl = \Magento\Framework\App\Request\Http::getUrlNoScript($this->backendUrl->getBaseUrl());
129+
$baseUrl = $baseUrl . $backendApp->getStartupPage();
130+
return $resultRedirect->setUrl($baseUrl);
131+
}
93132
}
94133
}
95134
$this->_auth->getAuthStorage()->refreshAcl();
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
<?php
2+
/**
3+
* Copyright © 2015 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Backend\App;
8+
9+
/**
10+
* Backend Application which uses Magento Backend authentication process
11+
*/
12+
class BackendApp
13+
{
14+
/**
15+
* @var null
16+
*/
17+
private $cookiePath;
18+
19+
/**
20+
* @var null
21+
*/
22+
private $startupPage;
23+
24+
/**
25+
* @var null
26+
*/
27+
private $aclResourceName;
28+
29+
/**
30+
* @param string $cookiePath
31+
* @param string $startupPage
32+
* @param string $aclResourceName
33+
*/
34+
public function __construct(
35+
$cookiePath,
36+
$startupPage,
37+
$aclResourceName
38+
) {
39+
$this->cookiePath = $cookiePath;
40+
$this->startupPage = $startupPage;
41+
$this->aclResourceName = $aclResourceName;
42+
}
43+
44+
/**
45+
* Cookie path for the application to set cookie to
46+
*
47+
* @return string
48+
*/
49+
public function getCookiePath()
50+
{
51+
return $this->cookiePath;
52+
}
53+
54+
/**
55+
* Startup Page of the application to redirect after login
56+
*
57+
* @return string
58+
*/
59+
public function getStartupPage()
60+
{
61+
return $this->startupPage;
62+
}
63+
64+
/**
65+
* ACL resource name to authorize access to
66+
*
67+
* @return string
68+
*/
69+
public function getAclResource()
70+
{
71+
return $this->aclResourceName;
72+
}
73+
}

0 commit comments

Comments
 (0)