-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #463 from magento-performance/CABPI-427
CABPI-427: [BUG] User Identity Verification does not work on New Integration page with enabled AdminIMS
- Loading branch information
Showing
3 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
58 changes: 58 additions & 0 deletions
58
...gento/AdminAdobeIms/Plugin/Block/Adminhtml/Integration/Edit/Tab/AddReAuthVerification.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Magento\AdminAdobeIms\Plugin\Block\Adminhtml\Integration\Edit\Tab; | ||
|
||
use Magento\AdminAdobeIms\Plugin\AdobeImsReauth\AddAdobeImsReAuthButton; | ||
use Magento\AdminAdobeIms\Service\ImsConfig; | ||
use Magento\Integration\Block\Adminhtml\Integration\Edit\Tab\Info; | ||
|
||
class AddReAuthVerification | ||
{ | ||
/** | ||
* @var AddAdobeImsReAuthButton | ||
*/ | ||
private AddAdobeImsReAuthButton $adobeImsReAuthButton; | ||
|
||
/** | ||
* @var ImsConfig | ||
*/ | ||
private ImsConfig $adminAdobeImsConfig; | ||
|
||
/** | ||
* @param AddAdobeImsReAuthButton $adobeImsReAuthButton | ||
* @param ImsConfig $adminAdobeImsConfig | ||
*/ | ||
public function __construct( | ||
AddAdobeImsReAuthButton $adobeImsReAuthButton, | ||
ImsConfig $adminAdobeImsConfig | ||
) { | ||
$this->adobeImsReAuthButton = $adobeImsReAuthButton; | ||
$this->adminAdobeImsConfig = $adminAdobeImsConfig; | ||
} | ||
|
||
/** | ||
* Add adobeIms reAuth button to integration new/edit form | ||
* | ||
* @param Info $subject | ||
* @return void | ||
*/ | ||
public function beforeGetFormHtml(Info $subject): void | ||
{ | ||
if ($this->adminAdobeImsConfig->enabled()) { | ||
$form = $subject->getForm(); | ||
if (is_object($form)) { | ||
$verificationFieldset = $form->getElement('current_user_verification_fieldset'); | ||
if ($verificationFieldset !== null) { | ||
$this->adobeImsReAuthButton->addAdobeImsReAuthButton($verificationFieldset); | ||
$subject->setForm($form); | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
app/code/Magento/AdminAdobeIms/view/adminhtml/layout/adminhtml_integration_edit.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> | ||
<body> | ||
<referenceContainer name="js"> | ||
<block class="Magento\AdminAdobeIms\Block\Adminhtml\ImsReAuth" name="admin.adobe.ims.reauth" template="Magento_AdminAdobeIms::user/reauth.phtml"/> | ||
</referenceContainer> | ||
</body> | ||
</page> |