fix: [TOTP] allow deletion of TOTP from edit page

pull/9570/head
Christophe Vandeplas 2023-12-13 11:26:20 +01:00
parent e9faa33ef8
commit e319a6a234
1 changed files with 12 additions and 0 deletions

View File

@ -52,6 +52,18 @@
echo $this->Form->input('confirm_password', array('type' => 'password', 'div' => array('class' => 'input password required')));
?>
</div>
<?php
$isTotp = isset($this->request->data['User']['totp']) ? true : false;
if ($isTotp) {
echo sprintf(
'<div class="clear"><span role="button" tabindex="0" aria-label="%s" onclick="openGenericModal(\'%s/users/totp_delete/%s\')" class="btn btn-inverse" style="margin-bottom:10px;">%s</span></div>',
__('Delete TOTP token'),
h($baseurl),
h($this->request->data['User']['id']),
__('Delete TOTP token')
);
}
?>
</div>
<div class="clear"></div>
<?php