|
|
@@ -49,14 +49,13 @@ class login {
|
|
|
|
|
|
$sql = $this->getLoginSql($uname);
|
|
|
$rs = common::excuteObjectSql($sql);
|
|
|
- if (empty($rs['belong_schemas'])) {
|
|
|
- $rs['belong_schemas'] = "public";
|
|
|
- }
|
|
|
- if (empty($rs['main_schemas'])) {
|
|
|
- $rs['main_schemas'] = "public";
|
|
|
- }
|
|
|
-
|
|
|
if (!empty($rs)) {
|
|
|
+ if (empty($rs['belong_schemas'])) {
|
|
|
+ $rs['belong_schemas'] = "public";
|
|
|
+ }
|
|
|
+ if (empty($rs['main_schemas'])) {
|
|
|
+ $rs['main_schemas'] = "public";
|
|
|
+ }
|
|
|
//验证employee是否active
|
|
|
if (!empty($rs["employee_id"]) && $rs["employee_id_active"] != "t") {
|
|
|
if (strtolower(Soure) =='topocean'){
|
|
|
@@ -71,10 +70,10 @@ class login {
|
|
|
}
|
|
|
|
|
|
$data = array(
|
|
|
- 'msg' => 'no_active',
|
|
|
+ 'code' => 'no_active',
|
|
|
'login_version' => $rs["login_version"],
|
|
|
'data' => $data,
|
|
|
- 'desc' => "Please check with Doc Center $data for searching function"
|
|
|
+ 'msg' => "Please check with Doc Center $data for searching function"
|
|
|
);
|
|
|
common::echo_json_encode(500, $data);
|
|
|
$this->failedLogin($uname, 'Employee not active');
|
|
|
@@ -109,10 +108,10 @@ class login {
|
|
|
if ($rs['is_online'] != 't') {
|
|
|
if (strtolower($rs['user_type']) != "employee") {
|
|
|
$data =array(
|
|
|
- 'msg' => 'no_online',
|
|
|
+ 'code' => 'no_online',
|
|
|
'login_version' => $rs["login_version"],
|
|
|
'data' => '',
|
|
|
- 'desc' => 'No activation or insufficient permissions'
|
|
|
+ 'msg' => 'No activation or insufficient permissions'
|
|
|
);
|
|
|
common::echo_json_encode(500, $data);
|
|
|
$this->failedLogin($uname, 'Online is not active');
|
|
|
@@ -139,10 +138,10 @@ class login {
|
|
|
|
|
|
if ($rs['online_active'] != 't') {
|
|
|
$data = array(
|
|
|
- 'msg' => 'no_active',
|
|
|
+ 'code' => 'no_active',
|
|
|
'login_version' => $rs["login_version"],
|
|
|
'data' => '',
|
|
|
- 'desc' => 'Please check with Doc Center for searching function'
|
|
|
+ 'msg' => 'Please check with Doc Center for searching function'
|
|
|
);
|
|
|
common::echo_json_encode(500, $data);
|
|
|
$this->failedLogin($uname, 'Online is not active');
|
|
|
@@ -152,20 +151,20 @@ class login {
|
|
|
$tar = utils::checkPassword($rs['password']);
|
|
|
if (!empty($tar)) {
|
|
|
$data = array(
|
|
|
- 'msg' => $tar,
|
|
|
+ 'code' => $tar,
|
|
|
'login_version' => $rs["login_version"],
|
|
|
'data' => '',
|
|
|
- 'desc' => $tar
|
|
|
+ 'msg' => $tar
|
|
|
);
|
|
|
common::echo_json_encode(500, $data);
|
|
|
exit();
|
|
|
}
|
|
|
if (empty($rs['last_pwd_change'])) {
|
|
|
$data = array(
|
|
|
- 'msg' => 'first_login',
|
|
|
+ 'code' => 'first_login',
|
|
|
'login_version' => $rs["login_version"],
|
|
|
'data' => '',
|
|
|
- 'desc' => 'First login, please change your password'
|
|
|
+ 'msg' => 'First login, please change your password'
|
|
|
);
|
|
|
common::echo_json_encode(500, $data);
|
|
|
exit();
|
|
|
@@ -233,9 +232,9 @@ class login {
|
|
|
if(empty($email)){
|
|
|
$data = array(
|
|
|
'status' => '0',
|
|
|
- 'msg' => 'login user email is empty',
|
|
|
+ 'code' => 'login user email is empty',
|
|
|
'login_version' => $rs["login_version"],
|
|
|
- 'desc' => 'login user email is empty'
|
|
|
+ 'msg' => 'login user email is empty'
|
|
|
);
|
|
|
common::echo_json_encode(500, $data);
|
|
|
exit();
|
|
|
@@ -402,18 +401,18 @@ class login {
|
|
|
exit();
|
|
|
} else {
|
|
|
$data = array(
|
|
|
- 'msg' => 'database_error',
|
|
|
+ 'code' => 'database_error',
|
|
|
'login_version' => $rs["login_version"],
|
|
|
- 'desc' => 'database_error'
|
|
|
+ 'msg' => 'database_error'
|
|
|
);
|
|
|
common::echo_json_encode(500, $data);
|
|
|
exit();
|
|
|
}
|
|
|
} else {
|
|
|
$data = array(
|
|
|
- 'msg' => 'no_exist',
|
|
|
+ 'code' => 'no_exist',
|
|
|
'login_version' => $rs["login_version"],
|
|
|
- 'desc' => 'The username or password you entered is incorrect'
|
|
|
+ 'msg' => 'The username or password you entered is incorrect'
|
|
|
);
|
|
|
common::echo_json_encode(500, $data);
|
|
|
exit();
|
|
|
@@ -549,10 +548,17 @@ class login {
|
|
|
$msg = "Login Name or Email Required !";
|
|
|
}
|
|
|
|
|
|
- $data = array(
|
|
|
- 'msg' => $msg,
|
|
|
- );
|
|
|
- common::echo_json_encode(200, $data);
|
|
|
+ if($msg == 'success'){
|
|
|
+ $data = array(
|
|
|
+ 'msg' => $msg,
|
|
|
+ );
|
|
|
+ common::echo_json_encode(200, $data);
|
|
|
+ }else{
|
|
|
+ $data = array(
|
|
|
+ 'msg' => $msg,
|
|
|
+ );
|
|
|
+ common::echo_json_encode(500, $data);
|
|
|
+ }
|
|
|
exit();
|
|
|
}
|
|
|
|
|
|
@@ -1147,7 +1153,7 @@ class login {
|
|
|
when a.code='IFFDEP' then 'Departed'
|
|
|
when a.code='IFFARR' then 'Arrived'
|
|
|
when a.code='IFFAFD' then 'Completed'
|
|
|
- else 'Booked' END as status,
|
|
|
+ else 'Booked' END as status
|
|
|
from ocean_milestone a
|
|
|
where a.serial_no=o.serial_no
|
|
|
and a.code in (select regexp_split_to_table('IFFBCF,IFFCPU,IFFREC,IFFDEP,IFFARR,IFFAFD', ','))
|
|
|
@@ -1277,7 +1283,7 @@ class login {
|
|
|
when a.code='IFFDEP' then 'Departed'
|
|
|
when a.code='IFFARR' then 'Arrived'
|
|
|
when a.code='IFFAFD' then 'Completed'
|
|
|
- else 'Booked' END as status,
|
|
|
+ else 'Booked' END as status
|
|
|
from ocean_milestone a
|
|
|
where a.serial_no=o.serial_no
|
|
|
and a.code in (select regexp_split_to_table('IFFBCF,IFFCPU,IFFREC,IFFDEP,IFFARR,IFFAFD', ','))
|