@@ -17,21 +17,21 @@ class JetRails_TwoFactor_Model_Adminhtml_Page extends Mage_Core_Model_Abstract {
1717 * also includes all the controller routes that are defined for the manage and configure
1818 * controllers that only super admins have access to.
1919 */
20- const PAGE_SETUP_SCAN = "twofactor/setup /scan " ;
21- const PAGE_SETUP_BACKUP = "twofactor/setup /backup " ;
22- const PAGE_SETUP_RESET = "twofactor/setup /reset " ;
23- const PAGE_SETUP_ENABLE = "twofactor/setup /enable " ;
24- const PAGE_SETUP_DISABLE = "twofactor/setup /disable " ;
25- const PAGE_LOGIN_BANNED = "twofactor/login /banned " ;
26- const PAGE_LOGIN_VERIFY = "twofactor/login /verify " ;
27- const PAGE_MANAGE_INDEX = "twofactor/manage /index " ;
28- const PAGE_MANAGE_GRID = "twofactor/manage /grid " ;
29- const PAGE_MANAGE_UNBAN = "twofactor/manage /unban " ;
30- const PAGE_MANAGE_ENABLE = "twofactor/manage /enable " ;
31- const PAGE_MANAGE_DISABLE = "twofactor/manage /disable " ;
32- const PAGE_MANAGE_RESET = "twofactor/manage /reset " ;
33- const PAGE_CONFIGURE_INDEX = "twofactor/configure /index " ;
34- const PAGE_CONFIGURE_SAVE = "twofactor/configure /save " ;
20+ const PAGE_SETUP_SCAN = "adminhtml/twofactor_setup /scan " ;
21+ const PAGE_SETUP_BACKUP = "adminhtml/twofactor_setup /backup " ;
22+ const PAGE_SETUP_RESET = "adminhtml/twofactor_setup /reset " ;
23+ const PAGE_SETUP_ENABLE = "adminhtml/twofactor_setup /enable " ;
24+ const PAGE_SETUP_DISABLE = "adminhtml/twofactor_setup /disable " ;
25+ const PAGE_LOGIN_BANNED = "adminhtml/twofactor_login /banned " ;
26+ const PAGE_LOGIN_VERIFY = "adminhtml/twofactor_login /verify " ;
27+ const PAGE_MANAGE_INDEX = "adminhtml/twofactor_manage /index " ;
28+ const PAGE_MANAGE_GRID = "adminhtml/twofactor_manage /grid " ;
29+ const PAGE_MANAGE_UNBAN = "adminhtml/twofactor_manage /unban " ;
30+ const PAGE_MANAGE_ENABLE = "adminhtml/twofactor_manage /enable " ;
31+ const PAGE_MANAGE_DISABLE = "adminhtml/twofactor_manage /disable " ;
32+ const PAGE_MANAGE_RESET = "adminhtml/twofactor_manage /reset " ;
33+ const PAGE_CONFIGURE_INDEX = "adminhtml/twofactor_configure /index " ;
34+ const PAGE_CONFIGURE_SAVE = "adminhtml/twofactor_configure /save " ;
3535
3636 /**
3737 * This method takes in a controller route and an authorization state, which is defined in
@@ -82,9 +82,12 @@ public function getPageFromState ( $targetState ) {
8282 * @return boolean Is the route forbidden?
8383 */
8484 public function isForbiddenRoutesAfterAuth ( $ frontname , $ controller ) {
85+ // Get current admin front name
86+ $ adminFrontName = Mage::getConfig ()
87+ ->getNode ("admin/routers/adminhtml/args/frontName " );
8588 // Return if the controller is forbidden
86- $ allowed = array ( "setup " , "login " );
87- return $ frontname === "twofactor " && in_array ( $ controller , $ allowed );
89+ $ allowed = array ( "twofactor_setup " , "twofactor_login " );
90+ return $ frontname === "$ adminFrontName " && in_array ( $ controller , $ allowed );
8891 }
8992
90- }
93+ }
0 commit comments