I'm working on a small internal site ( = users are logged onto their machines with domain credentials). On "standard" PHP get_current_user() works like a charm, in cake it doesn't. I'm trying to find a way that I can get the username without triggering the Auth component/a full login dialog as the user is already logged in.
Every suggestion/thread I've seen involves the Auth component and it's really cumbersome.
EDIT: get_current_user() returns "root", I presume this could be because of the routing or something internal/intentional?
Thanks!
I don't see how you can use get_current_user()
for user authentication. As per the PHP manual it "Gets the name of the owner of the current PHP script". Now the script owner (user which created the php file) is always going to be the same regardless of who accesses it.
Plus as Oldskool said above CakePHP is still PHP.