Hi Vlado,
You can take inspiration how to accomplish similar user interface in the following file:
~\CMSSiteManager\Administration\Users\User_List.aspx.
It is based on standard
UniGrid control that is filled with the dataset retrieved by executing
cms.user.selectallview query.
Of course, you do no need to use
UniGrid, you can use any standard ASP.NET data-binding control according to your needs.
To log in as the particular user, you need to get the
UserInfo object of the user, set authentication cookie and context values:
UserInfo ui = UserInfoProvider.GetUserInfo(userId);
if (ui != null)
{
// Set authentication cookie
FormsAuthentication.SetAuthCookie(ui.UserName, false);
// Set context values
CurrentUserInfo cui = new CurrentUserInfo(ui, true);
CMSContext.SetCurrentUser(cui); CultureHelper.SetPreferredUICulture(cui.PreferredUICultureCode);
}
To see this code in action, I would like to point you to
HeaderActions_ActionPerformed method in the
~\CMSSiteManager\Administration\Users\User_Edit_General.aspx.cs file. This method contains code for the
Log in as the user functionality.
Best regards,
Michal Legen