From ffdcd34c9109df66a2ca920c35251fc5b0e174d3 Mon Sep 17 00:00:00 2001 From: Lucas Nicodemus Date: Wed, 13 Dec 2017 22:45:41 -0700 Subject: [PATCH] Fix issue where setup system could re-enable itself The current initial setup system would re-enable if setup.lock was removed even if an account was in the database. This is because when we switched to "owner" being the primary target of the setup system, we failed to anticipate that an account with superadmin would never exist in the database in an ideal condition. --- TShockAPI/TShock.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs index 405cd887..eeec18c1 100644 --- a/TShockAPI/TShock.cs +++ b/TShockAPI/TShock.cs @@ -861,8 +861,8 @@ namespace TShockAPI Config.ServerPassword = _cliPassword; } - // Disable the auth system if "setup.lock" is present or a superadmin exists - if (File.Exists(Path.Combine(SavePath, "setup.lock")) || UserAccounts.GetUserAccounts().Exists(u => u.Group == new SuperAdminGroup().Name)) + // Disable the auth system if "setup.lock" is present or a user account already exists + if (File.Exists(Path.Combine(SavePath, "setup.lock")) || (UserAccounts.GetUserAccounts().Count() > 0)) { SetupToken = 0;