Commit 951586c1 by Tobin

Merge branch 'master' of https://gitlab.techware.co.in/timeout/timeOut into tobin

parents 391ba383 fa656788
......@@ -669,5 +669,23 @@ class Webservice extends CI_Controller {
$this->errorResponse($res['code'],$res['message']);
}
}
/*******************************Flight API******************************************/
public function flight_authenticate(){
$data = (array)json_decode(file_get_contents('php://input'));
$data['auth_token'] = $this->auth_token;
$res = $this->Webservice_model->flight_authenticate($data);
if($res['status'] == 1){
$this->response($res['data']);
}else{
$this->errorResponse($res['code'],$res['message']);
}
}
}
?>
......@@ -456,7 +456,11 @@ class Organizer_model extends CI_Model {
public function signIn($data){
try{
$sql = $this->db->query("SELECT USR.* FROM users AS USR INNER JOIN provider AS PDR ON (PDR.provider_id = USR.id) WHERE USR.password='".md5($data['password'])."' AND PDR.email='".$data['email_id']."' AND USR.user_type='".$data['user_type']."'");
if($data['user_type'] == '2'){
$sql = $this->db->query("SELECT USR.* FROM users AS USR INNER JOIN provider AS PDR ON (PDR.provider_id = USR.id) WHERE USR.password='".md5($data['password'])."' AND PDR.email='".$data['email_id']."' AND USR.user_type='".$data['user_type']."'");
}else{
$sql = $this->db->query("SELECT * FROM checker WHERE username='".$data['email_id']."' AND password='".$data['password']."' AND status='1'");
}
if(empty($sql) || empty($custData = $sql->row_array())){
$res = array('status'=>0,'message'=>'User Doesnot Exist','code'=>'ER09');
......@@ -475,9 +479,14 @@ class Organizer_model extends CI_Model {
$res = array('status'=>0,'message'=>'New Password and Confirm Password Doesnot Match','code'=>'ER10');
return $res;
}
if($this->db->query("UPDATE users SET password='".md5($data['confirm_password'])."' WHERE id='".$data['user_id']."' AND user_type='".$data['user_type']."'")){
if($data['user_type'] == '2'){
$status = $this->db->query("UPDATE users SET password='".md5($data['confirm_password'])."' WHERE id='".$data['user_id']."' AND user_type='".$data['user_type']."'");
}else{
$status = $this->db->query("UPDATE checker SET password ='".md5($data['confirm_password'])."' WHERE id='".$data['user_id']."'");
}
if($status){
$res = array('status'=>1,'message'=>'Password Updated Successfully');
}
}
} catch (Exception $e){
$res = array('status'=>0,'message'=>'Ohh No!! Something Went South','code'=>'ER06');
}
......
......@@ -2326,6 +2326,10 @@ class Webservice_model extends CI_Model {
return $res;
}
public function authenticate(){
}
public function passToJsonCurl($url='',$postData=array()){
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,$url);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment