Browse Source

webauthn

pull/80/head
Roland Gruber 3 years ago
parent
commit
4e329f1f55
  1. 11
      lam/templates/lib/500_lam.js
  2. 1
      lam/templates/misc/ajax.php
  3. 2
      lam/templates/tools/webauthn.php

11
lam/templates/lib/500_lam.js

@ -1615,10 +1615,11 @@ window.lam.webauthn.removeDevice = function(event) {
* Removes a user's own webauthn device.
*
* @param event click event
* @param isSelfService run in self service or admin context
*/
window.lam.webauthn.removeOwnDevice = function(event) {
window.lam.webauthn.removeOwnDevice = function(event, isSelfService) {
event.preventDefault();
const element = jQuery(event.target);
const element = jQuery(event.currentTarget);
const successCallback = function () {
const form = jQuery("#webauthnform");
jQuery('<input>').attr({
@ -1628,7 +1629,11 @@ window.lam.webauthn.removeOwnDevice = function(event) {
}).appendTo(form);
form.submit();
};
window.lam.webauthn.removeDeviceDialog(element, 'webauthnOwnDevices', successCallback);
let action = 'webauthnOwnDevices';
if (isSelfService) {
action = action + '&selfservice=true&module=webauthn&scope=user';
}
window.lam.webauthn.removeDeviceDialog(element, action, successCallback);
return false;
}

1
lam/templates/misc/ajax.php

@ -92,6 +92,7 @@ class Ajax {
$module = new $_GET['module']($_GET['scope']);
$module->handleAjaxRequest();
}
die();
}
if (!isset($_GET['function'])) {
die();

2
lam/templates/tools/webauthn.php

@ -115,7 +115,7 @@ else {
$delButton->addDataAttribute('dialogtitle', _('Remove device'));
$delButton->addDataAttribute('oktext', _('Ok'));
$delButton->addDataAttribute('canceltext', _('Cancel'));
$delButton->setOnClick('window.lam.webauthn.removeOwnDevice(event);');
$delButton->setOnClick('window.lam.webauthn.removeOwnDevice(event, false);');
$data[] = array(
new htmlOutputText(date('Y-m-d H:i:s', $result['registrationTime'])),
new htmlOutputText(date('Y-m-d H:i:s', $result['lastUseTime'])),

Loading…
Cancel
Save