示例#1
0
        public static void AddUser(int id, string username, bool accept)
        {
            UsersTable table = new UsersTable();

            table.Insert(id, username, accept);
            table.Dispose();
        }
示例#2
0
        public static bool UserIsInList(int id, string username)
        {
            UsersTable table   = new UsersTable();
            bool       present = table.IsPresent(id, username);

            table.Dispose();
            return(present);
        }
示例#3
0
        public static string[] AccountNotAcceptedUsers(int id)
        {
            UsersTable table = new UsersTable();

            string[] users = table.GetNotAcceptedUsers(id);
            table.Dispose();
            return(users);
        }
示例#4
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);
        }