示例#1
0
        public object managerLogin(string username, string password)
        {
            var   mh      = new MembershipHelper(UmbracoContext.Current);
            var   login   = mh.Login(username, password);
            login manager = new login();

            if (login == true)
            {
                var cManager = mh.GetByUsername(username);

                var cs    = Services.ContentService;
                var clubs = cs.GetRootContent();


                foreach (var club in clubs)
                {
                    if (club.ContentTypeId == 1073)
                    {
                        var managerId = this.GetManager((club.Properties["clubManager"].Value != null) ? club.Properties["clubManager"].Value.ToString() : null);
                        if (managerId == cManager.Id)
                        {
                            manager.clubId = club.Id;
                        }
                    }
                }
                manager.managerType = cManager.GetType().Name;
            }

            return(manager);
        }
 public static bool IsAdminPosted(int contentID)
 {
     bool res = false;
       MembershipHelper members = new MembershipHelper(UmbracoContext.Current);
       IContent content = cs.GetById(contentID);
       string author = (string)content.GetValue("author");
       if (!(author == "anonymous"))
     res = members.GetByUsername(author).IsDocumentType("Admin");
       return res;
 }
示例#3
0
 public Member GetByUsername(string username, bool populateFull = false)
 {
     return(MemberMapper.MapMember(_membershipHelper.GetByUsername(username), populateFull));
 }