title: SugarCRM, Getting Current Logged in User Details through AJAX Call
body: <p>I have written a custom PHP file to be called from AJAX request for SugarCRM. However, when I try to print</p>
  
  <pre><code>global $current_user;
  
  print_r($current_user);
  </code></pre>
  
  <p>It prints blank values with all the fields listed in the array like below.</p>
  
  <pre><code>User Object
  (
      [name] =&gt; 
      [full_name] =&gt; 
      [id] =&gt; 
      [user_name] =&gt; 
      [user_hash] =&gt; 
      [salutation] =&gt; 
      [first_name] =&gt; 
      [last_name] =&gt; 
      [date_entered] =&gt; 
      [date_modified] =&gt; 
      [modified_user_id] =&gt; 
      [created_by] =&gt; 
      [created_by_name] =&gt; 
      [modified_by_name] =&gt; 
      [description] =&gt; 
      [phone_home] =&gt; 
      [phone_mobile] =&gt; 
      [phone_work] =&gt; 
      [phone_other] =&gt; 
      [phone_fax] =&gt; 
      [email1] =&gt; 
      [email2] =&gt; 
      [address_street] =&gt; 
      [address_city] =&gt; 
      [address_state] =&gt; 
      [address_postalcode] =&gt; 
      [address_country] =&gt; 
      [status] =&gt; 
      [title] =&gt; 
      [portal_only] =&gt; 0
      [department] =&gt; 
      [authenticated] =&gt; 
      [error_string] =&gt; 
      [is_admin] =&gt; 0
      [employee_status] =&gt; 
      [messenger_id] =&gt; 
      [messenger_type] =&gt; 
      [is_group] =&gt; 
      [accept_status] =&gt; 
      [team_id] =&gt; 
      [receive_notifications] =&gt; 1
      [default_team] =&gt; 
      [reports_to_name] =&gt; 
      [reports_to_id] =&gt; 
      [team_exists] =&gt; 
      [table_name] =&gt; users
      [module_dir] =&gt; Users
      [object_name] =&gt; User
      [user_preferences] =&gt; 
      [importable] =&gt; 1
  </code></pre>
  
  <p>.....</p>
  
  <p>I have searched in SugarCRM Forums but no use. I suspect the reason could be valid entry point is not defined in my custom page, as don't understand how to define except the following methods</p>
  
  <pre><code>if(!defined('sugarEntry'))define('sugarEntry', true);
    if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); 
    require_once('include/entryPoint.php');
  </code></pre>