Stephen Martin
|
Posted: 04/07/2004, 12:20 PM |
|
Hello,
I am attempting to set a component with a value derived from
CCGetUserLogin()
using PHP,
CCGetUserLogin() returns an empty string?
<CODE>
//Custom Code @7-DBA303E4
// -------------------------
global $Header;
// Write your own code here.
// This code will init the component with the current logged in User.
$Header->loggedin->SetText(CCGetUserLogin());
// -------------------------
//End Custom Code
</CODE>
Basically I want to display ithe header the currently logged in user. Am I using the right function?
Can this information be gleaned in amore reliable way?
Thanks Stephen
|
|
|
peterr
Posts: 5971
|
Posted: 04/07/2004, 12:31 PM |
|
I don't use PHP regularly but couldn't find "SetText" in our Help file. I believe that it should be "SetValue". Especially based on examples like these: http://docs.codecharge.com/studio/html/ProgrammingTechn...ntrolValue.html
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
|
|
p3ptools
Posts: 19
|
Posted: 04/07/2004, 1:33 PM |
|
Hello,
I made the amendment that you suggested but to no avail.
It appears that the
CCGetUserLogin() function is just not returning any valid
data?
I tried echo'ing out a few debug strings to see what this function is doing
but each time it was an empty string.
Stephen
_________________
Sometimes the complaints will be false... |
|
|
peterr
Posts: 5971
|
Posted: 04/07/2004, 2:28 PM |
|
Looks like no one is logged in. Do you have any indications that you're logged in? Possibly try accessing any restricted page to see if it redirects you to the login page.
Also, which event are you using?
Possibly try echo'ing a static string like "abc" to see if it even will work.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
|
|
p3ptools
Posts: 19
|
Posted: 04/07/2004, 2:48 PM |
|
Hello,
thanks.. that has picked up an issue of logging in!
I thought a login process had been built by the wizard.. but I will have to check that.
Stephen
_________________
Sometimes the complaints will be false... |
|
|
peterr
Posts: 5971
|
Posted: 04/07/2004, 2:51 PM |
|
Well, even if the wizard built the login, the application doesn't know who you are until you actually perform the login on your Website. Therefore CCGetUserLogin() can work only after you (or the user) go to the login page and login successfully. It will then return the ID of the user.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
|
|