nicer layout

This commit is contained in:
Uwe Steinmann 2021-05-04 18:08:31 +02:00
parent 84a61cbd14
commit ff4151093c

View File

@ -76,36 +76,46 @@ $(document).ready( function() {
$this->contentStart();
$this->pageNavigation(getMLText("my_account"), "my_account");
$this->contentHeading(getMLText('2_factor_auth'));
echo "<div class=\"alert\">".getMLText('2_factor_auth_info')."</div>";
$this->infoMsg(getMLText('2_factor_auth_info'));
$this->rowStart();
$this->contentContainerStart('span6');
$this->columnStart(6);
$this->contentHeading(getMLText('2_fact_auth_new_secret'));
$tfa = new \RobThree\Auth\TwoFactorAuth('SeedDMS');
$oldsecret = $user->getSecret();
$secret = $tfa->createSecret();
?>
<form class="form-horizontal" action="../op/op.Setup2Factor.php" method="post" id="form" name="form1">
<div class="control-group"><label class="control-label"><?php printMLText('2_fact_auth_secret'); ?></label><div class="controls">
<input id="secret" class="secret" type="text" name="secret" size="30" value="<?php echo $secret; ?>"><br />
</div></div>
<?php
$this->formField(
getMLText('2_fact_auth_secret'),
array(
'element'=>'input',
'type'=>'text',
'name'=>'secret',
'class'=>'secret',
'value'=>htmlspecialchars($secret),
'required'=>true
)
);
$this->formSubmit(getMLText('submit_2_fact_auth'));
?>
<div class="control-group"><label class="control-label"></label><div class="controls">
<img src="<?php echo $tfa->getQRCodeImageAsDataUri($sitename, $secret); ?>">
</div></div>
<?php
$this->formSubmit(getMLText('submit_2_fact_auth'));
?>
</form>
<?php
if($oldsecret) {
$this->contentContainerEnd();
$this->contentContainerStart('span6');
$this->columnEnd();
$this->columnStart(6);
$this->contentHeading(getMLText('2_fact_auth_current_secret'));
echo '<div>'.$oldsecret.'</div>';
echo '<div><img src="'.$tfa->getQRCodeImageAsDataUri($sitename, $oldsecret).'"></div>';
?>
<?php
}
$this->contentContainerEnd();
$this->columnEnd();
$this->rowEnd();
$this->contentEnd();
$this->htmlEndPage();