Closed edent closed 12 years ago
You can use $app->getUser() to pull all the information for the user. And inside that object is the username.
eg:
$user = $app->getUser();
print $user['username'];
Oh, sure, but it's an extra API call.
That's the only way we would be able to (securely) get the information as well. You would not be able to assume that the username would be consistent between sessions (users can, and do, change their usernames).
That said, if you wanted to store it during a single session you could easily do:
$user = $app->getUser();
$_SESSION['app_username'] = $user['username'];
And then access it from there on subsequent page loads.
That's an excellent point - thanks.
It would be great if the user's username was set (either in GLOBAL, _SESSION, or in the cookie).
That makes it easier to spot if a post is a reply, can be deleted, etc.