Improve how a user changes their password


Author
Message
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.5K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
Provide a mechanism to change the current users password and/or to change an arbitrary users password using just the user PK.



As far as I know, the only mechanism provided to allow users to change passwords is to use the Login.ShowPasswordChangeForm(), which is pretty cumbersome and not obvious how to use (to me anyway). This form takes a SFSUsersBO and then that BO must be saved if the user actually entered information that would change the password. I.e. currently the following is needed to change a users password:



Using userBO as New SFSUsersBO()

userBO.FillByPrimaryKey(SecurityBasics.CurrentUser.UserPK)

If Login.ShowPasswordChangeForm(userBO) Then

userBO.Save()

End If

End Using




Seems to me there could easily be a method (or two...or overloads) to more easily allow for the changing of a users password:



Public Function ChangeCurrentUsersPassword()

Return ChangeUserPassword(SecurityBasics.CurrentUser.UserPK)

End Function



Public Function ChangeUserPassword(userPK As Integer)

Dim changed As Boolean

Using userBO as New SFSUsersBO()

userBO.FillByPrimaryKey(userPK)

If Login.ShowPasswordChangeForm(userBO) Then

userBO.Save()

changed = True

Else

changed = False

End If

End Using

Return changed

End Function




With some function like this, only a single line of code would be needed and it would be pretty obvious how to implement it! BigGrin
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search