Added LastAccessed time field and KnownIPs field to the user database. This resulted in some changes everywhere, such as new logic with default groups. Apparently, somehow, the ip based stuff worked even though no ips were set to properly grab the user group. The wrong group was being assigned to new users resulting in a player with 0 permissions. This is now fixed.

This commit is contained in:
Zack Piispanen 2013-09-21 20:57:14 -04:00
parent d4e193b44d
commit 7c0bcceb9f
8 changed files with 67 additions and 26 deletions

View file

@ -3210,10 +3210,9 @@ namespace TShockAPI
{
try
{
TShock.Users.AddUser(new User("", "", "superadmin"));
args.Player.Group = TShock.Utils.GetGroup("superadmin");
args.Player.SendInfoMessage("This IP address is now superadmin. Please perform the following command:");
args.Player.SendInfoMessage("/user add <username>:<password> superadmin");
args.Player.SendInfoMessage("You are now superadmin, please do the following to finish your install:");
args.Player.SendInfoMessage("/user add <username> <password> superadmin");
args.Player.SendInfoMessage("Creates: <username> with the password <password> as part of the superadmin group.");
args.Player.SendInfoMessage("Please use /login <username> <password> to login from now on.");
args.Player.SendInfoMessage("If you understand, please /login <username> <password> now, and type /auth-verify.");
@ -3229,9 +3228,7 @@ namespace TShockAPI
if (args.Player.Group.Name == "superadmin")
{
args.Player.SendInfoMessage("Please disable the auth system! If you need help, consult the forums. http://tshock.co/");
args.Player.SendInfoMessage("This IP address is now superadmin. Please perform the following command:");
args.Player.SendInfoMessage("/user add <username>:<password> superadmin");
args.Player.SendInfoMessage("Creates: <username> with the password <password> as part of the superadmin group.");
args.Player.SendInfoMessage("This account is superadmin, please do the following to finish your install:");
args.Player.SendInfoMessage("Please use /login <username> <password> to login from now on.");
args.Player.SendInfoMessage("If you understand, please /login <username> <password> now, and type /auth-verify.");
return;
@ -3250,15 +3247,6 @@ namespace TShockAPI
return;
}
if (!args.Player.IsLoggedIn)
{
args.Player.SendWarningMessage("You must be logged in to disable the auth system.");
args.Player.SendWarningMessage("This is a security measure designed to prevent insecure administration setups.");
args.Player.SendWarningMessage("Please re-run /auth and read the instructions!");
args.Player.SendWarningMessage("If you're still confused, consult the forums: http://tshock.co/");
return;
}
args.Player.SendSuccessMessage("Your new account has been verified, and the /auth system has been turned off.");
args.Player.SendSuccessMessage("You can always use the /user command to manage players. Don't just delete the auth.lck.");
args.Player.SendSuccessMessage("Thank you for using TShock! http://tshock.co/ & http://github.com/TShock/TShock");