Food-Ecom Login
Report Requests
Useful Links
CBW Webmail
[allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => [ref] => [htmlstate] => on_nl2br [postusername] => jlavetan [ip] => webforumsuser@m [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 1 [islastshown] => [isfirstshown] => 1 [attachments] => [allattachments] => ) --> CBW Webmail
The current user has no access to Webmail
[allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => [ref] => [htmlstate] => on_nl2br [postusername] => mxstu [ip] => webforumsuser@m [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 2 [islastshown] => [isfirstshown] => [attachments] => [allattachments] => ) --> Food-Ecom Login
Report Requests
Useful Links
CBW Webmail
The current user has no access to Webmail
[allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => [ref] => [htmlstate] => on_nl2br [postusername] => jlavetan [ip] => webforumsuser@m [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 3 [islastshown] => [isfirstshown] => [attachments] => [allattachments] => ) --> Food-Ecom Login
Report Requests
Useful Links
CBW Webmail
[allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => [ref] => [htmlstate] => on_nl2br [postusername] => mxstu [ip] => webforumsuser@m [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 6 [islastshown] => [isfirstshown] => [attachments] => [allattachments] => ) --> Food-Ecom Login
Report Requests
Useful Links
CBW Webmail
[allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => [ref] => [htmlstate] => on_nl2br [postusername] => jlavetan [ip] => webforumsuser@m [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 11 [islastshown] => 1 [isfirstshown] => [attachments] => [allattachments] => ) --> Selecting users that are in multiple groups - Macromedia ColdFusion

Selecting users that are in multiple groups - Macromedia ColdFusion

I am very new to ColdFusion and am having a light issue trying to select users that are in multiple groups... Basically, I want the sales people that are in the Sales group and the Customer group to have access to a webmail link. Users in the Customers group won't have the link displayed. <!--- only show the reports and ecom links to the customers group ---> <!--- <cfif ListFind(ValueList(getGroups.groupID), 4)> ---> <cfif getGroups.groupID gte 4> <a href="http://LINK_HERE/"><b>Food-Ecom Login</b></a><br> <a href="/secure/requests.cfm"><b>Report Requests</b></a><br> <a href="/links.cfm"><b>Useful Links</b></a><br> <!--- only show the webmail link to the sales group ---> <cfelseif getGroups.groupID gte 3> ...

  1. #1

    Default Selecting users that are in multiple groups

    I am very new to ColdFusion and am having a light issue trying to select users
    that are in multiple groups...

    Basically, I want the sales people that are in the Sales group and the
    Customer group to have access to a webmail link. Users in the Customers group
    won't have the link displayed.



    <!--- only show the reports and ecom links to the customers group --->
    <!--- <cfif ListFind(ValueList(getGroups.groupID), 4)> --->
    <cfif getGroups.groupID gte 4>
    <a href="http://LINK_HERE/"><b>Food-Ecom Login</b></a><br>
    <a href="/secure/requests.cfm"><b>Report Requests</b></a><br>
    <a href="/links.cfm"><b>Useful Links</b></a><br>

    <!--- only show the webmail link to the sales group --->
    <cfelseif getGroups.groupID gte 3>
    <a href="http://WEBMAIL_LINK/"><b>CBW Webmail</b></a><br>
    </cfif>

    jlavetan Guest

  2. #2

    Default Re: Selecting users that are in multiple groups

    If I'm understanding you correctly, you have a list of groups that the current
    user is a member of. If the current user belongs to both the "sales" and
    "customer" group, you to want to display a "web mail" link. Otherwise, you want
    to display nothing.

    If so, one method would be to use the ListFind() method:



    <cfset salesGroupID = 3>
    <cfset customerGroupID = 4>
    <cfset memberOfGroups = "1,3,4">

    <!--- Link is displayed because user belongs to both sales and customer groups
    --->
    <cfif ListFind(memberOfGroups, salesGroupID) GT 0 AND
    ListFind(memberOfGroups, customerGroupID) GT 0>
    <a href="http://WEBMAIL_LINK/"><b>CBW Webmail</b></a><br>
    <cfelse>
    The current user has no access to Webmail
    </cfif>

    mxstu Guest

  3. #3

    Default Re: Selecting users that are in multiple groups

    Ok, that works... except that both groups have access to the webmail link...
    How can I make it so:

    If user is a member of both customer and sales group then display Link 1
    If user is a member of customer group only then display Link 2



    <cfset salesGroupID = 3>
    <cfset customerGroupID = 4>
    <cfset memberOfGroups = "1,3,4">

    <!--- only show the reports and ecom links to the customers group --->
    <cfif ListFind(memberOfGroups, customerGroupID) GT 0>
    <a href="http://LINK.com/"><b>Food-Ecom Login</b></a><br>
    <a href="/secure/requests.cfm"><b>Report Requests</b></a><br>
    <a href="/links.cfm"><b>Useful Links</b></a><br>
    </cfif>
    <!--- Link is displayed because user belongs to both sales and customer
    groups --->
    <cfif ListFind(memberOfGroups, salesGroupID) GT 0 AND
    ListFind(memberOfGroups, customerGroupID) GT 0>
    <a href="http://WEBMAIL LINK/"><b>CBW Webmail</b></a><br>
    <cfelse>
    The current user has no access to Webmail
    </cfif>

    jlavetan Guest

  4. #4

    Default Re: Selecting users that are in multiple groups

    <cfif ListFind(memberOfGroups, customerGroupID) GT 0>
    <cfif ListFind(memberOfGroups, salesGroupID) GT 0>
    Member of "customer" and "sales" group - Display Link 1
    <cfelse>
    Member of "customer" group only - Display Link 2
    </cfif>
    </cfif>


    mxstu Guest

  5. #5

    Default Re: Selecting users that are in multiple groups

    My test user who is in the Customer group only can still see the link...



    <cfset salesGroupID = 3>
    <cfset customerGroupID = 4>
    <cfset memberOfGroups = "1,3,4">

    <cfif ListFind(memberOfGroups, salesGroupID) GT 0>
    <cfif ListFind(memberOfGroups, customerGroupID) GT 0>
    <a href="http://ecom.cooperbooth.com/"><b>Food-Ecom Login</b></a><br>
    <a href="/secure/requests.cfm"><b>Report Requests</b></a><br>
    <a href="/links.cfm"><b>Useful Links</b></a><br>
    <a href="http://208.17.69.11:8080/"><b>CBW Webmail</b></a><br>

    <cfelse>
    <a href="http://ecom.cooperbooth.com/"><b>Food-Ecom Login</b></a><br>
    <a href="/secure/requests.cfm"><b>Report Requests</b></a><br>
    <a href="/links.cfm"><b>Useful Links</b></a><br>
    </cfif>
    </cfif>

    jlavetan Guest

  6. #6

    Default Re: Selecting users that are in multiple groups

    If this is your test code, the user would see the link because they are a
    member of both groups (3 and 4):
    <cfset salesGroupID = 3>
    <cfset customerGroupID = 4>
    <cfset memberOfGroups = "1,3,4">

    I think you switched the example code around and reversed the logic. Try
    attached.



    <cfset salesGroupID = 3>
    <cfset customerGroupID = 4>
    <!--- This user is ONLY a member of customer group --->
    <cfset memberOfGroups = "4">

    <!--- user IS a member of customer group --->
    <cfif ListFind(memberOfGroups, customerGroupID) GT 0>
    <a href="http://ecom.cooperbooth.com/"><b>Food-Ecom Login</b></a><br>
    <a href="/secure/requests.cfm"><b>Report Requests</b></a><br>
    <a href="/links.cfm"><b>Useful Links</b></a><br>
    <!--- user IS also a member of sales group --->
    <cfif ListFind(memberOfGroups, salesGroupID) GT 0>
    <a href="http://WEBMAIL LINK/"><b>CBW Webmail</b></a><br>
    </cfif>
    </cfif>

    mxstu Guest

  7. #7

    Default Re: Selecting users that are in multiple groups

    First, I want to say thanks for helping me out... :-)

    With the latest code... neither user can see the link...

    user test is in group 4
    user sales_test is in group 3 and 4

    jlavetan Guest

  8. #8

    Default Re: Selecting users that are in multiple groups

    Not a problem. The code worked fine for me when I tested each of the different
    possibilities. A few things you should check:

    1) Did you output all of the variables to make sure they contain the correct
    values?
    2) Are there any spaces in between the list values? You may need to remove
    them first. Use Replace() function
    3) ListFind() assumes that the list delimiter is a comma, so if you're using a
    different delimiter, you need to specify it.


    mxstu Guest

  9. #9

    Default Re: Selecting users that are in multiple groups

    Dumb question, but would it matter that group IDs are in the database (MS Access)? so, doing the cfset command is causing the problem
    jlavetan Guest

  10. #10

    Default Re: Selecting users that are in multiple groups

    I'm not sure which CFSET statement you're referring to, but the sample code was
    just an example. You need to replace this line:
    <cfset memberOfGroups = "1,3,4">

    with whatever code you're using to create the actual list, such as:

    <cfset memberOfGroups = ValueList(getGroups.groupID)>


    mxstu Guest

  11. #11

    Default Re: Selecting users that are in multiple groups

    Solved :-)
    Thanks again for your help :-)

    Ok, here is the final working code...



    <cfset salesGroupID = 3>
    <cfset customerGroupID = 4>
    <!--- This user is ONLY a member of customer group --->
    <cfset memberOfGroups = ValueList(getGroups.groupID)>

    <!--- user IS a member of customer group --->
    <cfif ListFind(memberOfGroups, customerGroupID) GT 0>
    <a href="http://ecom.cooperbooth.com/"><b>Food-Ecom Login</b></a><br>
    <a href="/secure/requests.cfm"><b>Report Requests</b></a><br>
    <a href="/links.cfm"><b>Useful Links</b></a><br>
    <!--- user IS also a member of sales group --->
    <cfif ListFind(memberOfGroups, salesGroupID) GT 0>
    <a href="http://WEBMAIL LINK/"><b>CBW Webmail</b></a><br>
    </cfif>
    </cfif>

    jlavetan Guest

Similar Threads

  1. Selecting objects within groups
    By Jonathan_Carr@adobeforums.com in forum Adobe Indesign Macintosh
    Replies: 2
    Last Post: October 8th, 07:48 PM
  2. [Carbon] how do i get a list of users and groups??
    By Logan Murray in forum Mac Programming
    Replies: 2
    Last Post: September 16th, 03:28 PM
  3. selecting ordered groups out of a table
    By Ian D Bjorhovde in forum IBM DB2
    Replies: 0
    Last Post: August 30th, 01:57 PM
  4. adding users to different groups
    By Patryk 'Silver Dream !' Łogiewa in forum Mac Programming
    Replies: 3
    Last Post: August 11th, 11:53 AM
  5. local users and groups
    By nichols in forum Windows Setup, Administration & Security
    Replies: 1
    Last Post: July 9th, 03:14 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •