File tree Expand file tree Collapse file tree 2 files changed +46
-0
lines changed Expand file tree Collapse file tree 2 files changed +46
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ /**
4
+ * Observer.php - This observer rewrites the observer found in the Enterprise_Pci module. It is
5
+ * here in order to ensure 2FA authentication before forcing admin password change. The Pci
6
+ * module is only available for EE versions of Magento and therefore this observer will only
7
+ * run on enterprise versions of Magento.
8
+ * @version 1.1.2
9
+ * @package JetRails® TwoFactor
10
+ * @category Model
11
+ * @author Rafael Grigorian - JetRails®
12
+ * @copyright JetRails®, all rights reserved
13
+ */
14
+ class JetRails_TwoFactor_Model_Adminhtml_Rewrite_Observer extends Enterprise_Pci_Model_Observer {
15
+
16
+ /**
17
+ * This method overrides the parent method. Before it executes the desired module behavior, it
18
+ * makes sure that we are authenticated. If we are not authenticated, then we do not run the
19
+ * forceAdminPasswordChange method from the parent.
20
+ * @param Varien_Event_Observer observer Passed event observer
21
+ * @return void
22
+ */
23
+ public function forceAdminPasswordChange ( $ observer ) {
24
+ Mage::getSingleton ("twofactor/observer " )->preAdminHtml ( $ observer );
25
+ $ admin = Mage::getSingleton ("admin/session " );
26
+ if ( $ admin ->getTwoFactorAllow () === true ) {
27
+ parent ::forceAdminPasswordChange ( $ observer );
28
+ }
29
+ return $ observer ;
30
+ }
31
+
32
+ }
Original file line number Diff line number Diff line change 41
41
</auth >
42
42
</entities >
43
43
</twofactor_resource >
44
+ <enterprise_pci >
45
+ <rewrite >
46
+ <observer >JetRails_TwoFactor_Model_Adminhtml_Rewrite_Observer</observer >
47
+ </rewrite >
48
+ </enterprise_pci >
44
49
</models >
45
50
<resources >
46
51
<jetrails_twofactor_setup >
78
83
</twofactor_redirect >
79
84
</observers >
80
85
</controller_action_predispatch >
86
+ <admin_user_authenticate_after >
87
+ <observers >
88
+ <twofactor_redirect_after_auth >
89
+ <type >singleton</type >
90
+ <class >twofactor/observer</class >
91
+ <method >preAdminHtml</method >
92
+ </twofactor_redirect_after_auth >
93
+ </observers >
94
+ </admin_user_authenticate_after >
81
95
</events >
82
96
<layout >
83
97
<updates >
You can’t perform that action at this time.
0 commit comments