Configure.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. /**
  3. * MageSpecialist
  4. *
  5. * NOTICE OF LICENSE
  6. *
  7. * This source file is subject to the Open Software License (OSL 3.0)
  8. * that is bundled with this package in the file LICENSE.txt.
  9. * It is also available through the world-wide-web at this URL:
  10. * http://opensource.org/licenses/osl-3.0.php
  11. * If you did not receive a copy of the license and are unable to
  12. * obtain it through the world-wide-web, please send an email
  13. * to info@magespecialist.it so we can send you a copy immediately.
  14. *
  15. * @copyright Copyright (c) 2017 Skeeller srl (http://www.magespecialist.it)
  16. * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
  17. */
  18. namespace MSP\TwoFactorAuth\Block\Provider\U2fKey;
  19. use Magento\Backend\Block\Template;
  20. use MSP\TwoFactorAuth\Model\Provider\Engine\U2fKey;
  21. class Configure extends Template
  22. {
  23. /**
  24. * @var U2fKey
  25. */
  26. private $u2fKey;
  27. public function __construct(
  28. Template\Context $context,
  29. U2fKey $u2fKey,
  30. array $data = []
  31. ) {
  32. parent::__construct($context, $data);
  33. $this->u2fKey = $u2fKey;
  34. }
  35. /**
  36. * @inheritdoc
  37. */
  38. public function getJsLayout()
  39. {
  40. $this->jsLayout['components']['msp-twofactorauth-configure']['postUrl'] =
  41. $this->getUrl('*/*/configurepost');
  42. $this->jsLayout['components']['msp-twofactorauth-configure']['successUrl'] =
  43. $this->getUrl($this->_urlBuilder->getStartupPageUrl());
  44. $this->jsLayout['components']['msp-twofactorauth-configure']['touchImageUrl'] =
  45. $this->getViewFileUrl('MSP_TwoFactorAuth::images/u2f/touch.png');
  46. $this->jsLayout['components']['msp-twofactorauth-configure']['registerData'] =
  47. $this->u2fKey->getRegisterData();
  48. return parent::getJsLayout();
  49. }
  50. }