CodeCharge Studio
search Register Login  

Visual Web Reporting

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

YesSoftware Forums -> CodeCharge Studio -> PHP

 Displaying Logged In User

Print topic Send  topic

Author Message
ajmartin

Posts: 11
Posted: 12/07/2004, 5:33 PM

I am sure this is easy, I am still getting to grips with the layout of CodeCharge.
I have a form that is accessible only after an admin has logged in.
On that form, I have a hidden field that I want to assign the logged in users name too.
What is the easiest way to do this.

Regards
Adam
View profile  Send private message
ajmartin

Posts: 11
Posted: 12/07/2004, 6:05 PM

well... I am halfway there...

using CCGetUserLogin()

however, I want too display a friendly name rather than the login name. I see that CCGetUserLogin() calls CCGetSession which looks up session_vars....
so now I just need too see where the $HTTP_session_vars are set and set my own...
all easy (hopefully).

Loving this program.
lets a programmer get down to work/\
adam
View profile  Send private message
peterr


Posts: 5971
Posted: 12/07/2004, 6:14 PM

You're almost there. The name is not stored in session variables, so you will probably need to use the CCDLookUp function together with the CCGetUserID() function, which retrieves the user's ID.
Take a look at sample CCDLookUp usage at http://docs.codecharge.com/studio/html/ProgrammingTechn...gleDBValue.html
http://docs.codecharge.com/studio/html/QuickStart/Creat...SendEmails.html
http://docs.codecharge.com/studio/html/Components/Funct.../CCDLookUp.html

Probably something like this would work (simplified version):
CCDLookUp("user_name", "users", "user_id=". CCGetUserID(), $DBConnectionName)

I'm only not sure if this will work in the "Default Value" property of your field. You may need to create a Before Show event that will provide global access to the database connection (global $DBConnectionName) and then execute the above code.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
ajmartin

Posts: 11
Posted: 12/07/2004, 6:51 PM

Thanks,
I easily did this by setting a new $HTTP_Session variable at the same time as the login variables are set.... may as well utilise the connection.
I then copied CCGetUserLogin() function and created CCGetUserName()

very very easy.
works a charm\\Adam
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.