So I was looking how the $current_user global gets initialized with proper information and couldn’t find anything about it.
EntryPoint just creates a $current_user variable with a fresh empty User object, but it doesn’t try to even make it to have information about actual current user. Currently I am trying to get such info on somewhat external page in which I include some of the CRM files/logic. But $current_user stays unpopulated. I force it to be populated by doing $current_user->retrieve($_COOKIE['ck_login_id_20'])
. But this is not a perfect solution and I wonder how can I force CRM preferences/globals into a custom page.