Log in fx
This commit is contained in:
@@ -111,9 +111,9 @@ class Savvy extends BaseController
|
|||||||
|
|
||||||
log_message('critical', "API-WAS CALLED user 009" );
|
log_message('critical', "API-WAS CALLED user 009" );
|
||||||
|
|
||||||
// log_message('critical', json_encode($in) );
|
log_message('critical', json_encode($in) );
|
||||||
// log_message('critical', json_encode($_POST) );
|
log_message('critical', json_encode($_POST) );
|
||||||
|
$inx = $_POST;
|
||||||
switch ($endpoint) {
|
switch ($endpoint) {
|
||||||
case 'getdrycleanservicelist': $in["action"] = SAVVYEXT_USER_DRYCLIST;
|
case 'getdrycleanservicelist': $in["action"] = SAVVYEXT_USER_DRYCLIST;
|
||||||
break;
|
break;
|
||||||
@@ -124,7 +124,10 @@ class Savvy extends BaseController
|
|||||||
$in["loc"] = $_SERVER["REMOTE_ADDR"];
|
$in["loc"] = $_SERVER["REMOTE_ADDR"];
|
||||||
break;
|
break;
|
||||||
case 'userlogin': $in["action"] = SAVVYEXT_USER_LOGIN;
|
case 'userlogin': $in["action"] = SAVVYEXT_USER_LOGIN;
|
||||||
$res = FloatLogin::floatLoginUser();
|
|
||||||
|
//{"username":"ses66181@gmail.com","password":"12345678","sessionid":"DUMMYSESSION","loc":"172.24.0.1","pid":100}
|
||||||
|
|
||||||
|
$res = FloatLogin::floatLoginUser($inx['username'], $inx['password']);
|
||||||
|
|
||||||
if (!empty($res)){
|
if (!empty($res)){
|
||||||
$data = json_decode($res, TRUE);
|
$data = json_decode($res, TRUE);
|
||||||
|
|||||||
@@ -6,8 +6,12 @@ use GuzzleHttp\Client as HTTPClient;
|
|||||||
|
|
||||||
class FloatLogin
|
class FloatLogin
|
||||||
{
|
{
|
||||||
public static function floatLoginUser()
|
public static function floatLoginUser($username,$password)
|
||||||
{
|
{
|
||||||
|
// {\"username\":\"test@float.sg\",\"password\":\"111111\",\"sessionid\":\"DUMMYSESSION\"}");
|
||||||
|
// "{'username':'$username','password':'$password',\"sessionid\":\"DUMMYSESSION\"}"
|
||||||
|
|
||||||
|
log_message('critical', "{'username':'$username','password':'$password',\"sessionid\":\"DUMMYSESSION\"}" );
|
||||||
|
|
||||||
// Generated by curl-to-PHP: http://incarnate.github.io/curl-to-php/
|
// Generated by curl-to-PHP: http://incarnate.github.io/curl-to-php/
|
||||||
$ch = curl_init();
|
$ch = curl_init();
|
||||||
@@ -15,7 +19,8 @@ class FloatLogin
|
|||||||
curl_setopt($ch, CURLOPT_URL, 'http://10.20.30.26:8000/api/v1/user/login');
|
curl_setopt($ch, CURLOPT_URL, 'http://10.20.30.26:8000/api/v1/user/login');
|
||||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||||
curl_setopt($ch, CURLOPT_POST, 1);
|
curl_setopt($ch, CURLOPT_POST, 1);
|
||||||
curl_setopt($ch, CURLOPT_POSTFIELDS, "{\"username\":\"test@float.sg\",\"password\":\"111111\",\"sessionid\":\"DUMMYSESSION\"}");
|
// curl_setopt($ch, CURLOPT_POSTFIELDS, "{'username':'$username','password':'$password',\"sessionid\":\"DUMMYSESSION\"}");
|
||||||
|
curl_setopt($ch, CURLOPT_POSTFIELDS, "{\"username\":\"$username\",\"password\":\"$password\",\"sessionid\":\"DUMMYSESSION\"}");
|
||||||
curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');
|
curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');
|
||||||
|
|
||||||
$headers = array();
|
$headers = array();
|
||||||
|
|||||||
Reference in New Issue
Block a user