mirror of
https://github.com/bdnugget/magento2.git
synced 2026-11-07 17:27:36 +00:00
- removed @since 2.0.0 as it is a base release - updated version in @since and @deprecated tag taking into account all patch releases
48 lines
1.2 KiB
PHP
48 lines
1.2 KiB
PHP
<?php
|
|
/**
|
|
* Copyright © Magento, Inc. All rights reserved.
|
|
* See COPYING.txt for license details.
|
|
*/
|
|
namespace Magento\Newsletter\Controller;
|
|
|
|
use Magento\Framework\App\RequestInterface;
|
|
|
|
/**
|
|
* Customers newsletter subscription controller
|
|
*/
|
|
abstract class Manage extends \Magento\Framework\App\Action\Action
|
|
{
|
|
/**
|
|
* Customer session
|
|
*
|
|
* @var \Magento\Customer\Model\Session
|
|
*/
|
|
protected $_customerSession;
|
|
|
|
/**
|
|
* @param \Magento\Framework\App\Action\Context $context
|
|
* @param \Magento\Customer\Model\Session $customerSession
|
|
*/
|
|
public function __construct(
|
|
\Magento\Framework\App\Action\Context $context,
|
|
\Magento\Customer\Model\Session $customerSession
|
|
) {
|
|
parent::__construct($context);
|
|
$this->_customerSession = $customerSession;
|
|
}
|
|
|
|
/**
|
|
* Check customer authentication for some actions
|
|
*
|
|
* @param RequestInterface $request
|
|
* @return \Magento\Framework\App\ResponseInterface
|
|
*/
|
|
public function dispatch(RequestInterface $request)
|
|
{
|
|
if (!$this->_customerSession->authenticate()) {
|
|
$this->_actionFlag->set('', 'no-dispatch', true);
|
|
}
|
|
return parent::dispatch($request);
|
|
}
|
|
}
|