From 885b76fce37147b8506b2d567f1a0f4e12df234a Mon Sep 17 00:00:00 2001 From: flashwave Date: Fri, 5 Oct 2018 09:52:13 +0200 Subject: [PATCH] Removed meta lockdown checks, they're only used once anyway. --- config/config.example.ini | 3 --- misuzu.php | 2 +- public/settings.php | 4 +++- src/Application.php | 11 ----------- 4 files changed, 4 insertions(+), 16 deletions(-) diff --git a/config/config.example.ini b/config/config.example.ini index 3b1aff5e..aea3f3ec 100644 --- a/config/config.example.ini +++ b/config/config.example.ini @@ -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. diff --git a/misuzu.php b/misuzu.php index 02b482f3..022fea25 100644 --- a/misuzu.php +++ b/misuzu.php @@ -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; diff --git a/public/settings.php b/public/settings.php index 54761ec4..03755fc5 100644 --- a/public/settings.php +++ b/public/settings.php @@ -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(); diff --git a/src/Application.php b/src/Application.php index 736402d2..9f446af5 100644 --- a/src/Application.php +++ b/src/Application.php @@ -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 {