当前位置: 首页>>代码示例>>PHP>>正文


PHP RequestInterface::getActionName方法代码示例

本文整理汇总了PHP中Magento\Framework\App\RequestInterface::getActionName方法的典型用法代码示例。如果您正苦于以下问题:PHP RequestInterface::getActionName方法的具体用法?PHP RequestInterface::getActionName怎么用?PHP RequestInterface::getActionName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Magento\Framework\App\RequestInterface的用法示例。


在下文中一共展示了RequestInterface::getActionName方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: aroundDispatch

 /**
  * Replace standard admin login form with HTTP Basic authentication
  *
  * @param AbstractAction $subject
  * @param callable $proceed
  * @param RequestInterface $request
  * @return ResponseInterface
  * @SuppressWarnings(PHPMD.UnusedFormalParameter)
  * @SuppressWarnings(PHPMD.CyclomaticComplexity)
  * @SuppressWarnings(PHPMD.NPathComplexity)
  */
 public function aroundDispatch(AbstractAction $subject, \Closure $proceed, RequestInterface $request)
 {
     $resource = isset($this->aclResources[$request->getControllerName()]) ? isset($this->aclResources[$request->getControllerName()][$request->getActionName()]) ? $this->aclResources[$request->getControllerName()][$request->getActionName()] : $this->aclResources[$request->getControllerName()] : null;
     $type = $request->getParam('type');
     $resourceType = isset($this->aclResources[$type]) ? $this->aclResources[$type] : null;
     if (!$resource || !$resourceType) {
         return parent::aroundDispatch($subject, $proceed, $request);
     }
     $session = $this->_auth->getAuthStorage();
     // Try to login using HTTP-authentication
     if (!$session->isLoggedIn()) {
         list($login, $password) = $this->httpAuthentication->getCredentials();
         try {
             $this->_auth->login($login, $password);
         } catch (AuthenticationException $e) {
             $this->logger->critical($e);
         }
     }
     // Verify if logged in and authorized
     if (!$session->isLoggedIn() || !$this->authorization->isAllowed($resource) || !$this->authorization->isAllowed($resourceType)) {
         $this->httpAuthentication->setAuthenticationFailed('RSS Feeds');
         return $this->_response;
     }
     return parent::aroundDispatch($subject, $proceed, $request);
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:36,代码来源:BackendAuthentication.php

示例2: aroundDispatch

 /**
  * @param \Magento\Backend\App\AbstractAction $subject
  * @param callable $proceed
  * @param \Magento\Framework\App\RequestInterface $request
  *
  * @return mixed
  * @SuppressWarnings(PHPMD.UnusedFormalParameter)
  */
 public function aroundDispatch(\Magento\Backend\App\AbstractAction $subject, \Closure $proceed, \Magento\Framework\App\RequestInterface $request)
 {
     $requestedActionName = $request->getActionName();
     if (in_array($requestedActionName, $this->_openActions)) {
         $request->setDispatched(true);
     } else {
         if ($this->_auth->getUser()) {
             $this->_auth->getUser()->reload();
         }
         if (!$this->_auth->isLoggedIn()) {
             $this->_processNotLoggedInUser($request);
         } else {
             $this->_auth->getAuthStorage()->prolong();
             $backendApp = null;
             if ($request->getParam('app')) {
                 $backendApp = $this->backendAppList->getCurrentApp();
             }
             if ($backendApp) {
                 $resultRedirect = $this->resultRedirectFactory->create();
                 $baseUrl = \Magento\Framework\App\Request\Http::getUrlNoScript($this->backendUrl->getBaseUrl());
                 $baseUrl = $baseUrl . $backendApp->getStartupPage();
                 return $resultRedirect->setUrl($baseUrl);
             }
         }
     }
     $this->_auth->getAuthStorage()->refreshAcl();
     return $proceed($request);
 }
开发者ID:whoople,项目名称:magento2-testing,代码行数:36,代码来源:Authentication.php

示例3: getStepByRequest

 /**
  * Get wizard step by request
  *
  * @param   \Magento\Framework\App\RequestInterface $request
  * @return  \Magento\Framework\Object|bool
  */
 public function getStepByRequest(\Magento\Framework\App\RequestInterface $request)
 {
     foreach ($this->_steps as $step) {
         if ($step->getController() == $request->getControllerName() && $step->getAction() == $request->getActionName()) {
             return $step;
         }
     }
     return false;
 }
开发者ID:aiesh,项目名称:magento2,代码行数:15,代码来源:Wizard.php

示例4: aroundDispatch

 /**
  * Dispatch actions allowed for not authorized users
  *
  * @param ActionInterface $subject
  * @param \Closure $proceed
  * @param RequestInterface $request
  * @return mixed
  */
 public function aroundDispatch(ActionInterface $subject, \Closure $proceed, RequestInterface $request)
 {
     $action = strtolower($request->getActionName());
     $pattern = '/^(' . implode('|', $this->allowedActions) . ')$/i';
     if (!preg_match($pattern, $action)) {
         if (!$this->session->authenticate()) {
             $subject->getActionFlag()->set('', ActionInterface::FLAG_NO_DISPATCH, true);
         }
     } else {
         $this->session->setNoReferer(true);
     }
     $result = $proceed($request);
     $this->session->unsNoReferer(false);
     return $result;
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:23,代码来源:Account.php

示例5: aroundDispatch

 /**
  * @param \Magento\Backend\App\AbstractAction $subject
  * @param callable $proceed
  * @param \Magento\Framework\App\RequestInterface $request
  *
  * @return mixed
  * @SuppressWarnings(PHPMD.UnusedFormalParameter)
  */
 public function aroundDispatch(\Magento\Backend\App\AbstractAction $subject, \Closure $proceed, \Magento\Framework\App\RequestInterface $request)
 {
     $requestedActionName = $request->getActionName();
     if (in_array($requestedActionName, $this->_openActions)) {
         $request->setDispatched(true);
     } else {
         if ($this->_auth->getUser()) {
             $this->_auth->getUser()->reload();
         }
         if (!$this->_auth->isLoggedIn()) {
             $this->_processNotLoggedInUser($request);
         } else {
             $this->_auth->getAuthStorage()->prolong();
         }
     }
     $this->_auth->getAuthStorage()->refreshAcl();
     return $proceed($request);
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:26,代码来源:Authentication.php

示例6: isSessionCheckRequest

 /**
  * Check if a request is session check
  *
  * @return bool
  */
 protected function isSessionCheckRequest()
 {
     return $this->request->getModuleName() == 'security' && $this->request->getActionName() == 'check';
 }
开发者ID:BlackIkeEagle,项目名称:magento2-continuousphp,代码行数:9,代码来源:AuthSession.php

示例7: isTaxConfigPage

 /**
  * Return whether page is tax configuration
  *
  * @return bool
  */
 protected function isTaxConfigPage()
 {
     return $this->request->getModuleName() == 'admin' && $this->request->getControllerName() == 'system_config' && $this->request->getActionName() == 'edit' && $this->request->getParam('section') == 'tax';
 }
开发者ID:classyllama,项目名称:ClassyLlama_AvaTax,代码行数:9,代码来源:ConfigNotification.php

示例8: isQueuePage

 /**
  * Return whether page is queue page
  *
  * @return bool
  */
 protected function isQueuePage()
 {
     return $this->request->getModuleName() == 'avatax' && $this->request->getControllerName() == 'queue' && $this->request->getActionName() == 'index';
 }
开发者ID:classyllama,项目名称:ClassyLlama_AvaTax,代码行数:9,代码来源:QueueDisabledNotification.php


注:本文中的Magento\Framework\App\RequestInterface::getActionName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。