public static void AddAnonymousUser() { Global.User anonuser = new Global.User(); anonuser.username = "******"; anonuser.password = Global.hashedAnonymousPassword; anonuser.banned = false; anonuser.banReason = ""; anonuser.bannedUntil = ""; WriteUserToXML(anonuser); }
public static void WriteUserToXML(Global.User userObj) { XmlElement user = (XmlElement)xmlusers.AppendChild(xmldoc.CreateElement("User")); user.SetAttribute("username", userObj.username); user.SetAttribute("password", userObj.password); user.SetAttribute("banned", userObj.banned.ToString()); user.SetAttribute("banReason", userObj.banReason); user.SetAttribute("bannedUntil", userObj.bannedUntil); xmldoc.Save(xmlFilePath); }
public static void RegisterUser(Global.Messages.Registration package) { Global.User user = new Global.User(); user.username = package.username; user.password = BCryptHelper.HashPassword(package.password, BCryptHelper.GenerateSalt()); user.banned = false; user.banReason = ""; user.bannedUntil = ""; WriteUserToXML(user); }