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.
This commit is contained in:
Lucas Nicodemus 2017-12-13 22:45:41 -07:00
parent 0826a37fe8
commit ffdcd34c91

View file

@ -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;