Hi,
I’ve been implementing some features for solutions that use impersonation (with UserImpersonation.Full configuration) and I need to use the Notifications.Standard.User.OnExtranetLogin notification to make some actions for the secondary users login with success. The event is correctly fired for the second user, but the property SecondaryUserUserID is not filled with the id from the user that is impersonating the “new” primary user.
I’ve tracked this a little in the source code and found in the file Security.vb the method SaveSelectedSecondaryUser that has this lines:
Security.LogImpersonationStarted(user.Name, secondaryUser.Name)
ExtranetLogin(secondaryUser.Name, "", True, True, secondaryUser.ID, True)
secondaryUser.CurrentSecondaryUser = If(user.CurrentSecondaryUser, user)
user = secondaryUser
secondaryUser = secondaryUser.CurrentSecondaryUser
I think if you change the order of second and third lines on this peace of code the notification will have the property properly filled, making them look like this:
Security.LogImpersonationStarted(user.Name, secondaryUser.Name)
secondaryUser.CurrentSecondaryUser = If(user.CurrentSecondaryUser, user)
ExtranetLogin(secondaryUser.Name, "", True, True, secondaryUser.ID, True)
user = secondaryUser
secondaryUser = secondaryUser.CurrentSecondaryUser
My assumption could be wrong but it would most helpful to know in the notification if the user has a “secondary” user or not.
Thanks,
Rui Silva