I'm using the following code in order to authentificate a user programatically in Kentico CMS 7.x:
CMS.SiteProvider.UserInfo ui = AuthenticationHelper.AuthenticateUser("user", "password", CMS.CMSHelper.CMSContext.CurrentSite.SiteName);
if (ui != null)
{
System.Web.Security.FormsAuthentication.SetAuthCookie(ui.UserName, true);
CMS.CMSHelper.CMSContext.SetCurrentUser(new CMS.CMSHelper.CurrentUserInfo(ui, true));
CMS.SiteProvider.UserInfoProvider.SetPreferredCultures(ui);
if (Request.QueryString["Pagename"] != null) {
Response.Redirect(Request.QueryString["Pagename"] + ".aspx");
}
else {
Response.Redirect("/LoggedIn.aspx");
}
}
else
{
Response.Redirect("/Login.aspx");
}
Everthing seems to be working just fine. There's still one problem. When using the Internet Explorer (other browsers are working fine) and opening the print preview (and actual print) all attached images are displayed as broken links.
I double-checked user security settings by logging in with the same user using the standard logon form - everthing's fine...