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 1:47 AM
 

Mike,

Specs: 
    DNN 4.7
    AD 1.0
    with Many Portals on an Intranet

  I have been using the AD Auth Provider sucessfully for a long time now so many thanks - I only have one issue that I have yet resolved. I have many child portals with AD turned on for all of them (the different instances can be thought of as different groups, where a user might belong to 1 to many groups).  The only way I can grant  a user access to an instance of the portal, beyond the first instance,  is to add an entry for that user into the UserPortals table manually.

For my scenario is there a quick stored procedure change or something I can do to add the users to the instances(UserPortals table) automatically?

Thanks in advance.

PS All the instances are child instances - and the parent portal is not used to get around the child and parent cookie issue. Does that issue still exist?

PS2 Sorry if this a topic already covered but I did a search before posting and didnt find the answer.

 
New Post
3/18/2008 11:32 AM
 

Craig,

I have implemented a version of this in the past where upon registration a user is copied to all portals (as that was the business scenario). This was accomplished by a simple trigger that fired through the course of the registration process. If you are comfortable creating this on your own I would suggest doing so, as it is technically a modification of the core registration process, and it's best to know exactly what you've changed and how it works!

Let me know what you think and if this sounds like an approach you would be interested in.

Take care,

Ian


Software Engineer
Co-Founder, dnnGallery
Stack Overflow: Ian Robinson
Twitter: @irobinson
Linked In: Ian Robinson
 
New Post
3/18/2008 11:54 AM
 

Hi Craig

Yes the issue with child portals still remains. In my testing if a user manually logs in once they'll be automatically logged in in the future but that's really only a work around and not a solution. I've got a couple of ideas on what will fix it but haven't had time to test them. I've got a couple of time sensitive projects on the go at the moment but will be going back to the AD provider as soon as I've got them done (along with bug fixes for the OpenID/LiveID providers).

In the meantime, it sounds like Ian may have a potential solution. Ian, if you would be willing to share your changes could you email me (mhorton@telus.net) with the changes you did.

 
New Post
3/18/2008 12:17 PM
 

Ian,

The trigger sounds like a good solution for now. If you are willing to post what you have that would be great. 

My only issue is that I will probably need to modify it because the site has been live for three years and new instances will be created in the future so I have to take it beyond just registration.

Mike, Thanks for the information and continued support for this important functionality.

 
New Post
3/18/2008 6:09 PM
 

Craig,

I'll be the first to say it -- this solution is by no means ideal. I have only used it in a casual scenario, so please evaluate for your purposes and please be careful when implementing.

ALTER TRIGGER trgInsUserPortals
on {objectQualifier}userprofile
AFTER Insert
AS
 
BEGIN

--the purpose of this trigger is to insert a row for every portal into the user_portals table when the user is created
--the problem with firing this trigger after inserting a user role was that it kept bringing back the wrong UserID because
--of (probably) some mixed up identity selection which i wasn't able to figure out (quickly).

--so the quick fix solution was to move this to to the UserProfile table and fire it there.  the userprofile table gets inserted into as
--a part of the registration process...and obviously other places as well....so I altered the logic of the stored procedure to
--essentially just insert a role into the userportals table for every portal that wasn't already in there for that user.....

--the downside to this (as i alluded to above) is that the thing will run more often that it needs to, and not exclusively on
--user creation, but...it works..........for now (dnn 4.8.0)

--also not a big fan of cursors ...but if it works...

DECLARE @userID as int
SELECT @userID = (SELECT userID from inserted)

CREATE TABLE #tblHoldPortals (
[portalID] [int])

declare @portalID int
 
Insert into #tblHoldPortals
Select portalID from {objectQualifier}portals
where portalID not in (select portalid from {objectQualifier}userportals where userid = @userID)
 
declare @p as int
declare @count as int
 
declare curPortal cursor for
select [portalID] from #tblHoldPortals
 
 
open curPortal

fetch next from curPortal
into @p
 
while @@fetch_status = 0
begin
set @portalID = @p
set @count = (select count(*) from [dbo].[{objectQualifier}UserPortals] where
PortalId = @p
and userID = @userID)
 
If @count = 0
Begin
INSERT INTO {objectQualifier}UserPortals (
            UserID,
            PortalID,
            Authorised
)
VALUES (
        @userID,
        @p,
        1
        )


DECLARE @roleID as int
set @roleID = (Select roleID from {objectQualifier}roles where portalID = @p
and
rolename = 'Registered Users')
EXEC [dbo].{objectQualifier}AddUserRole @p, @userID, @roleID
 


End
else
 
Begin
fetch next from curPortal
into @p
End

end

close curPortal
deallocate curPortal

drop table #tblHoldPortals

end


Software Engineer
Co-Founder, dnnGallery
Stack Overflow: Ian Robinson
Twitter: @irobinson
Linked In: Ian Robinson
 
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