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

@ -66,7 +66,7 @@ class Login extends BaseModule
$this->baseUrl->redirect($return_path);
}
return self::form($return_path, intval($this->config->get('config', 'register_policy')) !== \Friendica\Module\Register::CLOSED);
return self::form($return_path, \Friendica\Module\Register::getPolicy() !== \Friendica\Module\Register::CLOSED);
}
protected function post(array $request = [])
@ -118,7 +118,7 @@ class Login extends BaseModule
}
$reg = false;
if ($register && intval(DI::config()->get('config', 'register_policy')) !== Register::CLOSED) {
if ($register && Register::getPolicy() !== Register::CLOSED) {
$reg = [
'title' => DI::l10n()->t('Create a New Account'),
'desc' => DI::l10n()->t('Register'),

View file

@ -86,7 +86,7 @@ class OpenID extends BaseModule
$open_id_obj->identity = $authId;
$session->set('openid_server', $open_id_obj->discover($open_id_obj->identity));
if (intval(DI::config()->get('config', 'register_policy')) === \Friendica\Module\Register::CLOSED) {
if (\Friendica\Module\Register::getPolicy() === \Friendica\Module\Register::CLOSED) {
DI::sysmsg()->addNotice($l10n->t('Account not found. Please login to your existing account to add the OpenID to it.'));
} else {
DI::sysmsg()->addNotice($l10n->t('Account not found. Please register a new account or login to your existing account to add the OpenID to it.'));