then I could just do
- Code: Select all
{$ENV.AUTHENTICATION_TOOL->getLoggedInUser()->val('Name')}
But it doesn't exist, so in lieu what's the best way to go about this?
Get logged in user with Smarty
3 posts
• Page 1 of 1
Get logged in user with SmartyHey all, how do I use smarty to get the name of the logged in user? It would be easy if the authentication tool were included in $ENV, like $ENV.AUTHENTICATION_TOOL
then I could just do
But it doesn't exist, so in lieu what's the best way to go about this?
Re: Get logged in user with Smartyfigured it out; answer is easy: {$ENV.APPLICATION_OBJECT->getAuthenticationTool()} gets you to the authentication tool. The rest is simple.
Another way I figured out which I like more is in the beforeHandleRequest() function in the application delegate, you can use the following code to get the skintool;
and you can then insert any value you wish using the assign function. Say I want to get the "LoggedInUserName" with smarty as {$LoggedInUser} I could say
Re: Get logged in user with SmartyYes. That will work. An alternative is also:
{$ENV.user} To get the Dataface_Record object for the currently logged in user. or {$ENV.username} To get the username of the currently logged in user. You can see most of the environment variables that are set in the Skin tool source. http://weblite.ca/svn/dataface/core/tru ... inTool.php Steve
3 posts
• Page 1 of 1
Who is onlineUsers browsing this forum: No registered users and 4 guests |