webauthn/src/Application/Model/RelyingPartyEntity.php

38 lines
1.1 KiB
PHP
Raw Normal View History

2022-10-24 22:24:40 +02:00
<?php
/**
* This Software is the property of Data Development and is protected
* by copyright law - it is NOT Freeware.
*
* Any unauthorized use of this software without a valid license
* is a violation of the license agreement and will be prosecuted by
* civil and criminal law.
*
* http://www.shopmodule.com
*
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
* @author D3 Data Development - Daniel Seifert <support@shopmodule.com>
* @link http://www.oxidmodule.com
*/
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
);
}
}