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

 Use login name to create readonly textbox?

Print topic Send  topic

Author Message
Colin Mckinney
Posted: 07/14/2004, 8:11 AM

When a user logs in the form auto populates with the users name, Last, First. This works great. The user can then search on their data and modify, add, etc.

My problem is that a user can simply type someone elses name in the Name field and gain access to another users data.

How can I have the name field populate - but not be editable?

Thanks,
Benjamin Krajmalnik
Posted: 07/14/2004, 8:48 AM

Create a label field in addition to the text field. In the beforeshow
event, selectivle set the visible property.

Along the lines of:

' text box
If CCGetUserID() then
EventCaller.Visible = true
else
EventCaller.Visible = false
End if

'label field
If CCGetUserID() then
EventCaller.Visible = false
else
EventCaller.Visible = true
End if

peterr


Posts: 5971
Posted: 07/14/2004, 9:37 PM

You may also disable a textbox completely by going to the "Format" tab of the Properties and setting the "disabled" property.

However, sometimes the users may still change the URL to include their own name, so it's best to implement the record security via custom code, as shown at http://docs.codecharge.com/studio/html/QuickStart/EnhAp...rInitEvent.html
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
david plude
Posted: 07/19/2004, 12:29 PM

I tried this approach and like it overall. But I am not sure if this is jut my system or what, but it seems to leave the textbox on the page although there is no data in the box. Is there a way to make this either go away completly? Or can I change this to READONLY vs editable based on groupID?

ctrlname.readonly = TRUE does not work. Is there a way to toggle that property?
david plude
Posted: 07/19/2004, 12:36 PM

I take back my earlier comment. It seems that the only thing that gets hidden is the label I created. The TEXTBOX does not disappear. In fact, if the user in a lower group access this page then it is still there and blank. If I submit the record it actually wipes out the data that was there!
Joe
Posted: 07/19/2004, 1:58 PM

Colin,
Just make those fields hidden fields, that are auto populated, and then place labels in the form, that are also auto populates by the log in. and then when you search, if that is an option for you. or if you are having users log in, have the Session variable set to retrieve their name, and make the grid result filter with the forms parameters and the session variables, if those are option, ;-)

Quote Colin Mckinney:
When a user logs in the form auto populates with the users name, Last, First. This works great. The user can then search on their data and modify, add, etc.

My problem is that a user can simply type someone elses name in the Name field and gain access to another users data.

How can I have the name field populate - but not be editable?

Thanks,


;-)
peterr


Posts: 5971
Posted: 07/19/2004, 5:21 PM

The original message was "How can I have the name field populate - but not be editable? ". So there is probably nothing if the TEXTBOX does not disappear. Is it still editable?
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
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.

MS Access to Web

Convert MS Access to Web.
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.