'; echo "
'; echo ''; include __DIR__ . '/../../lib/adminFooter.inc'; /** * Checks if a new device should be registered and adds it. * * @param htmlResponsiveRow $container row * @param WebauthnManager $webauthnManager webauthn manager */ function addNewDevice($container, $webauthnManager) { if (empty($_POST['registrationData'])) { return; } $registrationData = base64_decode($_POST['registrationData']); $registrationObject = PublicKeyCredentialCreationOptions::createFromString($_SESSION['webauthn_registration']); $success = $webauthnManager->storeNewRegistration($registrationObject, $registrationData); if ($success) { $container->add(new htmlStatusMessage('INFO', _('The device was registered.')), 12); } else { $container->add(new htmlStatusMessage('ERROR', _('The device failed to register.')), 12); } } /** * Shows the message if a device was removed. * * @param htmlResponsiveRow $container row */ function showRemoveMessage($container) { if (!empty($_POST['removed']) && ($_POST['removed'] === 'true')) { $container->add(new htmlStatusMessage('INFO', _('The device was deleted.')), 12); } }