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

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