Log in fx
This commit is contained in:
@@ -6,8 +6,12 @@ use GuzzleHttp\Client as HTTPClient;
|
||||
|
||||
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/
|
||||
$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_RETURNTRANSFER, 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');
|
||||
|
||||
$headers = array();
|
||||
|
||||
Reference in New Issue
Block a user