Esempio n. 1
0
        public static string UnBlockMember(int memberId)
        {
            int _currentMember = HttpContext.Current.User.Identity.IsAuthenticated ? (int)Membership.GetUser().ProviderUserKey : 0;

            //Check if member is an admin (in group 'admin')
            if (Utills.IsAdmin(_currentMember))
            {
                //Lets check the memberID of the member we are blocking passed into /base is a valid member..
                if (Utills.IsMember(memberId))
                {
                    //Yep - it's valid, lets get that member
                    Member MemberToBlock = Utills.GetMember(memberId);

                    //Now we have the member - lets update the 'blocked' property on the member
                    MemberToBlock.getProperty("blocked").Value = false;

                    //Save the changes
                    MemberToBlock.Save();

                    //It's all good...
                    return("true");
                }
            }

            //Member not authorised or memberID passed in is not valid
            return("false");
        }
Esempio n. 2
0
        public static void SaveEditorChoice(string editorChoice)
        {
            var currentMember          = Utills.GetMember(Member.CurrentMemberId());
            var markdownEditorProperty = currentMember.getProperty(UseMarkdownEditorPropertyAlias);

            if (markdownEditorProperty != null)
            {
                var useMarkdownEditor = editorChoice == EditorChoiceMarkdown;
                currentMember.getProperty(UseMarkdownEditorPropertyAlias).Value = useMarkdownEditor ? "1" : "0";
            }

            SetEditorChoiceCookie(editorChoice);
        }
Esempio n. 3
0
        public static string SetEditorChoiceFromMemberProfile(int id = 0)
        {
            var currentMember = Utills.GetMember(id == 0 ? Member.CurrentMemberId() : id);

            var editorChoice = EditorChoiceRte;

            if (currentMember != null)
            {
                var markdownEditorProperty = currentMember.getProperty(UseMarkdownEditorPropertyAlias);

                if (markdownEditorProperty != null)
                {
                    if (markdownEditorProperty.Value.ToString() == "1")
                    {
                        editorChoice = EditorChoiceMarkdown;
                    }
                }
            }

            SetEditorChoiceCookie(editorChoice);

            return(editorChoice);
        }