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

HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsAuthenticationAuthentication1 User Account Across Muliple Child Portals1 User Account Across Muliple Child Portals
Previous
 
Next
New Post
3/18/2008 9:15 PM
 

Interesting question and solution guys.

There is another thread related to this one:  http://www.dotnetnuke.com/Community/Forums/tabid/795/forumid/-1/threadid/143210/scope/posts/Default.aspx.  You find the trigger (in the middle of the thread) to add UserID to table UserPortals table.  The trigger is tied to table Users and it handles both Insert and Update events.  However, it does not include code to assign users to Registered Users role like Ian has provided.  Combine Ian's code and the trigger in other thread as below:

-- =============================================
-- Author:  combine code from Fuji and Ian
-- Description: Trigger to add userid, portalid to UserPortals table
-- and assign user to Registered Users role. 
--WARINGING - This trigger affects all portals
-- =============================================
CREATE TRIGGER {databaseOwner}{objectQualifier}trig_User_Multiportal
   ON  Users
   AFTER INSERT, UPDATE
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
DECLARE @UserID int
    -- Insert statements for trigger here

--Get new userid from INSERTED table
SELECT @UserID = UserID FROM INSERTED

--add records to UserPortals table
INSERT INTO {databaseOwner}{objectQualifier}UserPortals
(
 UserId,
 PortalId
)
SELECT
 @UserId AS UserID,
 PortalId
FROM {databaseOwner}{objectQualifier}Portals
WHERE PortalID NOT IN (
SELECT PortalID
FROM {databaseOwner}{objectQualifier}UserPortals WHERE UserID = @UserID
)

--assign to Registered Users role
INSERT INTO UserRoles
(
UserId,
RoleId
)
Select @UserId AS UserID, RoleId
FROM {databaseOwner}{objectQualifier}Roles
WHERE RoleName = 'Registered Users'
AND RoleID NOT IN (
SELECT RoleID
FROM {databaseOwner}{objectQualifier}UserRoles
WHERE UserID = @UserID)

END

Notice the NOT IN clause was used to insure no duplicate records are added to table UserPortals and UserRoles.  To apply the trigger, login as Host account and go to Host -> SQL menu to execute the script. 

If you want to remove the triger, run the script below:

DROP TRIGGER {databaseOwner}{objectQualifier}trig_User_Multiportal

Have lots of fun with DNN.


Robert Tango
www.workcontrol.com
Custom Modules: UserManager|UserDirectory|UserImport|PortalSSO
 
New Post
4/14/2008 12:51 PM
 

Mike,

 Does the 01.00.04 Beta  fix this issue or it is different (specficially ACD-5737 - Auto Authentication Not Working On Multi-Portal Installs)?

Craig

 
New Post
4/14/2008 2:25 PM
 

In my testing auto-authentication has worked across child portalsbut if you would be willing to test it out and let me know if it fixes your problem I'd appreciate it.

 
New Post
4/14/2008 4:24 PM
 

Mike,

  Great I will test it out.  Hey does the newer 1.0.3 require a 4.8.X upgrade or should it work on any version that supported 1.0 AD Provider?

 
New Post
4/14/2008 4:26 PM
 

It'll work on any version from 4.6.2 and up.

EDIT: But the fix is in the 01.00.04 beta that's available on my personal site (http://dnn.gmss.org). I'm going to give it a week and if I don't hear of any breaking issues I'll submit it to the Release Tracker then.

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsAuthenticationAuthentication1 User Account Across Muliple Child Portals1 User Account Across Muliple Child Portals


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