Recently Viewed...
DNN Modules
SnowCovered Top Sellers

The Catalyst skins are professionally designed, coded and packaged by a team of DotNetNuke experts. The skins are available in 12 great colours. This skin is easily customisable with our unique DrNuke EasyMod technology. Try our demo!

Version 5 of the perennial best-selling tool for creating data-based solutions in DNN without custom programming. This version focuses on greater flexibility, expandability, and ease-of-use.

Live Content uses Web 2.0 approach to provide a Rich User Interface and streamlines content presentation by overlaying content on current page. Overlay images, videos, audio, text/html content, flash, dotnetnuke modules, and external content. Experience the demo...

Ultra Video Gallery is a brother product of Ultra Media Gallery, UVG allows you to add videos in various format and automatically convert them to flv format, you also can add videos from embed code and play them in our integrated flash video player.

'Relationship Building' and 'Communication' are two essential nuts and bolts for a business to prosper. This module allows you to bridge both of these and easily generate continuous awareness of your web site, products and services. Your prospects and customers will greatly appreciate this featur

In this day and age, knowing as much detailed information as possible about your customer, prospect or web site user is essential. Thankfully, the new 'Dynamics Forms' module from Data Springs, makes it easier than ever to segment your data collection efforts.

Capture your users attention, enrich your site with multimedia flash, and create and opt in distribution list for your DNN site. These are just a few of the many features the Data Springs Module Collection can provide you.

Ultra Media Gallery is the most popular photo gallery and media gallery solution for DotNetNuke, UMG offers 10 different flash player to browse your gallery with completely different user interface experience.

Edit documents directly on your server. The premier document management solution for DotNetNuke (DNN). Index contents of documents. Share documents across your portal and avoid duplicates. Revised and flexible UI. Extensible architecture.

ALL NEW ! - Minimalist includes skin packs in 12 great colors. Each color has Flat, Gradient and Glass versions. Feature rich XML Flash header, perfect for just about any purpose. 9 Different menu options in each skin pack; 3 horizontal menus, 3 vertical menus and 3 all-new Twin level menus . . .

    |   Register   |   Friday, November 21, 2008   
Data Springs Product Forums...
Subject: add and remove role ?
Prev Next
You are not authorized to post a reply.

Author Messages
Bamse
Posts:70
river guide
river guide

03/31/2008 6:23 AM  
I would like to remove one role and add another role. So on submission a role Is added and another role is removed independent on the response given. How can I do this?
Chad
Posts:2207
river guide
river guide

03/31/2008 12:22 PM  
Hi. Well you can setup as few or as many 'Role Completion Events' as you would like and these role completion events can either be fired off for any field response or fired off conditionally based on the users response (such other completion events are such as Email, SQL, etc...). If you need more defined logic then a simple 'yes' or 'no' based on a users response you would have to use the SQL Event and add or remove the user from the UserRoles table directly.

-Chad
Bamse
Posts:70
river guide
river guide

04/01/2008 1:43 AM  
Thx, so I have a checkbox. When that is "checked" I add a completion event to add the user to a role and it works. But remove role when for the same condition? When the checkbox is checked I also want to remove a role. Do I need to use a sql script if so how is does it look like?
Bamse
Posts:70
river guide
river guide

04/01/2008 1:50 AM  
Hmm thinking about this again. I have another form where on submission a role should be removed from the user independent on what response is given. I can’t find a “remove role” button in the preconfigured events like the “add role” function. Or am I blind? :-)
Bamse
Posts:70
river guide
river guide

04/02/2008 7:16 AM  

Can it be done?

Put DR with hidden username and 2* password on a page, so the user only see a "submit" button. When a logged in user press "submit" the form removes a role from the user. ?

Chad
Posts:2207
river guide
river guide

04/04/2008 7:58 AM  
Hi. Well the way the DNN User Role event works is either the user is added to the role or removed from the security role based on the users response. So for example, if you had a checkbox 'Would you like to be added to the ABC role?' and a completion event to add the user to this role if the box is checked, after submission the event will execute and the user will either be added to the security role if the field is checked, or, they will be removed from the security role if the box is not checked. This is how the event was supposed to fire, in the future we could potentially add more features in this area that would allow you to maybe operate as its working now or potentially 'Only add the user to this role, do not remove them if the condition does not match' or 'only remove the user to this, do not add them to the role if the condition does not match etc...'.

