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; }
public Member GetByUsername(string username, bool populateFull = false) { return(MemberMapper.MapMember(_membershipHelper.GetByUsername(username), populateFull)); }