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

@ -80,7 +80,7 @@ class Import extends \Friendica\BaseModule
protected function post(array $request = [])
{
if ($this->config->get('config', 'register_policy') != \Friendica\Module\Register::OPEN && !$this->app->isSiteAdmin()) {
if (\Friendica\Module\Register::getPolicy() !== \Friendica\Module\Register::OPEN && !$this->app->isSiteAdmin()) {
throw new HttpException\ForbiddenException($this->t('Permission denied.'));
}
@ -99,7 +99,7 @@ class Import extends \Friendica\BaseModule
protected function content(array $request = []): string
{
if (($this->config->get('config', 'register_policy') != \Friendica\Module\Register::OPEN) && !$this->app->isSiteAdmin()) {
if ((\Friendica\Module\Register::getPolicy() !== \Friendica\Module\Register::OPEN) && !$this->app->isSiteAdmin()) {
$this->systemMessages->addNotice($this->t('User imports on closed servers can only be done by an administrator.'));
}