Пример #1
0
 public static string[] AccountNotAcceptedUsers(int id)
 {
     UsersTable table = new UsersTable();
     string[] users = table.GetNotAcceptedUsers(id);
     table.Dispose();
     return(users);
 }
Пример #2
0
 public void Dispose()
 {
     _usersTable.Dispose();
 }
Пример #3
0
        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);
        }
Пример #4
0
 public static bool UserIsInList(int id, string username)
 {
     UsersTable table = new UsersTable();
     bool present = table.IsPresent(id, username);
     table.Dispose();
     return(present);
 }
Пример #5
0
 public static void AddUser(int id, string username, bool accept)
 {
     UsersTable table = new UsersTable();
     table.Insert(id, username, accept);
     table.Dispose();
 }