Removed meta lockdown checks, they're only used once anyway.

This commit is contained in:
flash 2018-10-05 09:52:13 +02:00
parent 818a8a9ade
commit 885b76fce3
4 changed files with 4 additions and 16 deletions

View file

@ -15,9 +15,6 @@ collation = utf8mb4_bin
host = 127.0.0.1
prefix = msz:
[Auth]
prevent_registration = false
[Site]
name = Misuzu
description = Describe your description.

View file

@ -292,7 +292,7 @@ MIG;
$misuzuBypassLockdown = !empty($misuzuBypassLockdown);
if (!$misuzuBypassLockdown && $app->underLockdown()) {
if (!$misuzuBypassLockdown && boolval(config_get_default(false, 'Auth', 'lockdown'))) {
http_response_code(503);
echo tpl_render('auth.lockdown');
exit;

View file

@ -51,7 +51,9 @@ if (!array_key_exists($settingsMode, $settingsModes)) {
$settingsErrors = [];
$disableAccountOptions = !MSZ_DEBUG && $app->disableRegistration();
$disableAccountOptions = !MSZ_DEBUG
&& boolval(config_get_default(false, 'Private', 'enabled'))
&& boolval(config_get_default(false, 'Private', 'disable_account_settings'));
$avatarFileName = "{$settingsUserId}.msz";
$avatarProps = $app->getAvatarProps();
$backgroundProps = $app->getBackgroundProps();

View file

@ -116,17 +116,6 @@ final class Application
];
}
public function underLockdown(): bool
{
return boolval(config_get_default(false, 'Auth', 'lockdown'));
}
public function disableRegistration(): bool
{
return $this->underLockdown()
|| boolval(config_get_default(false, 'Private', 'enabled'));
}
// used in some of the user functions still, fix that
public static function getInstance(): Application
{