2024-08-04 15:49:38 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Entity;
|
|
|
|
|
|
|
|
|
|
use ApiPlatform\Metadata\ApiResource;
|
|
|
|
|
use ApiPlatform\Metadata\Get;
|
|
|
|
|
use App\Controller\InstanceController;
|
|
|
|
|
|
|
|
|
|
#[ApiResource(
|
|
|
|
|
operations: [
|
|
|
|
|
new Get(
|
|
|
|
|
uriTemplate: '/config',
|
|
|
|
|
controller: InstanceController::class,
|
|
|
|
|
shortName: 'Configuration',
|
2025-12-02 20:51:15 +01:00
|
|
|
description: 'Public configuration of the server',
|
2025-12-02 21:16:44 +01:00
|
|
|
read: false
|
2024-08-04 15:49:38 +02:00
|
|
|
),
|
|
|
|
|
]
|
|
|
|
|
)]
|
|
|
|
|
class Instance
|
|
|
|
|
{
|
|
|
|
|
private ?bool $oauthEnabled = null;
|
|
|
|
|
|
2024-08-05 03:11:03 +02:00
|
|
|
private ?bool $registerEnabled = null;
|
|
|
|
|
|
2024-08-04 15:49:38 +02:00
|
|
|
private ?bool $limitedFeatures = null;
|
|
|
|
|
|
2025-12-07 14:32:48 +01:00
|
|
|
private ?bool $ssoAutoRedirect = null;
|
|
|
|
|
|
2024-08-04 15:49:38 +02:00
|
|
|
public function isSsoLogin(): ?bool
|
|
|
|
|
{
|
|
|
|
|
return $this->oauthEnabled;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function setOauthEnabled(bool $oauthEnabled): static
|
|
|
|
|
{
|
|
|
|
|
$this->oauthEnabled = $oauthEnabled;
|
|
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function isLimitedFeatures(): ?bool
|
|
|
|
|
{
|
|
|
|
|
return $this->limitedFeatures;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function setLimitedFeatures(bool $limitedFeatures): static
|
|
|
|
|
{
|
|
|
|
|
$this->limitedFeatures = $limitedFeatures;
|
|
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
|
}
|
2024-08-05 03:11:03 +02:00
|
|
|
|
|
|
|
|
public function getRegisterEnabled(): ?bool
|
|
|
|
|
{
|
|
|
|
|
return $this->registerEnabled;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function setRegisterEnabled(?bool $registerEnabled): static
|
|
|
|
|
{
|
|
|
|
|
$this->registerEnabled = $registerEnabled;
|
|
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
|
}
|
2025-12-07 14:32:48 +01:00
|
|
|
|
|
|
|
|
public function getSsoAutoRedirect(): ?bool
|
|
|
|
|
{
|
|
|
|
|
return $this->ssoAutoRedirect;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function setSsoAutoRedirect(?bool $ssoAutoRedirect): static
|
|
|
|
|
{
|
|
|
|
|
$this->ssoAutoRedirect = $ssoAutoRedirect;
|
|
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
|
}
|
2024-08-04 15:49:38 +02:00
|
|
|
}
|