예제 #1
0
        public static void UpdateSueetieUserIP(SueetieUser sueetieUser)
        {
            var provider = SueetieDataProvider.LoadProvider();

            provider.UpdateSueetieUserIP(sueetieUser);
            SueetieCache.Current.Remove(SueetieBannedIPListCacheKey());
        }
예제 #2
0
        public static SueetieUser GetAnonymousUser()
        {
            var sueetieUser = new SueetieUser();

            sueetieUser.UserID   = -1;
            sueetieUser.UserName = "******";
            sueetieUser.Email    = "*****@*****.**";
            SueetieCache.Current.Insert(UserCacheKey(-1), sueetieUser);
            return(sueetieUser);
        }
예제 #3
0
        public static SueetieUser GetUser(string username)
        {
            var sueetieUser = new SueetieUser();
            var provider    = SueetieDataProvider.LoadProvider();

            var userCacheKey = UserCacheKey(username);

            sueetieUser = SueetieCache.Current[userCacheKey] as SueetieUser;
            if (sueetieUser == null)
            {
                sueetieUser = provider.GetUser(username);
                SueetieCache.Current.InsertMinutes(userCacheKey, sueetieUser, 2);
            }
            return(sueetieUser);
        }
예제 #4
0
        public static void CreateUpdateUserProfileCookie(SueetieUser sueetieUser)
        {
            var cookie = HttpContext.Current.Request.Cookies["SueetieUserProfile"];

            if (cookie == null)
            {
                cookie = new HttpCookie("SueetieUserProfile");
            }

            cookie["UserID"]      = sueetieUser.UserID.ToString();
            cookie["UserName"]    = sueetieUser.UserName;
            cookie["Email"]       = sueetieUser.Email;
            cookie["DisplayName"] = sueetieUser.DisplayName;

            HttpContext.Current.Response.Cookies.Add(cookie);
        }
예제 #5
0
        public List <Pair> ProfileUserFollow(int userID, int profileUserID, bool stopFollowing)
        {
            if (userID > 0)
            {
                SueetieUser   sueetieFollowingUser = SueetieUsers.GetUser(profileUserID);
                string        result        = "You are now following " + sueetieFollowingUser.DisplayName;
                SueetieFollow sueetieFollow = new SueetieFollow
                {
                    FollowerUserID    = userID,
                    FollowingUserID   = profileUserID,
                    ContentIDFollowed = -1
                };

                if (sueetieFollow.FollowerUserID == sueetieFollow.FollowingUserID)
                {
                    result = "Sorry, you cannot follow yourself...";
                }
                else
                {
                    if (!stopFollowing)
                    {
                        int followID = SueetieUsers.FollowUser(sueetieFollow);
                    }
                    else
                    {
                        SueetieUsers.UnFollowUser(sueetieFollow);
                        result = "You are no longer following " + sueetieFollowingUser.DisplayName;
                    }
                }
                List <Pair> followResult = new List <Pair>();
                followResult.Add(new Pair(stopFollowing, result));

                return(followResult);
            }
            else
            {
                List <Pair> followResult = new List <Pair>();
                followResult.Add(new Pair(stopFollowing, "Please login or become a member to follow this person."));

                return(followResult);
            }
        }
예제 #6
0
        public static SueetieUser GetUser(int userID, bool getCached)
        {
            var sueetieUser = new SueetieUser();
            var provider    = SueetieDataProvider.LoadProvider();

            var userCacheKey = UserCacheKey(userID);

            if (getCached)
            {
                sueetieUser = SueetieCache.Current[userCacheKey] as SueetieUser;
                if (sueetieUser == null)
                {
                    sueetieUser = provider.GetUser(userID);
                    SueetieCache.Current.InsertMinutes(userCacheKey, sueetieUser, 2);
                }
            }
            else
            {
                sueetieUser = provider.GetUser(userID);
            }
            return(sueetieUser);
        }
예제 #7
0
        public static int CreateForumUser(SueetieUser sueetieUser)
        {
            var provider = SueetieDataProvider.LoadProvider();

            return(provider.CreateForumUser(sueetieUser));
        }
예제 #8
0
        public static void UpdateSueetieUser(SueetieUser sueetieUser)
        {
            var provider = SueetieDataProvider.LoadProvider();

            provider.UpdateSueetieUser(sueetieUser);
        }
예제 #9
0
        public static void CreateBlogAdmin(SueetieUser sueetieUser)
        {
            var provider = SueetieDataProvider.LoadProvider();

            provider.CreateBlogAdmin(sueetieUser);
        }