Get username and display name simple

Hi, I create a plugin and just want to grab the username and display name in PHP, I try to figure out how I can make it but don’t know…

I just need these informations. I can pass with COOKIE but it can be hack.

Thank you.

Nevermind, in my app I add these lines without anything else and can get my user information :

$sUser = OCP\User::getUser();

1 Like