magento-hackathon/Magento-Two-factor-Authentication

View on GitHub
src/app/code/community/MageHackDay/TwoFactorAuth/etc/config.xml

Summary

Maintainability
Test Coverage
<?xml version="1.0"?>
<config>
    <modules>
        <MageHackDay_TwoFactorAuth>
            <version>0.1.3</version>
        </MageHackDay_TwoFactorAuth>
    </modules>
    <global>
        <models>
            <twofactorauth>
                <class>MageHackDay_TwoFactorAuth_Model</class>
                <resourceModel>twofactorauth_resource</resourceModel>
            </twofactorauth>
            <twofactorauth_resource>
                <class>MageHackDay_TwoFactorAuth_Model_Resource</class>
                <entities>
                    <user_cookie><table>admin_user_cookie</table></user_cookie>
                    <user_question><table>admin_user_question</table></user_question>
                </entities>
            </twofactorauth_resource>
        </models>
        <blocks>
            <twofactorauth>
                <class>MageHackDay_TwoFactorAuth_Block</class>
            </twofactorauth>
        </blocks>
        <helpers>
            <twofactorauth>
                <class>MageHackDay_TwoFactorAuth_Helper</class>
            </twofactorauth>
        </helpers>
        <resources>
            <twofactorauth_setup>
                <setup>
                    <module>MageHackDay_TwoFactorAuth</module>
                </setup>
            </twofactorauth_setup>
        </resources>
        <events>
            <controller_action_postdispatch_adminhtml>
                <observers>
                    <twofactorauth_user_tfa_enforce>
                        <class>twofactorauth/observer</class>
                        <method>checkTfaSubmitted</method>
                    </twofactorauth_user_tfa_enforce>
                </observers>
            </controller_action_postdispatch_adminhtml>
        </events>
    </global>
    <admin>
        <routers>
            <adminhtml>
                <args>
                    <modules>
                        <MageHackDay_TwoFactorAuth before="Mage_Adminhtml">MageHackDay_TwoFactorAuth_Adminhtml</MageHackDay_TwoFactorAuth>
                    </modules>
                </args>
            </adminhtml>
        </routers>
    </admin>
    <adminhtml>
        <events>
            <admin_session_user_login_success>
                <observers>
                    <twofactorauth_user_authenticate_after>
                        <type>singleton</type>
                        <class>twofactorauth/observer</class>
                        <method>adminUserAuthenticateAfter</method>
                    </twofactorauth_user_authenticate_after>
                </observers>
            </admin_session_user_login_success>
        </events>
        <layout>
            <updates>
                <twofactorauth>
                    <file>twofactor.xml</file>
                </twofactorauth>
            </updates>
        </layout>
        <translate>
            <modules>
                <twofactorauth>
                    <files>
                        <default>MageHackDay_TwoFactorAuth.csv</default>
                    </files>
                </twofactorauth>
            </modules>
        </translate>
    </adminhtml>
    <frontend>
        <events>
            <customer_customer_authenticated>
                <observers>
                    <twofactorauth_customer_customer_authenticated>
                        <type>singleton</type>
                        <class>twofactorauth/observer</class>
                        <method>customerAuthenticateAfter</method>
                    </twofactorauth_customer_customer_authenticated>
                </observers>
            </customer_customer_authenticated>
        </events>
        <layout>
            <updates>
                <twofactorauth>
                    <file>twofactorauth.xml</file>
                </twofactorauth>
            </updates>
        </layout>
        <routers>
            <twofactorauth>
                <use>standard</use>
                <args>
                    <module>MageHackDay_TwoFactorAuth</module>
                    <frontName>twofactorauth</frontName>
                </args>
            </twofactorauth>
        </routers>
        <translate>
            <modules>
                <twofactorauth>
                    <files>
                        <default>MageHackDay_TwoFactorAuth.csv</default>
                    </files>
                </twofactorauth>
            </modules>
        </translate>
    </frontend>
    <default>
        <admin>
            <security>
                <active>1</active>
                <force_for_backend>1</force_for_backend>
                <frontend_active>0</frontend_active>
                <twofactorauth_protected_resources>admin/sales/order,admin/system,all</twofactorauth_protected_resources>
                <remember_me_duration>2592000</remember_me_duration>
            </security>
        </admin>
    </default>
    <phpunit>
        <suite>
            <modules>
                <MageHackDay_TwoFactorAuth />
            </modules>
        </suite>
    </phpunit>
</config>