For now, if you need the DNN User Role Completion event to work differently than described above you would need to use a SQL Event to maybe manually remove the user from that role or manually add the user to that role. I can assist in providing the SQL queries if you need them? For example the removal would be something like this:

Delete From UserRoles
Where UserID = $(UserID)
and RoleID = 5

This would remove the current user from the security role that has a roleID of 5.

-Chad
Bamse
Posts:70
river guide
river guide

04/04/2008 8:31 AM  
Ok yes it works, the thing that got me confused was that I wanted to hide the checkbox to the user. But this can of course be done from the options in the checkbox settings, I missed this one…
Thx
Chad
Posts:2207
river guide
river guide

04/04/2008 8:36 AM  
Hi. Well if you to hide the checkbox you would probably need to use the 'hidden' field and not the 'hide fields by role'. When a standard field is hidden (by role) it is never rendered so the completion event will not fire based on it. You could create a 'hidden field' from the hidden field type though and create an event based on that.

-Chad
Bamse
Posts:70
river guide
river guide

04/04/2008 8:46 AM  
Yes! First I tried 'hide fields by role' set to 'registered users' and it worked.
Also tried setting the ‘User Role Completion event’ to a 'hidden' field also and it also worked.

Super flexibility :-)
vr1001
Posts:12
wading in the water
wading in the water

04/05/2008 4:53 AM  
Hi Chad and Bamse,

I have a similar but slightly different requirement. I ned your help. Please help me. I am helping a local youth group in 'selecting' their office bearers. It is like an 'election' with a difference. There are about 200 members in the group. Each member can nominate upto 3 other members for a Position. (as opposed to voting for a candidate among a pre-selected candidates of 4 or 5).

Here is what I did so far:
** I am using DNN 4.8.2 and Dynamic Registration. I do have the full suite of Collection (v1.8) **

1. We have an portal (DNN 4.3) currently being used to share information among these members. Since some of the members are the admins of that portal, I want to setup a new portal just for this poll. Preferably I want to use the existing user database from the old portal. Also I want to allow new members to register and vote on the new portal.

2. My Key Issues:
2.a: one vote per member: I want to make sure a member can vote only once.
2b: custom form for certain members: If a member belongs to a specific group, he / she will have to use a ballot / nomination form specific to that group.

3. What I did so far:
3.1: Any user can register at the new portal (portal is set for "verified" registration so that we will have a verified email address. This also helps me to relate to the existing user base on the old portal. The initial registration is DNN native registration

3.2: All Registered users will 'see' a Dynamic Registration form called Step1. There I am showing the first and last names from the DNN registration and asking for one additional info: the sub group the member belongs to. [there are about 10 sub groups and I created one DNN role for each sub-group]

3.3: Once a registered user submits the "Step1" form, I am using "Events" to add the user to a specific role based on the selection he / she makes on "Step1" form. If he/she selects "Sub Group 1" in the drop down list, I am adding him / her to "Sub Group 1" role and directing them to "Step 2" page. I have created about 10 other Registration Forms (one for each Sub Group) and placed under "Step 2" page menu. I have set permissions in a way that members can only see just one page (out of these 10 pages) based on the sub group they belong to. For example, if a member says he belongs to "Sub Group 5" and submits "Step 1" form, he can only see "Sub Group 5" form under "Step 2". If a member belongs to "Sub Group 7" and submits "Step 1" form, he will be presented "Step 2" page but he can only see "Sub Group 7" form under "Step 2" menu.

3.4: Automatic Role assignment is working fine (based on the selection made on Step 1 form). But that Role is not effective immediately when the user goes to Step 2. He has to log off and login again to see his relevant "Sub Group" page.

4: How to prevent the user from submitting Step 1 and Sub Group specific forms 2nd and subsequent times? They should be able to submit (cast their vote only once). I see there are some "States" a member goes thru and if we can manage this via roles or other means, that would be great:

State 1: Unregistered Member

State 2: Registered Member - not yet voted
[DNN Roles for this user would be
Registered Users = ON or Checked
Sub Group 1 thru Sub Group 10 = OFF or not checked]
Voted Users = OFF or Not Checked]

