Page 1 of 1
CurrentUserInfo() does not print field value (v9)
Posted: Thu Sep 12, 2013 3:11 pm
by atalie1922
Good afternoon. I am using phpmaker v9 and I want to fetch the information of the user logged-in in the system. I tried these code statements that I have seen in other posted topics:
echo $GLOBALS["Security"]->CurrentUserInfo("lastname");
if ( IsLoggedIn() )
{
echo CurrentUserInfo("lastname");
}
but it does not print anything. Thank you.
Re: CurrentUserInfo() does not print field value in v9
Posted: Thu Sep 12, 2013 3:54 pm
by mobhar
In which server event did you put the code?
Also, make sure the field name matches with the one in the table.
Re: CurrentUserInfo() does not print field value (v9)
Posted: Thu Sep 19, 2013 6:56 pm
by atalie1922
I am trying to use it in Page_DataRendering and Page_DataRendered event in List Page. Thank you for your reply.
Re: CurrentUserInfo() does not print field value (v9)
Posted: Thu Sep 19, 2013 10:01 pm
by mobhar
Try this:
function Page_DataRendering(&$header) {
if ( IsLoggedIn() ) {
$header = CurrentUserInfo("lastname");
}
}
function Page_DataRendered(&$footer) {
if ( IsLoggedIn() ) {
$footer = CurrentUserInfo("lastname");
}
}