diff --git a/application/config/config.php b/application/config/config.php index c457c81..30b311c 100644 --- a/application/config/config.php +++ b/application/config/config.php @@ -233,7 +233,7 @@ $config['log_threshold'] = 4; | application/logs/ directory. Use a full server path with trailing slash. | */ -$config['log_path'] = '/var/www/html/application/logs/'; +$config['log_path'] = '/var/www/html3/application/logs/'; /* |-------------------------------------------------------------------------- @@ -244,7 +244,7 @@ $config['log_path'] = '/var/www/html/application/logs/'; | application/download/ directory. Use a full server path with trailing slash. | */ -$config['download_path'] = '/var/www/html/application/download/'; +$config['download_path'] = '/var/www/html3/application/download/'; /* |-------------------------------------------------------------------------- diff --git a/application/config/database.php b/application/config/database.php index cca4d53..7e906f1 100644 --- a/application/config/database.php +++ b/application/config/database.php @@ -74,11 +74,11 @@ $query_builder = TRUE; $db['default'] = array( 'dsn' => '', - 'hostname' => '127.0.0.1', - 'port' => '9506', + 'hostname' => 'db', + 'port' => '3306', 'username' => 'root', 'password' => '123456', - 'database' => 'dev_ddds_db', + 'database' => 'dev_TRACERDB7', 'dbdriver' => 'mysqli', 'dbprefix' => '', 'pconnect' => FALSE, @@ -97,11 +97,11 @@ $db['default'] = array( $db['second'] = array( 'dsn' => '', - 'hostname' => '127.0.0.1', - 'port' => '9506', + 'hostname' => 'db', + 'port' => '3306', 'username' => 'root', 'password' => '123456', - 'database' => 'dev_tracer_db', + 'database' => 'dev_TRACERDB7', 'dbdriver' => 'mysqli', 'dbprefix' => '', 'pconnect' => FALSE, diff --git a/application/config/hooks.php b/application/config/hooks.php index f107ef3..116cc2f 100644 --- a/application/config/hooks.php +++ b/application/config/hooks.php @@ -47,9 +47,10 @@ $hook['post_controller_constructor'][] = array( 'filepath' => 'hooks', ); +// SQLクエリログを有効化 $hook['post_controller'][] = array( - 'class' => 'Log_Query', - 'function' => 'run', - 'filename' => 'Log_query.php', + 'class' => 'QueryLogger', + 'function' => 'logQueries', + 'filename' => 'QueryLogger.php', 'filepath' => 'hooks' ); \ No newline at end of file diff --git a/application/controllers/common/Auth.php b/application/controllers/common/Auth.php index b4d2329..b6d6c04 100644 --- a/application/controllers/common/Auth.php +++ b/application/controllers/common/Auth.php @@ -61,7 +61,7 @@ class Auth extends CI_Controller redirect($this->redirectPage); } - //vf + //��v�f $jwt = $_COOKIE['MY_SESSION'] ?? null; if (!$this->session->userdata('is_login') && $jwt) { log_message('info', '$this->login() 2FA Action'); @@ -91,7 +91,7 @@ class Auth extends CI_Controller log_message('info', '$this->domain: ' . $this->domain); - $jwt = $_COOKIE['MY_SESSION'] ?? null; // Cookiȅꍇ + $jwt = $_COOKIE['MY_SESSION'] ?? null; // Cookie�̏ꍇ if (!$this->session->userdata('is_login') && $jwt) { log_message('info', '------------------Auth.php-login()-2FA---------------------'); log_message('info', 'is_login: ' . var_export($this->session->userdata('is_login'),true)); @@ -132,20 +132,24 @@ class Auth extends CI_Controller if ($account) { log_message('info','password_datetime'.$account->password_datetime.'=='.strtotime($account->password_datetime)); - //̈ڐÃTCgɐ̂Ɗw[UOCꍇ - if ($this->branch === APP_TRANSPLANT && in_array($account->institution_kubun, [INSTITUTION_KUBUN_LIVING_DONOR, INSTITUTION_KUBUN_MANAGEMENT])){ + //���̈ڐA�̃T�C�g�ɐ��̂Ɗw��[�U�����O�C�������ꍇ + // 改善: dddsドメインでは学会ユーザー(INSTITUTION_KUBUN_MANAGEMENT)のアクセスを許可 + if ($this->branch === APP_TRANSPLANT && + $this->domain !== 'ddds' && + in_array($account->institution_kubun, [INSTITUTION_KUBUN_LIVING_DONOR, INSTITUTION_KUBUN_MANAGEMENT])){ log_message('info', '------------------Auth.php-login living_user block------------------'); + log_message('info', 'BLOCKED: domain=' . $this->domain . ' (should not be ddds), kubun=' . $account->institution_kubun); log_message('info','$account->institution_kubun:'.$account->institution_kubun); $this->data["error_message"] = lang("login"); - //L؂ + //�L�������؂� }elseif (strtotime(config_item('password_expired'), strtotime($account->password_datetime)) < strtotime(date('Y-m-d'))) { log_message('info', '------------------password_expired------------------'); //$this->session->set_flashdata('account', $account); - // F؏ZbVŕۑiOC㈵j + // �F�؏����Z�b�V�����ŕۑ��i���O�C���㈵���j $this->session->set_userdata('account', $account); $this->session->set_userdata('branch', $this->branch); redirect('password'); - // + //���� } else { log_message('info', '------------------Auth.php-login success------------------'); session_regenerate_id(true); @@ -163,8 +167,11 @@ class Auth extends CI_Controller $this->session->set_userdata('cordinatorId', $account->cordinatorId); $this->session->set_userdata('cordinator_type_mst_id', $account->cordinator_type_mst_id); } else if ($this->branch === APP_TRANSPLANT || $this->branch === APP_TRANSLIVE ) { - // TCg̈ڐAiAPP_TRANSPLANTj̏ꍇA[Uinstitution_kubun̂ƊwȂ烍OCubN - if ($this->branch === APP_TRANSPLANT && in_array($account->institution_kubun, [INSTITUTION_KUBUN_LIVING_DONOR, INSTITUTION_KUBUN_MANAGEMENT])) { + // �T�C�g�����̈ڐA�iAPP_TRANSPLANT�j�̏ꍇ�A���[�U��institution_kubun�����̂Ɗw��Ȃ烍�O�C�����u���b�N + // 改善: dddsドメインでは学会ユーザー(INSTITUTION_KUBUN_MANAGEMENT)のアクセスを許可 + if ($this->branch === APP_TRANSPLANT && + $this->domain !== 'ddds' && + in_array($account->institution_kubun, [INSTITUTION_KUBUN_LIVING_DONOR, INSTITUTION_KUBUN_MANAGEMENT])) { $this->data["error_message"] = lang("login"); $this->load->vars($this->data); $this->load->view('header'); @@ -191,7 +198,7 @@ class Auth extends CI_Controller && ($account->cordinator_type_mst_id == COR_TYPE_CO)) { $this->data["error_message"] = lang("login"); } else { - //Ej[փ_CNg + //�����E���j���[�փ��_�C���N�g log_message('info','work_id:'.explode(',', $account->work_id)); log_message('info', 'set account:' . var_export($this->session->userdata('account'), true)); log_message('info', '$this->redirectPage: go to menu' ); @@ -218,16 +225,16 @@ class Auth extends CI_Controller { log_message('info', '------------------Auth.php-logout() ------------------'); - // ZbVj + // �Z�b�V�����j�� $this->session->sess_destroy(); - // vf + // ��v�f $jwt = $_COOKIE['MY_SESSION'] ?? null; if ($jwt) { - // 2FAΉ̃OAEg + // 2FA�Ή��̃��O�A�E�g��� redirect('/logout'); } else { - // ʏ탍OAEg gbvy[W + // �ʏ탍�O�A�E�g �� �g�b�v�y�[�W�� redirect(base_url()); } } @@ -242,9 +249,9 @@ class Auth extends CI_Controller $remainder = strlen($data) % 4; if ($remainder) { $padlen = 4 - $remainder; - $data .= str_repeat('=', $padlen); // pfBOlj + $data .= str_repeat('=', $padlen); // �p�f�B���O��lj� } - return base64_decode(strtr($data, '-_', '+/')); // URL`ʏBase64ɕϊ + return base64_decode(strtr($data, '-_', '+/')); // URL�`����ʏ��Base64�ɕϊ� } } diff --git a/application/logs/index.html b/application/logs/index.html old mode 100644 new mode 100755 diff --git a/application/models/TIshokuKihonLiv.php b/application/models/TIshokuKihonLiv.php index 4004f8d..fb6b0b6 100644 --- a/application/models/TIshokuKihonLiv.php +++ b/application/models/TIshokuKihonLiv.php @@ -216,7 +216,7 @@ class TIshokuKihonLiv extends CI_Model // Search by チェック対象 // Search by 入力状況 Recipent - $shouldSearchByInputStatusRecipent = $conditions['input_status_recipent']; + $shouldSearchByInputStatusRecipent = isset($conditions['input_status_recipent']) ? $conditions['input_status_recipent'] : array(); switch (true) { case (isset($conditions['check_target_recipent']) && $conditions['check_target_recipent'] == '0'): $this->db->where('transplanted_recipient.KIROKU_TIMING', TRANSPLANT_STATUS_TRANSPLANTED); @@ -239,7 +239,7 @@ class TIshokuKihonLiv extends CI_Model } // Search by 入力状況 Donor - $shouldSearchByInputStatusDonor = $conditions['input_status_donor']; + $shouldSearchByInputStatusDonor = isset($conditions['input_status_donor']) ? $conditions['input_status_donor'] : array(); switch (true) { case (isset($conditions['check_target_donor']) && $conditions['check_target_donor'] == '0'): $this->db->where('IF(transplanted_donor2.NYURYOKUJOKYO IS NULL AND (transplanted_donor1.KIROKU_TIMING = "1") , "1" ,(IF(CAST(transplanted_donor1.KIROKU_TIMING AS UNSIGNED) + CAST(transplanted_donor2.KIROKU_TIMING AS UNSIGNED)= 2 , "1", "0"))) =', TRANSPLANT_STATUS_TRANSPLANTED ); diff --git a/application/views/transplant/menu.php b/application/views/transplant/menu.php index fe4a664..4dfd53f 100644 --- a/application/views/transplant/menu.php +++ b/application/views/transplant/menu.php @@ -6,10 +6,13 @@