expert
  •  expert
  • 51.8% (Neutral)
  • YAF Forumling Topic Starter
2010-03-30T06:28:57Z
It didn't work.

I added in web.config a connectionString 'yafnet'

I have not any membership or roleManager or Profile tag in web.config. I have Form Authentication. The application is FW 2.0

It's the same for me to have http://myapp/forum or forum.myapp.it

I add in my login page in Login1_LoggedIn(object sender, EventArgs e):




System.Web.UI.WebControls.Login loginControl = (System.Web.UI.WebControls.Login)sender;
String password = FormsAuthentication.HashPasswordForStoringInConfigFile(loginControl.Password, "md5");
Object userID = DB.user_login(1, loginControl.UserName, password);

if (userID == DBNull.Value)
{
  AdminPage adminPage = new AdminPage();
  userID = DB.user_register(adminPage, 1, loginControl.UserName,
       loginControl.Password, Membership.GetUser(loginControl.UserName).Email, "", "", "-300", false);
}

string idName = string.Format("{0};{1};{2}", userID, 1, loginControl.UserName);
FormsAuthentication.SetAuthCookie(idName, loginControl.RememberMeSet);

In version 1.9.3 DB.user_register has changed! What is the new correct version???
Sponsor

About Us

The YAF.NET is an open source .NET forum project. YAF.NET is supported by an team of international developers who are build community by building community software.

Powered by Resharper Donate with PayPal button

Project Twitter Updates

Copyright © YetAnotherForum.NET & Ingo Herbote. All rights reserved