Great Ideas. Always Flowing.

We are not happy until you are happy. Client satisfaction guaranteed. Whatever your needs and requirements, we have the skills and resources for the job!

Quick login...


Or... now make it easy with Facebook Integration
Connect via Facebook



Top Sellers

Frustrated over the lack of customization for your user's registration fields? Dynamically setup your DNN Portal with custom registration fields, layout, questions, and other core integration options......

Ultra Video Gallery is a brother product of Ultra Media Gallery, UVG allows you to upload videos in various format and automatically encode them to flv or H264 format, you also can add videos from internet or record live videos from your webcam.

Build high performance, completely customizable data-entry forms and views driven by your DNN and external databases. New built-in tools make it a snap to quickly create data entry forms, data views, and even database tables. Plus, add your own HTML, CSS, Javascript, SQL commands, stored procedures,

The most advanced DotNetNuke shopping cart on the planet. Easy to use e-Commerce, Secure Shopping Cart Software and SEO friendly. B2C / B2B Ecommerce Sites.

One stop solution for events calendar and events registration! FREE DOWNLOAD is available now!

Userroles and Authorized Users
Last Post 12-13-2011 10:53 AM by jeremyclose. 9 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages Not Resolved
jeremycloseUser is Offline
skipping stones
skipping stones
Posts:8
Avatar

