Returns the current Username.
Syntax
Security::getUserName()
Arguments
No arguments.
Return value
Returns the current Username.
Example
This example shows how to output the current user data:
$userData = Security::getUserName();
echo $userData;
Sample output
admin_user
See also:
•Security API: setAllowedPages
•Example: Hide controls on Add/Edit pages, based on the username