agrodude
  •  agrodude
  • 53% (Neutral)
  • YAF Forumling Topic Starter
2008-04-06T10:59:47Z
Hi guys,

I'm trying to integrate YAF with my site...bet you haven't heard this one before!!lol

I have added the Register stored procedure to my custom registration page for my site so that bot my db and the yaf one get uploaded with the same login credentials.

However, the YAF site seems to encrypt the password somehow so when I pass in the clear text password, the actual password gets stuck in the database. When the user goes to login, this obviously causes an issue.

Please could you give me a pointer to which function/method does the encryption and where is it called from? (I cant see it on the registration page)

I have downloaded the latest version of the site (April 2008).

Cheers for the help

Agrodude:roll:
Sponsor
Jaben
  •  Jaben
  • 100% (Exalted)
  • YAF Developer
2008-04-07T12:12:35Z
string sPassword = FormsAuthentication.HashPasswordForStoringInConfigFile( Password.Text, "md5" );
agrodude
  •  agrodude
  • 53% (Neutral)
  • YAF Forumling Topic Starter
2008-06-27T01:31:43Z
Thanks Jaben,

This clears it up for me now.

I've successfully entered the password into the database now using the same method in VB.

Just need to make my logon screen generate the authentication cookie for the forum then I'm done.

Regards

Agrodude
Degeim
2008-07-20T06:05:11Z
Could someone please tell me why I can't get this to work?

Quote:

using (SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["yafnet"].ConnectionString))
{
conn.Open();

SqlCommand command = new SqlCommand("yaf_user_login", conn);
command.CommandType = CommandType.StoredProcedure;
command.Parameters.AddWithValue("@BoardID", 1);
command.Parameters.AddWithValue("@Name", User);
command.Parameters.AddWithValue("@Password", Password);

Response.Write(command.ExecuteNonQuery().ToString());
}



It's always returning "-1", even when I know that both the username and password are correct. Shouldn't it return 1 when the correct login information was submitted?

(I've tried with "FormsAuthentication.HashPasswordForStoringInConfigFile(Password, "md5" )" instead of "Password", and I've tried with "yaf_user_login @BoardID, @Name, @Password" as command, but nothing seems to work. I know that the connectionstring is alright, since I can easily SELECT Name FROM yaf_User and retrieve all usernames.)

I hope somebody can help me!

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