credentials method
Checks the login and password credentials of a user.
Method Parameters
| Argument |
Data Type |
Description |
| username |
String |
The username |
| password |
String |
The password |
Return value
| Argument |
Data Type |
Description |
| NONE |
|
|
INI file Entries
The settings file has the following keys:
| Key |
Description |
| PORT |
The web server port.
|
| TIMEOUT |
The web session timeout value in seconds.
|
| TITLE |
The web page title.
|
| VERSION |
The CYWare JS API version number.
|
| EXTLIB |
The CYWare library extension: .so for Linux, .dylib for OsX, .dll for Windows
|
| ... |
TODO: Not yet done...
|
SAMPLE CODE:
============
var $tmp = $cyware->credentials ('mylogin', 'mypassword');
var $user = JSON.parse ($tmp);
if ($user.data.status == "ok")
echo ('Login success');
RETURNED JSON SUCCESS:
======================
{ "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
},
"sessionid": "E3C001B1C030B0D210C32385C6941246A737D67736A393C392A2B2D2F2D2E2B7F461B100E1B0528046C364D4B484",
"timeout": "1590012316",
"expire_date": "20191201",
"user_locked": "0",
"retry_count": "5"
}