There currently exists a bug in Umbraco 4.7 such that the current change password dashboard control causes other dashboard controls to not be able to post back. The workaround for this is to hide the change password control, which I've done. Seeing as how the business users still very much want to be able to change their passwords I decided to create a quick little change password control. It seemed simple enough, in theory, but Im having nothing but problems with it now.
I've tried both of the following lines to get a reference to the logged-in member:
Member m = Member.GetCurrentMember(); Member m = Member.GetMemberFromLoginName(UmbracoEnsuredPage.CurrentUser.LoginName);
In both cases m comes back null. I've checked UmbracoEnsuredPage.CurrentUser.LoginName and it is returning the correct login.
All I want to do is be able to cal m.ChangePassword("newpass"); and I can't. I'm pulling my hair out over this one!
Pretty sure the Member. functions are for front-end "Members", not back end "Users", which is probably why you're not getting anything!
I think there's a User.GetCurrent() for what you need.
Also your best bet might be to check out the source for the existing Change Password control to start with. If I recall the only problem with it is that it needs a ValidationProperty or something similar.
Custom Change Password Dashboard Plugin
Hey All,
There currently exists a bug in Umbraco 4.7 such that the current change password dashboard control causes other dashboard controls to not be able to post back. The workaround for this is to hide the change password control, which I've done. Seeing as how the business users still very much want to be able to change their passwords I decided to create a quick little change password control. It seemed simple enough, in theory, but Im having nothing but problems with it now.
I've tried both of the following lines to get a reference to the logged-in member:
Member m = Member.GetCurrentMember();
Member m = Member.GetMemberFromLoginName(UmbracoEnsuredPage.CurrentUser.LoginName);
In both cases m comes back null. I've checked UmbracoEnsuredPage.CurrentUser.LoginName and it is returning the correct login.
All I want to do is be able to cal m.ChangePassword("newpass"); and I can't. I'm pulling my hair out over this one!
Any help would be greatly appreciated. :)
Jay
Hi,
Pretty sure the Member. functions are for front-end "Members", not back end "Users", which is probably why you're not getting anything!
I think there's a User.GetCurrent() for what you need.
Also your best bet might be to check out the source for the existing Change Password control to start with. If I recall the only problem with it is that it needs a ValidationProperty or something similar.
-Tom
Bah, yeah I was confusing members with users. I'll take a look at the source.
Thanks Tom
You can keep the change password control in to the dashboard.
Adding the "validationGroup" to the change password functionality user control (/unbraco/dashboard/ChangePassword.ascx) fixes the issue.
It is detailed here and I have just successfully tried it.
Hope this helps.
Nigel
is working on a reply...