YAFLogo

wbd
  • wbd
  • 52.4% (Neutral)
  • YAF Forumling Topic Starter
15 years ago
I've got YAF 1.9.3 installed as a subfolder within my existing site and configured to use the existing membership/role/profile SQL providers. Membership and profiles seem to be working great, but when a new user account is created, I call Roles.AddUserToRole(newUserName, "Registered") and notice that the SQL roles provider correctly adds the new user to the Registered role whereas YAF does not.

YAF has a role called Registered and the admin screen indicates that it is linked. I can manually add users to the Registered role frm the YAF admin panel, a row is inserted into yaf_prov_RoleMembership, but otherwise yaf_prov_RoleMembership would be empty.

Here's my provider config:

<membership defaultProvider="SqlProvider" userIsOnlineTimeWindow="15">
	<providers>
		<clear/>
		<add name="SqlProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="SqlConnectionString" applicationName="MyApp" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="true" passwordFormat="Hashed" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0"/>
	</providers>
</membership>

<roleManager defaultProvider="AspNetSqlRoleProvider" enabled="true">
	<providers>
		<clear/>
		<add name="AspNetSqlRoleProvider" connectionStringName="SqlConnectionString" applicationName="MyApp"  type="System.Web.Security.SqlRoleProvider"/>				
	</providers>
</roleManager>

<profile enabled="true" defaultProvider="SQLProfileProvider" inherits="YAF.Classes.Utils.YafUserProfile">
	<providers>
		<clear/>
		<add connectionStringName="SqlConnectionString" applicationName="MyApp" type="System.Web.Profile.SqlProfileProvider" name="SQLProfileProvider"/>
	</providers>
</profile>

Anyone have any ideas? Any other information I could provide to help troubleshoot this? I've read around and know that some folks have 1.9.3 working with existing membership providers, so I can't be too far off here...

Thanks in advance.
Sponsor

wbd
  • wbd
  • 52.4% (Neutral)
  • YAF Forumling Topic Starter
15 years ago
Anyone?

EVERYTHING is working great except for roles. I can't be that far off the mark...
Jaben
  • Jaben
  • 100% (Exalted)
  • YAF Developer
15 years ago
Sort of, kind of, a bug.

Not sure the best way to fix this issue. Right now YAF has to sync role information with it's own DB. That will be changed in future versions... but I have to completely redesign the entire DB, so don't hold your breath for that.

What you are doing is programmically adding a role for a user...

The roles are synced auto when a user logs in.

I could manually add a sync to the "User Details" admin section. Then, at least, the admin could see the changes.

Too much DB time to add a sync to the profile view... and too much to add a manual sync for ALL users.

It's too bad providers don't have some hook or event that YAF can tap into so it can sync properly as things are changed... unless there is something I don't know about.
YAF Logo Copyright © YetAnotherForum.NET & Ingo Herbote. All rights reserved
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