This content has been marked as final. Show 2 replies
Where do I register this variable
I´d define a new global session variable in ADDT´s Control panel and name it, say, "user_group" -- like all other default session variables it will be available whereevr you need it.
Can I, on the same page at the same time, use another session variable for the group information?
Let´s assume you´d like to display a certain page segment to a user who´s logged in *and* has the "user_group" session value of 2:
1. wrap this segment in a "Show IF Conditional Region" behaviour which checks if ADDT´s default session variable "kt_login_id" is set
2. switch to Code View and append a second condition which checks the "user_group" session value, e.g. $_SESSION['user_group'] == "2"
In order to make this a combined condition, you´ll need to concatenate both individual conditions with "&&", what should read like this:
if (isset($_SESSION['kt_login_id']) && $_SESSION['user_group'] == "2")
Adobe Community Expert, Dreamweaver
This solution works great if each user only belongs to one group. However, each user could potentially belong to any number of different groups, each with different IDs. What I need is for the group page being displayed to only show content for the group that the user wants to view based on a link he clicks on a page of his groups. Therefore, the user_group session variable would be different depending on which group he clicks. I can obviously create a recordset on the group page that says group_id = kt_user_group (session variable). However, on the list of the user's groups, I need to somehow make the group names link to the group page with the correct session variable loaded. How would I do that? Does this make sense? I don't want to use a URL parameter to display the group page because I don't want users to be able to jump to any group that they're not a member of.