I wrote a Web Part for Sharepoint Portal 2003 that allows the
user to change his password. It works, as in the password is indeed
changed, but the problem is that instead of reloading the page
afterwards, it instead throws me to a page with a "You cannot view this
area, either because the area no longer exists, or because you do not
have the rights to view this area. To change your rights, contact the
site administrator" message.
Here's my submit code, oldPassword and newPassword are TextFields.
public void changePassword(object sender, EventArgs e)
{
SPWeb web = SPControl.GetContextWeb(Context);
user = web.CurrentUser;
DirectoryEntry entry = new DirectoryEntry("LDAP://CN=" + user.Name +
",CN=Users,DC=intranet,DC=mitchellmadison,DC=com",
user.LoginName.Substring(9), oldPassword.Text);
entry.Invoke("ChangePassword", new object[]{oldPassword.Text,
newPassword.Text});
entry.Dispose();
}
What's happening here? Do I have to reload the user profile or something
when I change the password programmatically? More importantly, how can I
correct this?
Do you know someone who can help? Share a link to this thread on twitter, or facebook.