Perform correct local/remote user test
Add and use IS_USER_LOCAL() macro
Add IS_SERVER_LOCAL() macro