Data flow login fix
This commit is contained in:
@@ -11,4 +11,5 @@ $arr["port"] = 5432;
|
|||||||
define('LEGACY_BACKEND_ENDPOINT','backend.wrenchboard.api.live');
|
define('LEGACY_BACKEND_ENDPOINT','backend.wrenchboard.api.live');
|
||||||
//define('EXTENSTION_API_URL','https://dashboard.wrenchboard.com/svs/bko'); //
|
//define('EXTENSTION_API_URL','https://dashboard.wrenchboard.com/svs/bko'); //
|
||||||
// define('EXTENSTION_API_URL','http://172.16.4.100:9083/svs/bko');
|
// define('EXTENSTION_API_URL','http://172.16.4.100:9083/svs/bko');
|
||||||
define('EXTENSTION_API_URL','http://172.16.4.25:9083/svs/bko');
|
//define('EXTENSTION_API_URL','http://172.16.4.25:9083/svs/bko');
|
||||||
|
define('EXTENSTION_API_URL','http://172.16.4.25:9083/backoffice/svs/bko');
|
||||||
@@ -47,6 +47,8 @@ class Bko extends CI_Controller {
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
$this->populate_bko_session($res, $out);
|
$this->populate_bko_session($res, $out);
|
||||||
|
redirect('bkouser/dash');
|
||||||
|
exit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,7 +66,7 @@ class Bko extends CI_Controller {
|
|||||||
$_SESSION['bko_selected_memberd_id'] = 0;
|
$_SESSION['bko_selected_memberd_id'] = 0;
|
||||||
$_SESSION['bko_group'] = $out['group_id'];
|
$_SESSION['bko_group'] = $out['group_id'];
|
||||||
$_SESSION['bkodata'] = $out;
|
$_SESSION['bkodata'] = $out;
|
||||||
redirect('bkouser/dash');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,69 +14,77 @@ class Login extends WRB_Controller {
|
|||||||
|
|
||||||
public function index() {
|
public function index() {
|
||||||
$data["login_message"] = "";
|
$data["login_message"] = "";
|
||||||
$this->load->library('form_validation');
|
|
||||||
$this->form_validation->set_rules('username', 'Username', 'required');
|
|
||||||
$this->form_validation->set_rules('password', 'Password', 'required');
|
|
||||||
|
|
||||||
if ($this->form_validation->run() !== false) {
|
try {
|
||||||
|
$this->load->library('form_validation');
|
||||||
|
$this->form_validation->set_rules('username', 'Username', 'required');
|
||||||
|
$this->form_validation->set_rules('password', 'Password', 'required');
|
||||||
|
|
||||||
|
if ($this->form_validation->run() !== false) {
|
||||||
|
|
||||||
|
|
||||||
$data['username'] = strtolower($this->input->post('username')); // '08174596144';
|
$data['username'] = strtolower($this->input->post('username')); // '08174596144';
|
||||||
$data['password'] = $this->input->post('password'); //'7978';
|
$data['password'] = $this->input->post('password'); //'7978';
|
||||||
|
|
||||||
$data['sessionid'] = rand(10000, 99999) . "A" . rand(10000, 99999);
|
$data['sessionid'] = rand(10000, 99999) . "A" . rand(10000, 99999);
|
||||||
$data['action'] = WRENCHBOARD_ACCOUNT_LOGIN;
|
$data['action'] = WRENCHBOARD_ACCOUNT_LOGIN;
|
||||||
$this->load->model('backend_model');
|
$this->load->model('backend_model');
|
||||||
$out = array();
|
$out = array();
|
||||||
// $res = $this->backend_model->wrenchboard_api($data, $out);
|
// $res = $this->backend_model->wrenchboard_api($data, $out);
|
||||||
$res = $this->wrenchboard_api($data, $out);
|
$res = $this->wrenchboard_api($data, $out);
|
||||||
$is_live = $this->backend_model->cfgReadChar("system.live");
|
$is_live = $this->backend_model->cfgReadChar("system.live");
|
||||||
|
|
||||||
// var_dump($out);
|
|
||||||
// print_r($out);
|
// print_r($out);
|
||||||
if ($res == PHP_LOGIN_OK) {
|
if ($res == PHP_LOGIN_OK) {
|
||||||
$this->load->model('account_model');
|
$this->load->model('account_model');
|
||||||
$ret = $this->account_model->username_data($data);
|
$ret = $this->account_model->username_data($data);
|
||||||
if ($res !== false) {
|
if ($res !== false) {
|
||||||
$data["login_message"] = "Welcome...";
|
$data["login_message"] = "Welcome...";
|
||||||
// yes person has an account
|
// yes person has an account
|
||||||
$_SESSION['session_id'] = $out["session"];
|
$_SESSION['session_id'] = $out["session"];
|
||||||
$_SESSION['username'] = $this->input->post('username');
|
$_SESSION['username'] = $this->input->post('username');
|
||||||
$_SESSION['name'] = $this->input->post('username');
|
$_SESSION['name'] = $this->input->post('username');
|
||||||
$_SESSION['firstname'] = $ret->firstname;
|
$_SESSION['firstname'] = $ret->firstname;
|
||||||
$_SESSION['lastname'] = $ret->lastname;
|
$_SESSION['lastname'] = $ret->lastname;
|
||||||
$_SESSION['email'] = $ret->email;
|
$_SESSION['email'] = $ret->email;
|
||||||
$_SESSION['member_id'] = $ret->id;
|
$_SESSION['member_id'] = $ret->id;
|
||||||
$_SESSION['log_count'] = 0;
|
$_SESSION['log_count'] = 0;
|
||||||
$_SESSION['mesaage_count'] = 0;
|
$_SESSION['mesaage_count'] = 0;
|
||||||
$this->findOffers($_SESSION['email']);
|
$this->findOffers($_SESSION['email']);
|
||||||
$_SESSION['message_snapshot'] = $this->myMessagesSnapshot();
|
$_SESSION['message_snapshot'] = $this->myMessagesSnapshot();
|
||||||
$_SESSION['total_jobs'] = 0;
|
$_SESSION['total_jobs'] = 0;
|
||||||
if (trim($ret->profile_pic) == '') {
|
if (trim($ret->profile_pic) == '') {
|
||||||
// Show default picture
|
// Show default picture
|
||||||
$_SESSION['profile_picture'] = "../smedia/DEFAULTS/default-profile.png";
|
$_SESSION['profile_picture'] = "../smedia/DEFAULTS/default-profile.png";
|
||||||
} else {
|
} else {
|
||||||
// show the profile picture
|
// show the profile picture
|
||||||
$_SESSION['profile_picture'] = "../smedia/" . ($is_live ? "LIVE" : "TEST") . "/profile/" . $ret->profile_pic;
|
$_SESSION['profile_picture'] = "../smedia/" . ($is_live ? "LIVE" : "TEST") . "/profile/" . $ret->profile_pic;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$this->logUser('Account login');
|
||||||
|
$this->refreshAccountDetail($_SESSION['member_id']);
|
||||||
|
$this->getSessionArray();
|
||||||
|
redirect('dash');
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
$data["login_message"] = "Invalid username or password";
|
||||||
$this->logUser('Account login');
|
|
||||||
$this->refreshAccountDetail($_SESSION['member_id']);
|
|
||||||
$this->getSessionArray();
|
|
||||||
redirect('dash');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$res = false; // $this->login_model->verify_login($data);
|
||||||
} else {
|
} else {
|
||||||
$data["login_message"] = "Invalid username or password";
|
echo validation_errors();
|
||||||
}
|
}
|
||||||
|
|
||||||
$res = false; // $this->login_model->verify_login($data);
|
|
||||||
} else {
|
} catch (Exception $e) {
|
||||||
echo validation_errors();
|
echo 'Caught exception: ', $e->getMessage(), "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if ($this->lib_login->is_authenticated()) {
|
if ($this->lib_login->is_authenticated()) {
|
||||||
$fb_data = $this->lib_login->getData($this->lib_login->get_access_token());
|
$fb_data = $this->lib_login->getData($this->lib_login->get_access_token());
|
||||||
if (isset($fb_data['me'])) {
|
if (isset($fb_data['me'])) {
|
||||||
|
|||||||
Reference in New Issue
Block a user