I have written a custom PHP file to be called from AJAX request for SugarCRM. However, when I try to print
global $current_user;
print_r($current_user);
It prints blank values with all the fields listed in the array like below.
User Object
(
[name] =>
[full_name] =>
[id] =>
[user_name] =>
[user_hash] =>
[salutation] =>
[first_name] =>
[last_name] =>
[date_entered] =>
[date_modified] =>
[modified_user_id] =>
[created_by] =>
[created_by_name] =>
[modified_by_name] =>
[description] =>
[phone_home] =>
[phone_mobile] =>
[phone_work] =>
[phone_other] =>
[phone_fax] =>
[email1] =>
[email2] =>
[address_street] =>
[address_city] =>
[address_state] =>
[address_postalcode] =>
[address_country] =>
[status] =>
[title] =>
[portal_only] => 0
[department] =>
[authenticated] =>
[error_string] =>
[is_admin] => 0
[employee_status] =>
[messenger_id] =>
[messenger_type] =>
[is_group] =>
[accept_status] =>
[team_id] =>
[receive_notifications] => 1
[default_team] =>
[reports_to_name] =>
[reports_to_id] =>
[team_exists] =>
[table_name] => users
[module_dir] => Users
[object_name] => User
[user_preferences] =>
[importable] => 1
.....
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
if(!defined('sugarEntry'))define('sugarEntry', true);
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
require_once('include/entryPoint.php');