CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 Restrict content based on user id

Print topic Send  topic

Author Message
Rosario


Posts: 54
Posted: 06/10/2005, 5:31 PM

How do I restrict what a customer sees based on who is logged in, like tables/grids/records. Are there any such examples? I have never worked with session variables, but i have got the basic page security where a user must login to see the page, now i want to drill it down more. Hope someone has some ideas in this mega great forum!;-)
View profile  Send private message
peterr


Posts: 5971
Posted: 06/11/2005, 12:05 AM

Hi Rosario,
When a customer logs in then session variable "UserID" is created, which you can use to filter grids and records. This search should help:
http://forums.codecharge.com/search.php?s_keyword=UserI...m[]=6&s_period=
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
Rosario


Posts: 54
Posted: 06/15/2005, 10:50 AM

Hi peterr,

I followed the example but the records do not sort. I used post http://forums.codecharge.com/posts.php?post_id=47712 as a guide. Here is my code;

Table Parameter
Condition Type: Parameter
Field Name:INPUT_BY
Field Type:Integer
Condition: equals (=)
Parameter Source: UserID
Parameter Source: Type:Session
And/Or:And

Not sure what I am missing. Help please:(
View profile  Send private message
Rosario


Posts: 54
Posted: 06/15/2005, 10:52 AM

The CODE view looks like this:

.AddParameter 1, "sesUserID", ccsInteger, Empty, Empty, Empty, False
View profile  Send private message
peterr


Posts: 5971
Posted: 06/15/2005, 10:56 AM

This looks good. But I am not sure what you mean by "records do not sort". Do you want to sort of filter them?
If filtering doesn't work then check if you don't have other parameters that use the "OR" statement. Also check if the UserID is set by placing this code in any event, for example After Initialize:
Response.Write("UserID = " & Session("UserID"))
Response.End
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
Rosario


Posts: 54
Posted: 06/15/2005, 11:08 AM

I want to filter , I tried the UserID on After Initialize and the page did return

UserID = Rosario

View profile  Send private message
Rosario


Posts: 54
Posted: 06/15/2005, 12:56 PM

still no luck at all
View profile  Send private message
peterr


Posts: 5971
Posted: 06/15/2005, 12:59 PM

As I can see you configured your parameter to be Integer, but your UserID is not Integer. So you will need to specify the right type - text in your case.
BTW, I don't understand why your UserIDs are not numeric. I think that they should be.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
Rosario


Posts: 54
Posted: 06/15/2005, 1:29 PM

Ok, I went into the security settings changed the user id to point to the id, in the login table rather than the actual name. I verifed this by runnung that snippet you gave me befor and returned a value of 3, so i tried running the page again set the way it would be in an optimal envinment and still it wont filter. I belive i am doing this correctly., but it dose not work.
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.