also i was tossing up whether to use an actionhandler or to create a custom membership provider but have found that my override of update user never actually get's hit breakpoint wise..
and here's the custom membership provider but for some reason the code isn't being hit.. i like the idea of using the membership provider it's just i can't seem to get it to call update:
also i was tossing up whether to use an actionhandler or to create a custom membership provider but have found that my override of update user never actually get's hit breakpoint wise..
and here's the custom membership provider but for some reason the code isn't being hit.. i like the idea of using the membership provider it's just i can't seem to get it to call update:
To answer your question without looking at the coide... It's not possible to get the previous value of a member. The modified object by the user is used in the Event. Not to plug anything, but in UmbImport people can assign roles also. When a member gets updated I first remove all roles and the reassign the selected roles. Maybe that will also work in your case?
Action Handler Test Value Before
Hi All,
I'm writing an action handler so when a member is saved they get their roles reassigned if a property has changed..
what im having trouble with is how to actually check the previous value of the property vs the value to be saved.. is that possible?
here's my code so far for my actionhandler
public
MemberActionHelper()
{
(Member_BeforeSave);
}
e)
{
//what id like to do here is check if the memberDomain has changed but am unsure how to do that..
).Value.ToString();
memberDomainID;
memberDomainID))
{
())
{
domain = dc.MemberDomains.Where(d => d.ID == memberDomainID).SingleOrDefault();
)
{
.GetAllRoles());
domain.MemberDomainToMemberGroups)
{
domainRoleName = memberDomainToGroupRelationship.umbracoNode.text;
.IsUserInRole(sender.LoginName, domainRoleName))
{
.AddUserToRole(sender.LoginName, domainRoleName);
also i was tossing up whether to use an actionhandler or to create a custom membership provider but have found that my override of update user never actually get's hit breakpoint wise..
and here's the custom membership provider but for some reason the code isn't being hit.. i like the idea of using the membership provider it's just i can't seem to get it to call update:
public
user)
{
.GetMemberFromEmail(user.Email);
;
memberDomainID;
memberDomainID))
{
())
{
domain = dc.MemberDomains.Where(d => d.ID == memberDomainID).SingleOrDefault();
)
{
.GetAllRoles());
domain.MemberDomainToMemberGroups)
{
domainRoleName = memberDomainToGroupRelationship.umbracoNode.text;
.IsUserInRole(member.LoginName, domainRoleName))
{
.AddUserToRole(member.LoginName, domainRoleName);
}
}
}
}
}
.UpdateUser(user);
}
and in web.config
<!--
-->
<
>
<
>
<
/>
<!--
-->
<
/>
<
/>
<
/>
</
>
</
>
any help on either approach would be awesome!
thanks,
Tom
Hi Tom
Unfortunately your code is a bit hard to read. Something's not good with the formatting. Can you please try and post again?
Then it would be a bit easier to view your code and help you out :-)
/Jan
Hi Jan,
my apologies!
So let's try again!:
I'm writing an action handler so when a member is saved they get their roles reassigned if a property has changed..
what im having trouble with is how to actually check the previous value of the property vs the value to be saved.. is that possible?
here's my code so far for my actionhandler
The Member Action Handler
also i was tossing up whether to use an actionhandler or to create a custom membership provider but have found that my override of update user never actually get's hit breakpoint wise..
and here's the custom membership provider but for some reason the code isn't being hit.. i like the idea of using the membership provider it's just i can't seem to get it to call update:
The Membership Provider
The web.config file:
wierd! im copying and pasting from visual studio in a code block and the formatting is still terrible!
Hi Tom,
To answer your question without looking at the coide... It's not possible to get the previous value of a member. The modified object by the user is used in the Event. Not to plug anything, but in UmbImport people can assign roles also. When a member gets updated I first remove all roles and the reassign the selected roles. Maybe that will also work in your case?
Cheers,
Richard
is working on a reply...