generalized getprofile() : get profile for login, edit, own