webauthn/src/Application/Model/RelyingPartyEntity.php

34 lines
1006 B
PHP
Raw Normal View History

2022-10-24 22:24:40 +02:00
<?php
/**
2022-11-04 22:45:47 +01:00
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
2022-10-24 22:24:40 +02:00
*
2022-11-04 22:45:47 +01:00
* https://www.d3data.de
2022-10-24 22:24:40 +02:00
*
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
2022-11-04 22:45:47 +01:00
* @author D3 Data Development - Daniel Seifert <info@shopmodule.com>
* @link https://www.oxidmodule.com
2022-10-24 22:24:40 +02:00
*/
declare(strict_types=1);
2022-10-31 00:11:06 +01:00
namespace D3\Webauthn\Application\Model;
2022-10-24 22:24:40 +02:00
2022-10-31 00:11:06 +01:00
use OxidEsales\Eshop\Core\Registry;
2022-10-24 22:24:40 +02:00
use Webauthn\PublicKeyCredentialRpEntity;
2022-10-31 00:11:06 +01:00
class RelyingPartyEntity extends PublicKeyCredentialRpEntity
2022-10-24 22:24:40 +02:00
{
2022-10-31 00:11:06 +01:00
public function __construct()
2022-10-24 22:24:40 +02:00
{
2022-11-03 13:43:39 +01:00
$shopUrl = is_string(Registry::getConfig()->getConfigParam('d3webauthn_diffshopurl')) ?
trim(Registry::getConfig()->getConfigParam('d3webauthn_diffshopurl')) :
null;
2022-10-24 22:24:40 +02:00
parent::__construct(
2022-10-31 00:11:06 +01:00
Registry::getConfig()->getActiveShop()->getFieldData('oxname'),
2022-11-03 13:43:39 +01:00
$shopUrl ?: preg_replace('/(^www\.)(.*)/mi', '$2', $_SERVER['HTTP_HOST'])
2022-10-24 22:24:40 +02:00
);
}
}