public static void AddUser(int id, string username, bool accept) { UsersTable table = new UsersTable(); table.Insert(id, username, accept); table.Dispose(); }
public static bool UserIsInList(int id, string username) { UsersTable table = new UsersTable(); bool present = table.IsPresent(id, username); table.Dispose(); return(present); }
public static string[] AccountNotAcceptedUsers(int id) { UsersTable table = new UsersTable(); string[] users = table.GetNotAcceptedUsers(id); table.Dispose(); return(users); }
private AcceptUserType OnAcceptUser(PeerSocket peer, UserInfo userInfo) { if (userInfo.SecureAuthentication == false) { return(AcceptUserType.Ask); } UsersTable usersDb = new UsersTable(); // If User isn't into DB if (usersDb.IsPresent(myAccountId, userInfo.Name) == false) { usersDb.Dispose(); return(AcceptUserType.Ask); } // Get User Accept Status bool acceptUser = usersDb.GetAccept(myAccountId, userInfo.Name); usersDb.Dispose(); return(acceptUser ? AcceptUserType.Yes : AcceptUserType.No); }