YAFLogo

guest
  • guest
  • Guest Topic Starter
18 years ago
Hi Everybody,

First, great forum, it's the only open source forum for asp.net that I found and which I can take serious and it's really very well done.

For sure I'm writing here because I'm also very interested regarding the YAFBlend. I want my users to login on my site and automatically get logged in on the YAF-Forum too. Are there already posiblities available to do that?

Best regards,

Markus

wsosfr
  • wsosfr
  • 57.8% (Neutral)
  • YAF Forumling
18 years ago
Hi guys

First of all, thanks yafaddict for your tool, although i cant get it to run 😞

I get a "connectionstring property not initialized" error when calling new YAFUser($$)

I tried to put in $$:

1. The connectionstring (String) itself, which definitely works

2. AppSetting Key

3. ConnectionString from the web.config (System.Configuration.ConfigurationManager.ConnectionStrings.Item("YAFConnectionString").ConnectionString)

Any clues for the cause?

Thanks

guest
  • guest
  • Guest Topic Starter
18 years ago
I've been checking out the YAF software for a majority of the day. I'm very impressed so far. My plan at this point is to build my new site around the YAF Membership provider with the help of YAFBlend.

With regards to YAFBlend...I get the following database error if I set the constructor's touch variable to true:

Violation of PRIMARY KEY constraint 'PK_yaf_Active'. Cannot insert duplicate key in object 'dbo.yaf_Active'.

The statement has been terminated.

Example:


YAFblend.YAFuser user = new YAFblend.YAFuser("Fishing", true, false);
if (user == null || !user.Authenticated)
{
	Response.Redirect(string.Format("~/forums/default.aspx?g=login&ReturnUrl={0}", Server.UrlEncode(Request.Url.PathAndQuery)));
}

I think there is a bug in the constructor (or the underlying function call) because when I look at the yaf_Active table, it made an entry for UserId=1 even through I was logging in with a user who's user id should have been 4...

guest
  • guest
  • Guest Topic Starter
18 years ago
Hi,

fantastic library! this is exactly what our site is needing - however i am getting this error:

The ConnectionString property has not been initialized.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: The ConnectionString property has not been initialized.

i have tried my connection string in quotes "myconnstring" and

System.Configuration.ConfigurationManager.ConnectionStrings["mystring"].ConnectionString

this is happening when i:

YAFuser userCurrent = new YAFuser("myconnstring", false, false);

it is definately there in my web.config as i slapped on an ASP gridview and it filled up nicely using this connection string.

thanks in advance!

- wicked

guest
  • guest
  • Guest Topic Starter
18 years ago

Hi,

fantastic library! this is exactly what our site is needing - however i am getting this error:

The ConnectionString property has not been initialized.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: The ConnectionString property has not been initialized.

wicked wrote:

i have tried my connection string in quotes "myconnstring" and

System.Configuration.ConfigurationManager.ConnectionStrings["mystring"].ConnectionString

this is happening when i:

YAFuser userCurrent = new YAFuser("myconnstring", false, false);

it is definately there in my web.config as i slapped on an ASP gridview and it filled up nicely using this connection string.

thanks in advance!

- wicked

I seem to have found why it was not working for me.

with my project my 'connection string' (in web.config) for my database was defined as follows:

providerName="System.Data.SqlClient" />

HOWEVER - after using this fantastic tool Reflector  to peek inside the yafblend dll i found it is not using the 'connectionStrings' method of getting the connection string - it is using the 'appSettings' method.

For yafblend to get a successfull connection to the database you need to add this to your web.config (outside the system.web):

if (ConfigurationSettings.AppSettings[WebConfigConnectionStringKey] == null)

{

this.strConnectionString = WebConfigConnectionStringKey;

}

i hope this helps someone else :)

also thanks again for YAFBlend - a fantastic library!

- wicked

guest
  • guest
  • Guest Topic Starter
17 years ago
Hi there,

First off, this is a great forum and YAFBlend looks like a great addition.

Runing my website as one app and the YAF forum as virtual directory under that app in it's own folder but accessible under myapp/forum and works great. (Couldn't get it into a folder directly under my app, since it complained about going to a diff app which was not allowed.)

Thing is, I'm getting "guest" as the YAFuser.Name returned to myapp.

What are the rules around implementing this or is there another way to incorporate the forum into the site.

Also looking forward to having the user group returned as I want the diff logged in user groups to be able to download diff stuff on my site.

Could anyone please point me in the right direction?

guest
  • guest
  • Guest Topic Starter
17 years ago
Oh, sorted out my issue.

Added forum as an actual folder using the /MyappName/YAFforum/ since I was running on my localhost. Working great now, I can see on the main site the User that's logged in.

Still looking to find a way to tell my main site which usergroup the user is. Are there any new updates? Is anyone still out there? Or can someone point me in the new direction everyone is taking?

mattd00d
  • mattd00d
  • 50.6% (Neutral)
  • YAF Forumling
16 years ago
When I use YAFBlend I have a issue with IIS6. When I check for authentication on my main website it always returns nothing so it assumes guest. When I am logged into the forum this happens all the time. Is there any trick to get the httpcontext or cookie info across to the main web page application? It seems like they are using the same session keys. I was thinking of just queuing off the session keys and the time on and off? Any suggestions?