How can I obtain $current_user  information through my after_ui_frame logic hook in  Sugarcrm 7.1.5?

I am currently trying to get functionality developed on Sugarcrm 6.7 working on Sugarcrm 7.1.5. I am using an after_ui_frame logic hook to trigger a function in a custom class which is currently located in custom/includes. In this function I use the global $current_user to check whether the user is still logged in (check whether the user_hash is available) and to obtain the eapmBean from a connecter which contains login information. However, the $current_user global does not contain an user id or name that is required.  So my question is how to solve this problem; is the way to obtain current user information changed or is there a problem with my approach?

Also in Sugarcrm 6.7 I used the $_SESSION variable to store additional information about an external login performed to another system. However, this variable is not initialized anymore. So I'm wondering whether it is still used in Sugarcrm or that I can use other strategies to add information to a users' session.

Your help is greatly appreciated!

Parents
  • I have done some extra research: In classes like for example the Lead class of the Leads module the current_user global shows the information for the currently logged in user. I use the  after_ui_frame Application hook on all modules (so in the custom/modules/logic_hooks.php file), so therefore I have to use the $current_user global because this type of logic hooks do not supply the $bean variable. So now it looks to me that this current_user global is somehow protected more or I'm now outside some required context.
    So I'm hoping that someone has the answer for me. Thanks in advance!
Reply
  • I have done some extra research: In classes like for example the Lead class of the Leads module the current_user global shows the information for the currently logged in user. I use the  after_ui_frame Application hook on all modules (so in the custom/modules/logic_hooks.php file), so therefore I have to use the $current_user global because this type of logic hooks do not supply the $bean variable. So now it looks to me that this current_user global is somehow protected more or I'm now outside some required context.
    So I'm hoping that someone has the answer for me. Thanks in advance!
Children
No Data