SSzretter
|
| Posted: 03/23/2005, 11:13 AM |
|
Say I have a page that is protected, and I am using all the standard CCS features for security (I have defined a users table and groups)...
Now, after a user logs in to get to a secured page, on that page I want to do something hopefully very simple: I want to display the userid, user group, and user name ... Just as static text is fine...
Finally, is it possible to put some sort of logic on the page like IF user group is > 99 then do this ? So I dont have to create seperate pages for groups, but can have one page that displays information according to group?
Thanks so much!
|
|
|
 |
peterr
Posts: 5971
|
| Posted: 03/23/2005, 12:19 PM |
|
You can place Labels on any page (or within a grid or record) and then assign those values to each Label.
For example to display a user's ID, you'd write code in Before Show event like:
Label1.Value = CCGetSession("UserID")
Similar example is in the tutorial at: http://docs.codecharge.com/studio/html/QuickStart/Creat...FieldValue.html
CCS automatically creates 3 commonly used session variables:
UserID, UserLogin, GroupID
You can lookup various other values from the database using CCDLookup function.
Thus you can lookup a user's name as shown at: http://docs.codecharge.com/studio/html/QuickStart/Creat...LabelValue.html
The above examples would need to be adjusted to your needs, so it may be best if you go throyugh the tutorial (30 minutes) to understand how everything works.
Or instead of custom code sometimes you can use Actions, for example assign "Retrieve Value for Control" action to a label's "Before Show" event. Then specify:
Control Name: (your label's name)
Source Type: Session
Source Name: UserID
CCS tutorial also shows how to use some logic if UserID is so and so, at: http://docs.codecharge.com/studio/html/QuickStart/Creat...rInitEvent.html
You can easily change this to use GroupID instead of UserID.
I guess since the tutorial shows all this, it may be the best place for you to start.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
 |
 |
|