Rivelyn
2007-10-29T19:05:21Z
I have pages in my site that are not part of the actual forum page(s) and I need to check users and make sure they are in certain roles that are set for registered members to be able to access the content on those pages.

So I use if then statements to check against the logged in users roles, and these roles are dynamic, as in I create them and I know what they are but they are not part of an Admin or Moderator role pre-defined by YAF.
guest
2007-10-30T06:04:54Z
You mean different groups? Check these places:
- Enums.cs GroupFlags.
- dbo.yaf_group & dbo.yaf_UserGroup

Hopefully this helps.
Rivelyn
2007-10-30T14:24:14Z
neubee wrote:

You mean different groups? Check these places:
- Enums.cs GroupFlags.
- dbo.yaf_group & dbo.yaf_UserGroup

Hopefully this helps.



No I just want to get the role that the current logged in user belongs to into a string so I can programmatically make use of it.
guest
2007-10-31T06:08:05Z
Role = group, you can verify this when you are in the Admin section - Groups(Roles) on the left panel. But in the code and database, it is called group. If you join dbo.yaf_UserGroup with dbo.yaf_group, you will see userid associated with a "role" you assigned.
guest
2007-11-22T02:10:10Z
Hi,

I've been looking for single login solutions here as well, but not able to use any of the methods discussed. Maybe I miss certain step. What I did so far:

1. Created my own login page. When user login, will use the YAF DLL to check and create user to the YAF database.
2. Once login, then i will store the ID, EMAIL and Password to session.
3. Created a link to the Forum from my website. After login, the user will be directed to my website main page (session has been created). If the user click on the Forum link, will bring the user to the forum main page and at this point it should be able to recognize the user because user already login.

But the problem now is, the user is still not logged in. Any step I miss? Thanks in advance.

I've continue this question at the following topic as I think that it is more suitable there:
http://forum.yetanotherf...n-Help-Needed.aspx#18593 

Regards,
ewyong
guest
2008-01-24T08:21:11Z
If it helps, I had the same issue with maintaining session. After reviewing the cookie in IE7, we noticed differences in the cookie names. For example, when testing the auto login locally, the cookie displayed the name ".ASPXAUTH". When we logged into the forum, the cookie had a different name ."YAFNET_Authentication". We went into the forum web.config and noticed <system.web><forms name="YAFNET_Authentication">. We changed the forms name value to match the cookie name on the main/initial website and everything worked.

Sweettrips
2008-11-14T22:27:19Z
Thank yo for sharing useful information.We want you to come up with advanced information so that will be helpful to everyone.




YTBTravels-Travel, Flight, Cars, Hotels, Cruises, Vacations 
rbozo
  •  rbozo
  • 53.6% (Neutral)
  • YAF Forumling
tejas7001
2009-02-26T20:16:27Z
According to zee's code i did the following

Dim sPassword As String = FormsAuthentication.HashPasswordForStoringInConfigFile(pgen.fvar(Request, "ppass"), "md5")
Dim userID As Object = yaf.DB.user_login(1, pgen.fvar(Request, "puser"), sPassword)
Response.Write(userID.ToString)
If Not userID Is DBNull.Value Then
Dim idName As String = String.Format("{0};{1};{2}", userID, 1, pgen.fvar(Request, "puser"))

If (Request.QueryString("ReturnUrl") <> Nothing) Then
FormsAuthentication.RedirectFromLoginPage(idName, True)
Else
FormsAuthentication.SetAuthCookie(idName, True)
'yaf.Forum.
Response.Write("authen")
End If
Else
'AddLoadMessage(GetText("password_error"))
End If


i am gettin the error : System.ApplicationException: Failed to get configuration from Web.config. at yaf.Config.get_configSection() at yaf.YafDBConnManager.InitConnection() at yaf.DB.ExecuteScalar(SqlCommand cmd) at yaf.DB.user_login(Object boardID, Object name, Object password) at bestprax._default1.Page_Load(Object sender, EventArgs e) in C:\whb\Sites\9231\Web\default.aspx.vb:line 100

I also added the machine key in my web.config as well as yaf's web.config :
<machineKey validationKey="B01E4F14415E7E5930B41F69BDBCE9D7BDCF47A2AF163938C408DB2BDCD711D2BB734CE708F017E6F6FDC22E1488E245599EF1DFA2135848E7C39A3610FC555E" decryptionKey="BD120FA51B03C356CB262CDCF4E25D277E8070EE673916B3A77C83DDF3BE00CB" validation="SHA1" decryption="AES"/>

please help me out
tejas7001
2009-03-01T22:17:49Z
In the above code by zeeee yaf.DB.user_login

is DB in above line database name? or something else

please help me ou.........getting crazzzzzzzy :evil:
tejas7001
2009-03-09T22:01:34Z
Any ways........at last i figured it out my self and got every thing working, succesfully integrating the yaf with my website as well as my database
This post helped me a lot, thanks
re3rotor
2009-03-12T08:37:51Z
Hi,
I am looking to do the same and am wondering if the instructions is still the same? Or is there an updated list? I would like all the information in once place where I can just follow the steps to finish the integration off and move onto other tasks. :-d

Thanks,
-John
Schmakt
2009-03-16T02:36:40Z
John - I followed these instructions yesterday, and everything worked great.

I had a few issues making sure that users were logged into the forum and my webpage at the same time as well as making sure that new users were created in the forum when they were created in my application, but the post above by tejas7001 was huge in helping me find all the problems.

I'm still very very new at this, but if you run into any specific problems, I'm happy to try to help.
okiebug
2009-03-19T10:03:03Z
System.ApplicationException: Failed to get configuration from Web.config. at yaf.Config.get_configSection() at yaf.YafDBConnManager.InitConnection() at yaf.DB.ExecuteScalar(SqlCommand cmd) at yaf.DB.user_login(Object boardID, Object name, Object password)

I also have this problem. We have the forum running independent of the membership system on the site as a virtual app. under IIS.

Thanks in advance for all the sharing and tips.
hemisphere_1
2009-04-08T03:20:06Z
Dim userID As Object = yaf.DB.user_login(1, UserName.Text, sPassword)

What is the meaning of yaf.DB??
please 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