State 3: Registered Member - Sub Group assigned.
[DNN Roles for this user would be
Registered Users = ON or Checked
Sub Group 'n' = ON or checked [based on the user's selection on "Step 1" form, I want to do this role assignment.
Voted Users = OFF or Not Checked]

State 4: Registered Member - Voted
Hi Chad and Bamse,

I have a similar but slightly different requirement. I ned your help. Please help me. I am helping a local youth group in 'selecting' their office bearers. It is like an 'election' with a difference. There are about 200 members in the group. Each member can nominate upto 3 other members for a Position. (as opposed to voting for a candidate among a pre-selected candidates of 4 or 5).

Here is what I did so far:
** I am using DNN 4.8.2 and Dynamic Registration. I do have the full suite of Collection (v1.8) **

1. We have an portal (DNN 4.3) currently being used to share information among these members. Since some of the members are the admins of that portal, I want to setup a new portal just for this poll. Preferably I want to use the existing user database from the old portal. Also I want to allow new members to register and vote on the new portal.

2. My Key Issues:
2.a: one vote per member: I want to make sure a member can vote only once.
2b: custom form for certain members: If a member belongs to a specific group, he / she will have to use a ballot / nomination form specific to that group.

3. What I did so far:
3.1: Any user can register at the new portal (portal is set for "verified" registration so that we will have a verified email address. This also helps me to relate to the existing user base on the old portal. The initial registration is DNN native registration

3.2: All Registered users will 'see' a Dynamic Registration form called Step1. There I am showing the first and last names from the DNN registration and asking for one additional info: the sub group the member belongs to. [there are about 10 sub groups and I created one DNN role for each sub-group]

3.3: Once a registered user submits the "Step1" form, I am using "Events" to add the user to a specific role based on the selection he / she makes on "Step1" form. If he/she selects "Sub Group 1" in the drop down list, I am adding him / her to "Sub Group 1" role and directing them to "Step 2" page. I have created about 10 other Registration Forms (one for each Sub Group) and placed under "Step 2" page menu. I have set permissions in a way that members can only see just one page (out of these 10 pages) based on the sub group they belong to. For example, if a member says he belongs to "Sub Group 5" and submits "Step 1" form, he can only see "Sub Group 5" form under "Step 2". If a member belongs to "Sub Group 7" and submits "Step 1" form, he will be presented "Step 2" page but he can only see "Sub Group 7" form under "Step 2" menu.

3.4: Automatic Role assignment is working fine (based on the selection made on Step 1 form). But that Role is not effective immediately when the user goes to Step 2. He has to log off and login again to see his relevant "Sub Group" page.

4: How to prevent the user from submitting Step 1 and Sub Group specific forms 2nd and subsequent times? They should be able to submit (cast their vote only once). I see there are some "States" a member goes thru and if we can manage this via roles or other means, that would be great:

State 1: Unregistered Member

State 2: Registered Member - not yet voted
[DNN Roles for this user would be
Registered Users = ON or Checked
Sub Group 1 thru Sub Group 10 = OFF or not checked]
Voted Users = OFF or Not Checked]

State 3: Registered Member - Sub Group assigned.
[DNN Roles for this user would be
Registered Users = ON or Checked
Sub Group 'n' = ON or checked (based on the user's selection on "Step 1" form, I want to do this role assignment.)
Voted User= OFF or unchecked]


State 4: Registered Member - Voted already
[DNN Roles for this user would be
Registered Users = ON or Checked
Sub Group 'n' = ON or checked (based on the user's selection on "Step 1" form, I want to do this role assignment.)
Voted Users = ON or Checked (once the user submits the main nomination form in Step 2 using his "Sub Group specific Nomination Form", the voting is considered complete.

All people start at State 1.
When they login for the first time

Only members in State 2 should be able to view and submit Form "Step 1" where they will indicate their "Sub-Group". And they are moved to "State 3"

Only members in "State 3" are eligible to vote on their "Sub Group specific form". Once they vote, they will be moved to "State 4".

Once a member is in "State 4", he should not be able to access "any" page except the Home Page (thus preventing from voting again)

Here is the help I need:

How to accomplish the steps listed above? Or is there an easy way to implement the whole voting process in a better way?

I need to release this voting form before Noon today. Please help me!

Best Regards,
VR
Grant
Posts:11
wading in the water
wading in the water

06/30/2008 11:27 AM  

Given that you may not know the roleid, but will be guaranteed to know the Role Name.  Try this:

DELETE u
FROM userroles u
INNER JOIN roles r
ON u.roleid = r.roleid
WHERE userid=$(UserID) AND
rolename LIKE 'Validate Profile'

You are not authorized to post a reply.



ActiveForums 3.7

Copyright 2005 - 2008 by Data Springs, Inc.
Terms Of Use | Privacy Statement