1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- <?php
- /**
- * Copyright © Magento, Inc. All rights reserved.
- * See COPYING.txt for license details.
- */
- namespace Magento\User\Controller\Adminhtml;
- abstract class User extends \Magento\Backend\App\AbstractAction
- {
- /**
- * Authorization level of a basic admin session
- *
- * @see _isAllowed()
- */
- const ADMIN_RESOURCE = 'Magento_User::acl_users';
- /**
- * Core registry
- *
- * @var \Magento\Framework\Registry
- */
- protected $_coreRegistry;
- /**
- * User model factory
- *
- * @var \Magento\User\Model\UserFactory
- */
- protected $_userFactory;
- /**
- * @param \Magento\Backend\App\Action\Context $context
- * @param \Magento\Framework\Registry $coreRegistry
- * @param \Magento\User\Model\UserFactory $userFactory
- */
- public function __construct(
- \Magento\Backend\App\Action\Context $context,
- \Magento\Framework\Registry $coreRegistry,
- \Magento\User\Model\UserFactory $userFactory
- ) {
- parent::__construct($context);
- $this->_coreRegistry = $coreRegistry;
- $this->_userFactory = $userFactory;
- }
- /**
- * @return $this
- */
- protected function _initAction()
- {
- $this->_view->loadLayout();
- $this->_setActiveMenu(
- 'Magento_User::system_acl_users'
- )->_addBreadcrumb(
- __('System'),
- __('System')
- )->_addBreadcrumb(
- __('Permissions'),
- __('Permissions')
- )->_addBreadcrumb(
- __('Users'),
- __('Users')
- );
- return $this;
- }
- /**
- * Retrieve well-formed admin user data from the form input
- *
- * @param array $data
- * @return array
- */
- protected function _getAdminUserData(array $data)
- {
- if (isset($data['password']) && $data['password'] === '') {
- unset($data['password']);
- }
- if (!isset($data['password'])
- && isset($data['password_confirmation'])
- && $data['password_confirmation'] === ''
- ) {
- unset($data['password_confirmation']);
- }
- return $data;
- }
- }
|