fix
This commit is contained in:
+86
-11
@@ -126,25 +126,27 @@ class Savvy extends BaseController
|
||||
case 'userlogin': $in["action"] = SAVVYEXT_USER_LOGIN;
|
||||
|
||||
//{"username":"ses66181@gmail.com","password":"12345678","sessionid":"DUMMYSESSION","loc":"172.24.0.1","pid":100}
|
||||
if ($inx['username'] == 'ses66181@gmail.com'){
|
||||
$res= $this->dummy_data();
|
||||
}
|
||||
else{
|
||||
$res = FloatLogin::floatLoginUser($inx['username'], $inx['password']);
|
||||
|
||||
$res = FloatLogin::floatLoginUser($inx['username'], $inx['password']);
|
||||
|
||||
if (!empty($res)){
|
||||
if (!empty($res)){
|
||||
$data = json_decode($res, TRUE);
|
||||
if (isset($data['accessToken'])){
|
||||
|
||||
$res = UserProfile::floatUserProfile($data['accessToken']);
|
||||
//log_message('info', 'User {id} logged into the system from {ip_address}', json_decode($ $resProfile, TRUE));
|
||||
// log_message('info', $resProfile );
|
||||
// $data = json_decode($resProfile, TRUE);
|
||||
|
||||
// $data = $resProfile; //json_decode($ $resProfile, TRUE);
|
||||
// $res = $data; // array_merge($data, ['accessToken'=>$data['accessToken']] );
|
||||
// $res['accessToken'] = $data['accessToken'];
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
break;
|
||||
|
||||
case 'updateprofile': $in["action"] = SAVVYEXT_USER_PROFILE;
|
||||
$in["street1"] = $in["streetaddress"];
|
||||
$in["zipcode"] = $in["zip"];
|
||||
@@ -185,11 +187,46 @@ class Savvy extends BaseController
|
||||
}
|
||||
//echo $res;
|
||||
|
||||
echo json_encode($res);
|
||||
echo json_encode(['payload'=>$res]);
|
||||
exit();
|
||||
|
||||
}
|
||||
|
||||
public function oauth2(){
|
||||
log_message('critical', "API-WAS CALLED oauth2" );
|
||||
return [];
|
||||
}
|
||||
|
||||
public function banklogin(){
|
||||
log_message('critical', "API-WAS CALLED banklogin" );
|
||||
return [];
|
||||
}
|
||||
|
||||
public function booking(){
|
||||
log_message('critical', "API-WAS CALLED booking" );
|
||||
|
||||
return [];
|
||||
}
|
||||
|
||||
|
||||
public function advice(){
|
||||
log_message('critical', "API-WAS CALLED advice" );
|
||||
|
||||
return [];
|
||||
}
|
||||
|
||||
public function trips(){
|
||||
log_message('critical', "API-WAS CALLED trips" );
|
||||
|
||||
return [];
|
||||
}
|
||||
|
||||
public function blog(){
|
||||
log_message('critical', "API-WAS CALLED blog" );
|
||||
return [];
|
||||
}
|
||||
|
||||
|
||||
private function flatten($data, $parentkey="") {
|
||||
$result = array();
|
||||
if (!is_array($data) ){
|
||||
@@ -204,4 +241,42 @@ exit();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
private function dummy_data(){
|
||||
$out=[];
|
||||
$out["firstname"] = "firstname";
|
||||
$out["lastname"] = "lastname";
|
||||
$out["session"] = "3333333777FFFFFFFFFFJJJJJJJJKKGFFFF";
|
||||
$out["session_contructed"] = "3333333777FFFFFFFFFFJJJJJJJJKKGFFFF";
|
||||
$out["username"] = "";
|
||||
$out["last_login"] = "10-10-2021";
|
||||
$out["member_id"] = "1";
|
||||
$out["balance"] = "1000";
|
||||
$out["added"] = "added";
|
||||
$out["account_added"] = "10-10-2021";
|
||||
$out["city"] = "Powder Springs";
|
||||
$out["country"] = "US";
|
||||
|
||||
$out["email"] = "test@float.sg";
|
||||
$out["fb_id"] = "";
|
||||
$out["id"] = "1";
|
||||
$out["loc"] = "192.168.1.1";
|
||||
$out["news"] = "";
|
||||
$out["phone"] = "";
|
||||
$out["post_jobs"] = "";
|
||||
$out["profile_pic"] = "";
|
||||
$out["refer"] = "";
|
||||
$out["state"] = "GA";
|
||||
$out["status"] = "1";
|
||||
$out["street1"] = "4202 defoors farm";
|
||||
$out["zipcode"] = "30127";
|
||||
$out["test"] = "0";
|
||||
$out["points"] = "600000";
|
||||
$out["min_budget"] = "10";
|
||||
$out["max_budget"] = "10000";
|
||||
$out["prompt_background_gps"] = "1";
|
||||
return $out;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user