userinfo
The userinfo method is called to retrieve information related to the currently logged in user.
Argument
Type
Description
none
Return Value
Type
Description
Yes
JSON string
A formatted JSON string containing all relevant information regarding the user
SAMPLE CODE: ============ // Get security settings var $tmp = $cyware.userinfo (); // Parse the JSON string var $jsonuser = JSON.parse ($tmp); if ($jsonuser.data.status == "ok") { // Dump the results and stop processing echo ($jsonuser); die (); } else // Show the error message echo ('An error occurred: ' + $jsonuser.data.errmsg); SAMPLE OUTPUT: ============== { "data": { "db": { "fld" : [ { "username":"DEMO", "entity_code":"RGOC", "company_code":"RCC", "branch_code":"MKT", "entity_name":"Rustan Group of Companies", "company_name":"Rustans Commercial Corporation", "group_name":"Shopify Returns", "is_cashier":"0", "is_manager":"0", "is_clerk":"", "is_treasury":"1", "is_shopper":"", "branch_name":"Rustans Glorietta", "branch_type_code":"ST", "expire_date":"20191201", "group_code":"RET", "first_name":"Carlos", "middle_name":"J", "last_name":"Yu", "retry_count":"5", "user_locked":"0", "min_pass_len":"8", "passwd_history":"5", "branch_type_code":"ST", "group_code":"RET", "first_name":"Carlos", "last_name":"Yu" } ] }, "status":"ok", "numrows": 1 } }