* @copyright Copyright (C) 2016 Uwe Steinmann * @version Release: @package_version@ */ /** * Include parent class */ require_once("class.Bootstrap.php"); /** * Include classes for 2-factor authentication */ require "vendor/autoload.php"; /** * Class which outputs the html page for ForcePasswordChange view * * @category DMS * @package SeedDMS * @author Markus Westphal, Malcolm Cowe, Uwe Steinmann * @copyright Copyright (C) 2016 Uwe Steinmann * @version Release: @package_version@ */ class SeedDMS_View_Setup2Factor extends SeedDMS_Bootstrap_Style { function js() { /* {{{ */ header('Content-Type: application/javascript'); ?> function checkForm() { msg = new Array(); if($("#currentpwd").val() == "") msg.push(""); if($("#pwd").val() == "") msg.push(""); if($("#pwd").val() != $("#pwdconf").val()) msg.push(""); if (msg != "") { noty({ text: msg.join('
'), type: 'error', dismissQueue: true, layout: 'topRight', theme: 'defaultTheme', _timeout: 1500, }); return false; } else return true; } $(document).ready( function() { $('body').on('submit', '#form', function(ev){ if(checkForm()) return; ev.preventDefault(); }); }); params['dms']; $user = $this->params['user']; $sitename = $this->params['sitename']; $this->htmlStartPage(getMLText("2_factor_auth"), "forcepasswordchange"); $this->globalNavigation(); $this->contentStart(); $this->pageNavigation(getMLText("my_account"), "my_account"); $this->contentHeading(getMLText('2_factor_auth')); echo "
".getMLText('2_factor_auth_info')."
"; echo '
'; $this->contentContainerStart('span6'); $tfa = new \RobThree\Auth\TwoFactorAuth('SeedDMS'); $oldsecret = $user->getSecret(); $secret = $tfa->createSecret(); ?>

formSubmit(getMLText('submit_2_fact_auth')); ?>
contentContainerEnd(); $this->contentContainerStart('span6'); echo '
'.$oldsecret.'
'; echo '
'; ?> contentContainerEnd(); echo '
'; $this->contentEnd(); $this->htmlEndPage(); } /* }}} */ } ?>