fix: [removing totp] was a postlink, causing unprompted removal

- use a GET to display a modal with the prompt
bad_encoding_pymisp
iglocska 2023-05-31 15:13:56 +02:00
parent 8d596784e3
commit acf3e41e9d
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
1 changed files with 8 additions and 2 deletions

View File

@ -26,9 +26,15 @@ $isTotp ? __('Yes') : __('No'));
$totpHtml = $boolean;
$totpHtml .= (!$isTotp && !$admin_view ? $this->Html->link(__('Generate'), array('action' => 'totp_new')) : '');
$totpHtml .= ($isTotp && !$admin_view ? $this->Html->link(__('View paper tokens'), array('action' => 'hotp', $user['User']['id'])): '');
$totpHtml .= ($admin_view && $isTotp ? ' ' . $this->Form->postLink(__('Delete'), array('action' => 'totp_delete', $user['User']['id'])) : '');
if ($admin_view && $isSiteAdmin && $isTotp) {
$totpHtml .= sprintf(
'<a href="#" onClick="openGenericModal(\'%s/users/totp_delete/%s\')">%s</a>',
h($baseurl),
h($user['User']['id']),
__('Delete')
);
}
$table_data = [
array('key' => __('ID'), 'value' => $user['User']['id']),
array(