<commit_before><?php

/**
 * adminhtml controller to enforce Two Factor Authentication
 *
 * @category    MageHackDay
 * @package     MageHackDay_TwoFactorAuth
 * @author      <NAME> <<EMAIL>>
 */
class MageHackDay_TwoFactorAuth_Adminhtml_TwofactorauthController extends Mage_Adminhtml_Controller_Action{


    public function interstitialAction(){
        $this
            ->_title($this->__('Two Factor Authentication'))
//            ->loadLayout()
//            ->renderLayout()
        ;
        echo 'user should enter their auth string here @aedmonds';
    }

    public function verifyAction(){
        $oRequest = Mage::app()->getRequest();
        $vInputCode = $oRequest->getPost('input_code',null);
        $authHelper = Mage::helper('twofactorauth/auth');
        $oUser = Mage::getSingleton('admin/session')->getUser();
        $vSecret = $oUser->getTwofactorToken();
        if(!$vSecret){
            //user is accessing protected route without configured TFA
            return $this;
        }
        $bValid = $authHelper->verifyCode($vInputCode, $vSecret);
        if($bValid === false){
            Mage::getSingleton('admin/session')->addError('Two Factor Authentication has failed. Please try again or contact ');
        }
    }

}<commit_msg>#7 Rendering layout for interstitial action<commit_after><?php

/**
 * adminhtml controller to enforce Two Factor Authentication
 *
 * @category    MageHackDay
 * @package     MageHackDay_TwoFactorAuth
 * @author      <NAME> <<EMAIL>>
 */
class MageHackDay_TwoFactorAuth_Adminhtml_TwofactorauthController extends Mage_Adminhtml_Controller_Action{


    public function interstitialAction(){
        $this
            ->_title($this->__('Two Factor Authentication'))
            ->loadLayout()
            ->renderLayout()
        ;
        echo 'user should enter their auth string here @aedmonds';
    }

    public function verifyAction(){
        $oRequest = Mage::app()->getRequest();
        $vInputCode = $oRequest->getPost('input_code',null);
        $authHelper = Mage::helper('twofactorauth/auth');
        $oUser = Mage::getSingleton('admin/session')->getUser();
        $vSecret = $oUser->getTwofactorToken();
        if(!$vSecret){
            //user is accessing protected route without configured TFA
            return $this;
        }
        $bValid = $authHelper->verifyCode($vInputCode, $vSecret);
        if($bValid === false){
            Mage::getSingleton('admin/session')->addError('Two Factor Authentication has failed. Please try again or contact ');
        }
    }

}
{'fraction_non_alphanumeric': 0.12441497659906396, 'fraction_numerical': 0.000390015600624025, 'mean_word_length': 2.839820359281437, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7064806', 'n_tokens_mistral': 724, 'n_tokens_neox': 688, 'n_words': 157}