Automatically close the registration when the admin is inactive

This commit is contained in:
Michael 2024-03-07 06:03:15 +00:00
parent 4834255acf
commit 4b695e361c
18 changed files with 49 additions and 35 deletions

View file

@ -166,9 +166,9 @@ class InstanceV2 extends BaseApi
private function buildRegistrationsInfo(): InstanceEntity\Registrations
{
$register_policy = intval($this->config->get('config', 'register_policy'));
$enabled = ($register_policy != Register::CLOSED);
$approval_required = ($register_policy == Register::APPROVE);
$register_policy = Register::getPolicy();
$enabled = $register_policy !== Register::CLOSED;
$approval_required = $register_policy === Register::APPROVE;
return new InstanceEntity\Registrations($enabled, $approval_required);
}