mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-12-24 05:48:29 +00:00
html escape secret
This commit is contained in:
parent
b611dabec6
commit
e4a6ef9ba4
|
|
@ -21,6 +21,9 @@
|
|||
*/
|
||||
require "vendor/autoload.php";
|
||||
|
||||
use RobThree\Auth\TwoFactorAuth;
|
||||
use RobThree\Auth\Providers\Qr\BaconQrCodeProvider;
|
||||
|
||||
/**
|
||||
* Class which outputs the html page for ForcePasswordChange view
|
||||
*
|
||||
|
|
@ -81,7 +84,8 @@ $(document).ready( function() {
|
|||
$this->columnStart(6);
|
||||
$this->contentHeading(getMLText('2_fact_auth_new_secret'));
|
||||
|
||||
$tfa = new \RobThree\Auth\TwoFactorAuth('SeedDMS: '.$sitename);
|
||||
// $tfa = new \RobThree\Auth\TwoFactorAuth('SeedDMS: '.$sitename);
|
||||
$tfa = new TwoFactorAuth(new BaconQrCodeProvider());
|
||||
$oldsecret = $user->getSecret();
|
||||
$secret = $tfa->createSecret();
|
||||
?>
|
||||
|
|
@ -99,17 +103,17 @@ $(document).ready( function() {
|
|||
)
|
||||
);
|
||||
$this->formSubmit(getMLText('submit_2_fact_auth'));
|
||||
echo '<div class="control-group"><label class="control-label"></label><div class="controls">';
|
||||
echo '<img src="'.$tfa->getQRCodeImageAsDataUri($user->getLogin(), $secret).'">';
|
||||
echo '</div></div>';
|
||||
?>
|
||||
<div class="control-group"><label class="control-label"></label><div class="controls">
|
||||
<img src="<?php echo $tfa->getQRCodeImageAsDataUri($user->getLogin(), $secret); ?>">
|
||||
</div></div>
|
||||
</form>
|
||||
<?php
|
||||
if($oldsecret) {
|
||||
$this->columnEnd();
|
||||
$this->columnStart(6);
|
||||
$this->contentHeading(getMLText('2_fact_auth_current_secret'));
|
||||
echo '<div>'.$oldsecret.'</div>';
|
||||
echo '<div>'.htmlspecialchars($oldsecret).'</div>';
|
||||
echo '<div><img src="'.$tfa->getQRCodeImageAsDataUri($sitename, $oldsecret).'"></div>';
|
||||
?>
|
||||
<?php
|
||||
|
|
@ -121,4 +125,3 @@ $(document).ready( function() {
|
|||
$this->htmlEndPage();
|
||||
} /* }}} */
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user