Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeGetting StartedGetting StartedInstalling DNN ...Installing DNN ...table aspnet_UsersInRoles is no longer updatedtable aspnet_UsersInRoles is no longer updated
Previous
 
Next
New Post
5/16/2006 12:00 AM
 

Hi mibagict,

Sorry that I didn't explained the issue properly.

The code of dbo.aspnet_UsersInRoles_AddUsersToRoles SP is pre-4.0 version that was loaded from

Providers\DataProviders\SqlDataProvider\InstallRoles.sql .

As a part of 4.0.0 update DNN ran Providers\DataProviders\SqlDataProvider\04.00.00.SqlDataProvider script,

which has
ALTER PROCEDURE dbo.aspnet_UsersInRoles_AddUsersToRoles and
ALTER PROCEDURE dbo.aspnet_UsersInRoles_RemoveUsersFromRoles

with lines
DECLARE @tbNames table(Name nvarchar(256)  NOT NULL PRIMARY KEY)

Due to mismatch collation issue these ALTER PROCEDUREs failed, but DNN didn't show any warning for user(see DNNP-2596, incorrectly having status of withdrawn)
So the SPs are left out of date, and 4.0 code doesn't work with them. Again DNN doesn't report any error(see DNNP-2876  and my blog post - in particular DNNLibrary\Components\Security\Roles\RoleController.vb AddUserRole suggested change).

The steps to fix the SPs are the following:

1. Open  Providers\DataProviders\SqlDataProvider\04.00.00.SqlDataProvider script in any editor.

2. Add COLLATE DATABASE_DEFAULT  to DECLARE @tbNames table in both aspnet_UsersInRoles_AddUsersToRoles and aspnet_UsersInRoles_RemoveUsersFromRoles procedures to have
DECLARE @tbNames table(Name nvarchar(256) COLLATE DATABASE_DEFAULT NOT NULL PRIMARY KEY)

3. Copy the all ALTER PROCEDURE dbo.aspnet_UsersInRoles_AddUsersToRoles .
section to DNN Admin SQL page (or SQL Server MAnagement Studio)

4. Run ALTER PROCEDURE dbo.aspnet_UsersInRoles_AddUsersToRoles to apply changes to the database.

5. Repeat steps 3 and 4 for aspnet_UsersInRoles_RemoveUsersFromRoles

Let us know does it help.


Michael Freidgeim http://geekswithblogs.net/mnf
 
New Post
5/16/2006 4:48 AM
 
Good Morning Michael!

First, thank for your detailed explanation.

Your proceed works. Following additional information:

----------------------------------------------------------------------
1.) ALTER PROCEDURE
----------------------------------------------------------------------
I've run the ALTER PROCEDURE statement in DNN Admin SQL Page.

Because the MS SQL Query Analyzer parse the SQL-Source successfully, but by executing SQL Query Analyzer returns an Error Msg 208, Level 16, State 6. Invalid object name 'dbo.aspnet_UsersInRoles_RemoveUsersFromRoles' at the second last line with the 'RETURN(0)' statement.

In both, aspnet_UsersInRoles_AddUsersToRoles and aspnet_UsersInRoles_RemoveUsersFromRoles.
----------------------------------------------------------------------
2.) Check and use User / Role Management in DNN
----------------------------------------------------------------------
I've a blank DNN 4.0.3 installation. After check the "altered" SP's in the database, I've tried to add users in DNN. This fails.
First, you have to add manually the Portal Administrator Account to the Role Administrators in Table aspnet_UsersInRoles.

Step-by-Styp
- Lookup the RoleID for 'Administrators' from table aspnet_Roles.
- Next, lookup the UserID for admin (or another user which you want as admin) from table aspnet_Users.
- Now insert a new entry with this ID's in table aspnet_UsersInRoles.

After this, the User and Role Management in DNN works fine!

Short Test in DNN:
Go To: Admin --> Security Roles --> Select Role --> Manage Users in this Role

If you select the Administrator Role and there aren't any users in the lower half of the Module, the User / Role Management don't work.
----------------------------------------------------------------------
Thanks for your help Michael! This is a really hidden error in DNN! Now, I understand your Issue DNNP-2876 correct...

Greetings!

the bimper
 
Previous
 
Next
HomeHomeGetting StartedGetting StartedInstalling DNN ...Installing DNN ...table aspnet_UsersInRoles is no longer updatedtable aspnet_UsersInRoles is no longer updated


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out