--
11-10-2011 05:18 AM
    I am having trouble with 2 things.

    1. I have used the [userroles] token and would like to exclude certain roles from the display, is this possible? Also, it would be nice if each role was placed in a div or a span in order to allow more display freedom.

    2. I checked the Authorized Users Only option, but it is still displaying Unauthorized users. I have re-run the DUD indexer (or whatever it's called) multiple times and restarted the application.


    Using DNN 6.1.0 and DUD 4.0.1

    Some assistance with this would be great.
    Thanks,
    Jeremy
    Don GeeUser is Offline
    river guide
    river guide
    Posts:273
    Avatar

    --
    11-11-2011 12:25 PM
    Hi Jeremy,
    Try this for your second problem. Go to Admin>User Accounts and set an authorized user as un-authorized and then in Dynamic User Directory (DUD) go to that user and you will probably see that he still shows up even when you check the "Authorized Users Only" option in DUD. What you will have to do is go to Host>Scheduler and run the scheduler for DUD. If yo do this your un-authorized user will now NOT show up. When you posted the question I think you were dealing with a new user that was set as Un-Authorized and the scheduler hadn't had time to fire and filter him from the list.

    For your second issue in module configurations there is also a setting to include/exclude users by role. Some of what you want to do here may be done by setting up a sample on www.betasprings.com (login is host/dnnhost) and then we can look at what you are doing to make corrections. If you put your sample there under the area for Dynamic User Directories. Let me know the link and we can work on it.
    Thanks
    jeremycloseUser is Offline
    skipping stones
    skipping stones
    Posts:8
    Avatar

    --
    11-15-2011 11:39 AM
    Thank you for the response.

    I have tried running the DUD in the scheduler, both before the original post, since and after. I have tried un-authorizing and authorizing users and re-running the DUD schedule item. I can't seem to get the un-authorized users from showing.

    I am using the include aspect of the module, and for general listing and who is included, it works fine. But the part I am interested in, is using the [userroles] token. When using this token, is it possible to exclude certain roles from the list?

    Example:
    UserA is a member of Role A, Role B, Registered User, Administrator
    I can set the module to Include Role A and Role B in the display, but then the [userroles] token will display that they are in the Role A, Role B, Registered User, Administrator roles. is it possible to only display the roles that are included in the config (Role A and Role B in this example)?


    Thanks,
    Jeremy
    Chad NashUser is Offline
    Posts:5260
    Avatar

    --
    11-17-2011 10:43 AM
    Hi Jeremy,

    There are a few stored procedures that determine/check this and maybe something has changed in the latest 6.1 release. So you might open up a support ticket and I can review the stored procedure issue there...

    As far as the UserRoles requests... This is a hard coded function that the module uses so you could modify it. I have at least included the function that is generating it now so you can see how you might be able to drop the object/recreate or alter the object so that it works. You could easily add to the where clause to exclude certain role ID's, or you could easily modify how its returned instead of just the line break BR tags.

    CREATE FUNCTION {databaseOwner}[{objectQualifier}DataSprings_DUD_GetUserRoles] (@UserID int)
    RETURNS nvarchar(2000)
    AS
    BEGIN
    Declare @UserRoles nvarchar(2000)
    declare @RoleName nvarchar(500)
    declare RoleList cursor for
    Select B.RoleName from {databaseOwner}[{objectQualifier}Userroles] A Inner Join {databaseOwner}[{objectQualifier}Roles] B on A.RoleID = B.RoleID
    Where (UserID = @UserID) AND (ExpiryDate >= GetDate() OR ExpiryDate Is Null) AND (EffectiveDate <= GetDate() OR EffectiveDate Is Null)
    OPEN RoleList
    FETCH NEXT FROM RoleList
    INTO @RoleName
    Set @UserRoles = ''
    WHILE @@FETCH_STATUS = 0
    BEGIN
    set @UserRoles = @UserRoles + @RoleName + '
    '
    FETCH NEXT FROM RoleList INTO @RoleName
    END
    CLOSE RoleList
    DEALLOCATE RoleList

    Return @UserRoles
    END



    -Chad
    Chad NashUser is Offline
    Posts:5260
    Avatar

    --
    11-17-2011 10:45 AM
    Here is the query (its fun ) that is used for for when a user is authorized/unauthorized. Its possible this needs to be changed from version 6.1 possibly... At different times we had to add in different versions because DNN changed their database structure so maybe it changed again?

    CREATE Procedure {databaseOwner}[{objectQualifier}DataSprings_RetrieveDNNUserProfileData3]
    (@PortalID int,@RoleFilter nvarchar(1000),@LimitResults nvarchar(100),@Authonly int,@Filter nvarchar(4000), @ORDERBY nvarchar(1000))


    AS

    BEGIN


    if exists(select top 1 * from sysobjects where xtype = 'U' and name = 'tempDUDProfile') and (@PortalID = 999)
    begin
    drop table {databaseOwner}tempDUDProfile
    end

    if exists(select top 1 * from sysobjects where xtype = 'U' and name = 'tempDUDPivot') and (@PortalID = 999)
    begin
    drop table {databaseOwner}tempDUDPivot
    end

    -- generate tempDUDProfile table
    -- create table tempDUDProfile if not exists
    If not exists(select top 1 * from sysobjects where xtype = 'U' and name = 'tempDUDProfile')
    BEGIN

    select U.userid,U.username,U.firstname,U.lastname,U.email,U.Displayname,UP.propertyvalue,
    P.propertyname, P.PortalID into {databaseOwner}tempDUDProfile

    from {databaseOwner}[{objectQualifier}Users] U inner join {databaseOwner}[{objectQualifier}userprofile] UP on U.userid = UP.userid
    inner join {databaseOwner}[{objectQualifier}profilepropertydefinition] P on UP.propertydefinitionid = P.propertydefinitionid

    --where U.userid In (Select userid from {databaseOwner}[{objectQualifier}UserPortals] where PortalID = Convert(varchar(3), @PortalID))

    where P.Visible=1
    --AND P.PortalID = @PortalID
    AND P.Deleted=0
    AND P.PRopertyName <> 'FirstName'
    AND P.PropertyName <> 'LastName'
    AND P.PRopertyNAme <> 'E-Mail'
    AND P.PRopertyNAme <> 'Email'
    AND P.PRopertyNAme <> 'Username'
    AND P.PRopertyNAme <> 'Displayname'

    AND P.PropertyName Not Like '%[.#)(&[@!^!]]%' ESCAPE '!'

    exec {databaseOwner}[{objectQualifier}DataSprings_RetrieveDNNUserProfileData3a]

    END



    If (@PortalID <> 999)
    BEGIN
    Declare @MySQL nvarchar(max)
    -- check if DNN version is 5.0 or higher
    if exists (select * from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME like '%userportals%' and COLUMN_NAME = 'IsDeleted')
    and exists (select top 1 * from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME like '%users' and COLUMN_NAME = 'IsDeleted')
    BEGIN
    Set @MySQL = 'select ' + @LimitResults + ' A.*, {databaseOwner}{objectQualifier}DataSprings_DUD_GetUserRoles(A.UserID) AS UserRoles from {databaseOwner}tempDUDPivot AS A' + '
    inner join aspnet_users AS B on B.username = A.username
    inner join aspnet_membership C on B.userid = C.userid '
    + replace(@Filter,'[','A.[')
    + replace(@RoleFilter,'[','A.[')
    + ' AND ((C.IsApproved = 1) OR (' + Cast(@AuthOnly as varchar(2)) + ' = 0))'
    + ' AND A.PortalID = ' + cast(@PortalID as varchar(3))
    + ' AND A.userid not in (select userid from {databaseOwner}[{objectQualifier}users] where issuperuser = 1 and isdeleted = 1)
    AND A.userid not in (select userid from {databaseOwner}[{objectQualifier}userportals] where isdeleted = 1 AND portalID = '
    + cast(@PortalID as varchar(3)) + ')'
    + ' AND (A.userid not in (select userid from {databaseOwner}[{objectQualifier}userportals] where Authorised = 0 AND portalID = '
    + cast(@PortalID as varchar(3)) + ') OR (' + Cast(@AuthOnly as varchar(2)) + ' = 0))'
    + @ORDERBY
    EXECUTE(@MySQL)
    END
    else
    if exists (select * from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME like '%userportals%' and COLUMN_NAME = 'IsDeleted')
    and not exists (select top 1 * from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME like '%users' and COLUMN_NAME = 'IsDeleted')
    BEGIN
    Set @MySQL = 'select ' + @LimitResults + ' A.*, {databaseOwner}{objectQualifier}DataSprings_DUD_GetUserRoles(A.UserID) AS UserRoles from {databaseOwner}tempDUDPivot AS A' + '
    inner join aspnet_users AS B on B.username = A.username
    inner join aspnet_membership C on B.userid = C.userid '
    + replace(@Filter,'[','A.[')
    + replace(@RoleFilter,'[','A.[')
    + ' AND ((C.IsApproved = 1) OR (' + Cast(@AuthOnly as varchar(2)) + ' = 0))'
    + ' AND A.PortalID = ' + cast(@PortalID as varchar(3))
    + ' AND A.userid not in (select userid from {databaseOwner}[{objectQualifier}userportals] where isdeleted = 1 AND portalID = '
    + cast(@PortalID as varchar(3)) + ')'
    + ' AND (A.userid not in (select userid from {databaseOwner}[{objectQualifier}userportals] where Authorised = 0 AND portalID = '
    + cast(@PortalID as varchar(3)) + ') OR (' + Cast(@AuthOnly as varchar(2)) + ' = 0))'

    + @ORDERBY
    EXECUTE(@MySQL)
    END
    else
    -- if DNN version is lower than 5.0
    BEGIN
    Set @MySQL = 'select ' + @LimitResults + ' A.*, {databaseOwner}{objectQualifier}DataSprings_DUD_GetUserRoles(A.UserID) AS UserRoles from {databaseOwner}tempDUDPivot AS A' + '
    inner join aspnet_users AS B on B.username = A.username
    inner join aspnet_membership C on B.userid = C.userid '
    + replace(@Filter,'[','A.[')
    + replace(@RoleFilter,'[','A.[')
    + ' AND ((C.IsApproved = 1) OR (' + Cast(@AuthOnly as varchar(2)) + ' = 0))'
    + ' AND A.PortalID = ' + cast(@PortalID as varchar(3)) +''
    + @ORDERBY
    EXECUTE(@MySQL)
    END
    --PRINT(@MySQL)
    END

    END

    GO
    jeremycloseUser is Offline
    skipping stones
    skipping stones
    Posts:8
    Avatar

    --
    11-30-2011 09:44 AM
    Ok, both of those are crazy and impressive functions. I barely understand the first one and can't even begin to understand the second. I would like to edit the first one as you suggested, where would I go about doing that?

    The second one for authorized users is way beyond me. What would have to be done to get it to work properly?

    Thanks,
    Jeremy
    jeremycloseUser is Offline
    skipping stones
    skipping stones
    Posts:8
    Avatar

    --
    12-06-2011 04:16 AM
    I am mainly interested in where I can find the Roles script to edit it. I can find a way around the Authorized not working properly. Any help on where I can edit the roles script?

    Thanks,
    Jeremy
    jeremycloseUser is Offline
    skipping stones
    skipping stones
    Posts:8
    Avatar

    --
    12-12-2011 11:07 AM
    Chad,

    I would really like to modify the UserRoles Query so that it does not list the two standard roles, but I can not find where this can be edited. Could you let me know where this is or what the process is to modify it? The function does not look like that much of a challenge to adjust, but I don't know where to find it.

    Thanks,
    Jeremy
    Chad NashUser is Offline
    Posts:5260
    Avatar

    --
    12-12-2011 11:46 AM
    Hi Jeremy,

    Thanks for your post... I actually think the details are posted above, I think this is the function call (not a stored procedure but rather a TSQL Function) that is this:

    DataSprings_DUD_GetUserRoles


    if you type this in under Host/SQL what comes up?

    sp_helptext "DataSprings_DUD_GetUserRoles"

    Thanks,

    Chad
    jeremycloseUser is Offline
    skipping stones
    skipping stones
    Posts:8
    Avatar

    --
    12-13-2011 10:53 AM
    Chad,

    Thanks for this. I am learning a lot about SQL by diving into this. I was only marginally competent in Access before getting into DNN. So I have tracked down this TSQL Function and changed the WHERE clause to look like this:

    Where (UserID = @UserID) AND (ExpiryDate >= GetDate() OR ExpiryDate Is Null) AND (EffectiveDate <= GetDate() OR EffectiveDate Is Null) AND B.RoleName <> 'Registered Users' AND B.RoleName <> 'Subscribers'

    I think this is what it should be, but I can't seem to get the DUD Module to reflect that I have made any changes to this function (I also changed the BR between the roles to the roles being in SPANs, and that doesn't reflect either).

    I have tried restarting the application, clearing the cache, running the DUD schedule item, restarting and clearing again and it still isn't showing.

    Any idea what I can do to get this change to show?

    Thanks for all the help,
    Jeremy
    You are not authorized to post a reply.


     
     

    Join our mailing list...

    Get current news and events the easy way
     
     
       
    Subscribe Me

    Recent Blogs...

     
    Copyright 2005 - 2011 by Data Springs, Inc.
     
  • film izle
  • 720 izle
  • film
  • sinema izle
  • film makinesi
  • T�rk�e dublaj film
  • film izle
  • film izle
  • baglan film izle
  • sinema izle
  • 1080 film izle
  • film mercegi