Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
v 7.2.4
Using the following code:
protected override void ApplicationStarting(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) { const string IsApproved = Constants.Conventions.Member.IsApproved; string documentType = typeof(Foo).Name; MemberService.Saved += (sender, args) => { foreach (IMember member in args.SavedEntities) { var mhelper = new MembershipHelper(UmbracoContext.Current); var m = mh.GetById(member.Id); var isFoo = m.DocumentTypeAlias.InvariantEquals(documentType); var isApproved = m.GetPropertyValue<bool>(IsApproved); } }; }
It appears to me that none of the built in member properties are correctly populated.
isApproved returns false plus no other core properties have a value. I can see Is Approved as populated in my current back office.
isApproved
Any ideas?
I'm no expert with members but IsApproved is a property on the IMember .. I always use the memberService like this now.
Try something like (obviously replace GetByEmail with GetById):
var curMember = Services.MemberService.GetByEmail(model.Username); if (!curMember.IsApproved) { }
Thanks yeah, I would use that also normally but I need to determine the type of member so I am testing against the DocType. I wonder if I've missed something on IMember which will allow me to do that?
IMember
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Member properties not populated.
v 7.2.4
Using the following code:
It appears to me that none of the built in member properties are correctly populated.
isApproved
returns false plus no other core properties have a value. I can see Is Approved as populated in my current back office.Any ideas?
I'm no expert with members but IsApproved is a property on the IMember .. I always use the memberService like this now.
Try something like (obviously replace GetByEmail with GetById):
Thanks yeah, I would use that also normally but I need to determine the type of member so I am testing against the DocType. I wonder if I've missed something on
IMember
which will allow me to do that?is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.