Hi,
I've never worked with impersonation before and I'm now trying to make it work on one of our solutions. I've created a user that can impersonate a lot of other users. I've created a template that creates a select element with options of all of the users that can be impersonated:
<form method="post">
<select id="DWExtranetSecondaryUserSelector" name="DWExtranetSecondaryUserSelector">
@{
foreach (var secondaryUser in GetLoop("DWExtranetSecondaryUsers")) {
if (counter == 10) {
<option value='@secondaryUser.GetString("UserID")' selected>@secondaryUser.GetString("UserName")</option>
} else {
<option value='@secondaryUser.GetString("UserID")'>@secondaryUser.GetString("UserName")</option>
}
}
}
</select>
<input type="submit" value="Start impersonation" />
</form>
If a user is already impersonated I create this form instead:
<form method="post">
<input type="submit" name="DwExtranetRemoveSecondaryUser" id="DwExtranetRemoveSecondaryUser" value="Stop impersonation">
</form>
The impersonation select didn't seem to work to begin with, but somehow I'm impersonating a user now. I just can't stop impersonating the user - the "DwExtranetRemoveSecondaryUser" doesn't seem to work. What am I doing wrong? :-)